From 0227bf9cb1c69e47adb3301baddb0ce52a3bf654a818ea9fef65593b3cdbc0b8 Mon Sep 17 00:00:00 2001 From: Robert Milasan Date: Tue, 8 Jan 2013 13:29:03 +0000 Subject: [PATCH] - make 'reload' and 'force-reload' LSB compliant (bnc#793936). - make 'reload' and 'force-reload' LSB compliant (bnc#793936). OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=325 --- boot.udev | 41 +++++++++++++++++------------------------ systemd-mini.changes | 1 + systemd-mini.spec | 3 +++ systemd.changes | 1 + systemd.spec | 3 +++ 5 files changed, 25 insertions(+), 24 deletions(-) diff --git a/boot.udev b/boot.udev index 82ea2399..4fa0bd63 100644 --- a/boot.udev +++ b/boot.udev @@ -14,19 +14,22 @@ . /etc/rc.status -PATH="/sbin:/bin" +PATH="/sbin:/bin:/usr/sbin:/usr/bin" +DAEMON="@@SYSTEMD@@/systemd-udevd" +UDEVADM="@@BINDIR@@/udevadm" +WRITERULE="@@PREFIX@@/write_dev_root_rule" udev_timeout=180 case "$1" in start) # create /dev/root symlink with dynamic rule - if [ -x /lib/udev/write_dev_root_rule ]; then - /lib/udev/write_dev_root_rule + if [ -x ${WRITERULE} ]; then + ${WRITERULE} >/dev/null 2>&1 || true fi # start udevd echo -n "Starting udevd: " - /sbin/udevd --daemon + ${DAEMON} --daemon if [ $? -ne 0 ]; then rc_status -v rc_exit @@ -35,42 +38,32 @@ case "$1" in # trigger events for all devices echo -n "Loading drivers, configuring devices: " - /sbin/udevadm trigger --type=subsystems --action=add - /sbin/udevadm trigger --type=devices --action=add + ${UDEVADM} trigger --type=subsystems --action=add + ${UDEVADM} trigger --type=devices --action=add # wait for events to finish - /sbin/udevadm settle --timeout=$udev_timeout + ${UDEVADM} settle --timeout=$udev_timeout rc_status -v ;; stop) echo -n "Stopping udevd: " - killproc /sbin/udevd + killproc ${DAEMON} rc_status -v ;; restart) echo -n "Restarting udevd: " - killproc /sbin/udevd - /sbin/udevd --daemon + killproc ${DAEMON} + ${DAEMON} --daemon rc_status -v ;; status) echo -n "Checking for udevd: " - checkproc /sbin/udevd + checkproc ${DAEMON} rc_status -v ;; - reload) - echo -n "Reloading udev rules: " - /sbin/udevadm control --reload-rules - rc_status -v - ;; - force-reload) - echo -n "Restarting udev and reconfiguring all devices: " - killproc /sbin/udevd - rm -rf /dev/.udev /dev/disk - root_symlink_rule - /sbin/udevd --daemon - /sbin/udevadm trigger --action=add - /sbin/udevadm settle --timeout=$udev_timeout + reload|force-reload) + echo -n "Reloading udevd: " + killproc -G -HUP ${DAEMON} rc_status -v ;; *) diff --git a/systemd-mini.changes b/systemd-mini.changes index 4a43a27f..27ae0040 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -5,6 +5,7 @@ Tue Jan 8 12:47:43 UTC 2013 - rmilasan@suse.com add: 1007-udevd-add-missing-to-getopt_long-e.patch - clean up systemd.spec, make it easy to see which are udev and systemd patches. +- make 'reload' and 'force-reload' LSB compliant (bnc#793936). ------------------------------------------------------------------- Tue Dec 11 00:22:50 UTC 2012 - crrodriguez@opensuse.org diff --git a/systemd-mini.spec b/systemd-mini.spec index c964281d..b7be3679 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -424,6 +424,9 @@ ln -sf /lib/firmware $RPM_BUILD_ROOT/usr/lib/firmware install -m755 -D %{S:8} $RPM_BUILD_ROOT/etc/init.d/systemd-journald %endif +sed -ie "s|@@PREFIX@@|%{_prefix}/lib/udev|g" %{S:1060} +sed -ie "s|@@SYSTEMD@@|%{_prefix}/lib/systemd|g" %{S:1060} +sed -ie "s|@@BINDIR@@|%{_bindir}|g" %{S:1060} install -m755 -D %{S:1060} $RPM_BUILD_ROOT/etc/init.d/boot.udev ln -s systemd-udevd.service $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/udev.service sed -ie "s|@@PREFIX@@|%{_bindir}|g" %{S:1061} diff --git a/systemd.changes b/systemd.changes index 7f361b7b..3d94cc4f 100644 --- a/systemd.changes +++ b/systemd.changes @@ -5,6 +5,7 @@ Tue Jan 8 12:47:43 UTC 2013 - rmilasan@suse.com add: 1007-udevd-add-missing-to-getopt_long-e.patch - clean up systemd.spec, make it easy to see which are udev and systemd patches. +- make 'reload' and 'force-reload' LSB compliant (bnc#793936). ------------------------------------------------------------------- Tue Dec 11 00:22:50 UTC 2012 - crrodriguez@opensuse.org diff --git a/systemd.spec b/systemd.spec index 3d225572..55c77bdb 100644 --- a/systemd.spec +++ b/systemd.spec @@ -419,6 +419,9 @@ ln -sf /lib/firmware $RPM_BUILD_ROOT/usr/lib/firmware install -m755 -D %{S:8} $RPM_BUILD_ROOT/etc/init.d/systemd-journald %endif +sed -ie "s|@@PREFIX@@|%{_prefix}/lib/udev|g" %{S:1060} +sed -ie "s|@@SYSTEMD@@|%{_prefix}/lib/systemd|g" %{S:1060} +sed -ie "s|@@BINDIR@@|%{_bindir}|g" %{S:1060} install -m755 -D %{S:1060} $RPM_BUILD_ROOT/etc/init.d/boot.udev ln -s systemd-udevd.service $RPM_BUILD_ROOT/%{_prefix}/lib/systemd/system/udev.service sed -ie "s|@@PREFIX@@|%{_bindir}|g" %{S:1061}