Commit 4998c480 authored by Martin Pitt's avatar Martin Pitt
Browse files

Skip-99-systemd.rules-when-not-running-systemd-as-in.patch: Call path_id under all init systems

This gets consistent ID_PATH attributes. This is required so that tools like
systemd-rfkill can be used with SysVinit or upstart scripts, too.

LP: #1387282
parent 8178d8db
......@@ -17,6 +17,10 @@ systemd (215-6) UNRELEASED; urgency=medium
behaviour.
* debian/README.Debian: Document how to debug boot or shutdown problems with
the debug shell. (Closes: #766039)
* Skip-99-systemd.rules-when-not-running-systemd-as-in.patch: Call path_id
under all init systems, to get consistent ID_PATH attributes. This is
required so that tools like systemd-rfkill can be used with SysVinit or
upstart scripts, too. (LP: #1387282)
-- Martin Pitt <mpitt@debian.org> Sun, 12 Oct 2014 17:29:00 +0200
......
......@@ -2,19 +2,43 @@ From: Tollef Fog Heen <tfheen@err.no>
Date: Mon, 28 Oct 2013 14:31:37 +0100
Subject: Skip 99-systemd.rules when not running systemd as init.
Keep the calling of path_id though, to get consistent ID_PATH attributes under
all init systems. This is required so that tools like systemd-rfkill can be
used with SysVinit or upstart scripts, too.
---
rules/99-systemd.rules.in | 1 +
1 file changed, 1 insertion(+)
rules/99-systemd.rules.in | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/rules/99-systemd.rules.in b/rules/99-systemd.rules.in
index c3ef81b..df83a38 100644
index c3ef81b..4366969 100644
--- a/rules/99-systemd.rules.in
+++ b/rules/99-systemd.rules.in
@@ -6,6 +6,7 @@
# (at your option) any later version.
@@ -7,6 +7,12 @@
ACTION=="remove", GOTO="systemd_end"
+TEST!="/run/systemd/system", GOTO="systemd_end"
+# short-circuit most rules when not running under systemd; just keep calling
+# path_id so that we can use the hardware status helpers under other init
+# systems
+SUBSYSTEM=="backlight|leds|rfkill", IMPORT{builtin}="path_id"
+TEST!="/run/systemd/system", GOTO="systemd_end"
+
SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*|3270/tty[0-9]*", TAG+="systemd"
KERNEL=="vport*", TAG+="systemd"
@@ -57,12 +63,12 @@ ACTION=="add", SUBSYSTEM=="net", KERNEL!="lo", RUN+="@rootlibexecdir@/systemd-sy
# Pull in backlight save/restore for all backlight devices and
# keyboard backlights
-SUBSYSTEM=="backlight", TAG+="systemd", IMPORT{builtin}="path_id", ENV{SYSTEMD_WANTS}+="systemd-backlight@backlight:$name.service"
-SUBSYSTEM=="leds", KERNEL=="*kbd_backlight", TAG+="systemd", IMPORT{builtin}="path_id", ENV{SYSTEMD_WANTS}+="systemd-backlight@leds:$name.service"
+SUBSYSTEM=="backlight", TAG+="systemd", ENV{SYSTEMD_WANTS}+="systemd-backlight@backlight:$name.service"
+SUBSYSTEM=="leds", KERNEL=="*kbd_backlight", TAG+="systemd", ENV{SYSTEMD_WANTS}+="systemd-backlight@leds:$name.service"
# Pull in rfkill save/restore for all rfkill devices
-SUBSYSTEM=="rfkill", TAG+="systemd", IMPORT{builtin}="path_id", ENV{SYSTEMD_WANTS}+="systemd-rfkill@$name.service"
+SUBSYSTEM=="rfkill", TAG+="systemd", ENV{SYSTEMD_WANTS}+="systemd-rfkill@$name.service"
# Asynchronously mount file systems implemented by these modules as
# soon as they are loaded.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment