🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #2052

Bug#1151970: sway: Config assumes systemctl is present and produces and error on non-systemd systems

#2052
From: Mark Hindley
Date: Sun, 25 Oct 2026 18:10
86 lines
4774 bytes
Package: sway
Version: 1.12-1
Severity: normal
Tags: patch

Dear Maintainer,

On non-systemd systems where systemctl is not available, the default sway
configuration produces a startup error:

 sh: 1: systemctl: not found

Protecting the invocation of systemctl with a check for its existence fixes the
error and allows normal startup.

I suggest the patch below, matching the existing coding pattern.

Thanks

Mark

--- /tmp/ediffFnliNh	2026-10-25 10:43:53.124090910 +0000
+++ /tmp/ediffgsKEJr	2026-10-25 10:43:53.148090350 +0000
@@ -3,7 +3,8 @@
 # see also https://github.com/swaywm/sway/issues/5732
 # and https://github.com/systemd/systemd/blob/dfc637d0ff756889e8e5b7cb4ec991eb06069aa1/xorg/50-systemd-user.sh
 
-exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
+exec hash systemctl 2>dev/null && \
+        systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
 
 exec hash dbus-update-activation-environment 2>/dev/null && \
         dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK "XDG_CURRENT_DESKTOP=${XDG_CURRENT_DESKTOP:-sway:wlroots}"


-- System Information:
Distributor ID:	Devuan
Description:	Devuan GNU/Linux 7 (freia/ceres)
Release:	7
Codename:	freia ceres
Architecture: x86_64

Kernel: Linux 7.2.11+deb14-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: OpenRC (via /run/openrc), PID 1: init

Versions of packages sway depends on:
ii  libc6                            2.43-7
ii  libcairo2                        1.18.4-3+b1
ii  libdrm2                          2.4.134-3
ii  libelogind-compat [libsystemd0]  257.13-1
ii  libeudev1 [libudev1]             3.2.14-4
ii  libevdev2                        1.14.0+dfsg-1
ii  libgdk-pixbuf-2.0-0              2.44.8+dfsg-1
ii  libgl1-mesa-dri                  26.1.6-1
ii  libglib2.0-0t64                  2.90.1-2
ii  libinput10                       1.31.3-1
ii  libjson-c5                       0.19+ds-1
ii  libpango-1.0-0                   1.58.2-1
ii  libpangocairo-1.0-0              1.58.2-1
ii  libpcre2-8-0                     10.48-3.1
ii  libpixman-1-0                    0.46.4-1+b2
ii  libudev1                         1:3.2.9+devuan4
ii  libwayland-client0               1.26.0-1
ii  libwayland-cursor0               1.26.0-1
ii  libwayland-server0               1.26.0-1
ii  libwlroots-0.20                  0.20.2-1
ii  libxcb-icccm4                    0.4.2-1+b2
ii  libxcb1                          1.17.0-2+b2
ii  libxkbcommon0                    1.13.1-1
ii  swaybg                           1.2.2-1

Versions of packages sway recommends:
ii  foot     1.28.0-1
ii  polkitd  128-1devuan1
ii  wmenu    0.2.0-1

Versions of packages sway suggests:
ii  sway-backgrounds        1.12-1
ii  swayidle                1.9.0-1
ii  swaylock                1.8.6-1
pn  xdg-desktop-portal-gtk  <none>
pn  xdg-desktop-portal-wlr  <none>

-- no debconf information
Technical Details
Message-ID: <NSaPr-7PzO-159@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Mark Hindley <leepen@debian.org>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1151970: sway: Config assumes systemctl is present and produces and error on non-systemd systems
Date: Sun, 25 Oct 2026 19:10:05 +0100
Message-ID: <NSaPr-7PzO-159@gated-at.bofh.it>
X-Original-To: Debian Bug Tracking System <submit@bugs.debian.org>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Sun Oct 25 18:08:52 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.9
Reply-To: Mark Hindley <leepen@debian.org>, 1151970@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: team+swaywm@tracker.debian.org
X-Debian-Pr-Message: report 1151970
X-Debian-Pr-Package: sway
X-Debian-Pr-Keywords: patch
X-Debian-Pr-Source: sway
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Reportbug-Version: 13.2.0+devuan2
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/1998708
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 86
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Sun, 25 Oct 2026 10:48:57 +0000
X-Original-Message-ID: <at3emdYhlxX43PZT@hindley.org.uk>