Your message dated Sun, 14 Apr 2013 17:33:21 +0000
with message-id <[email protected]>
and subject line Bug#683084: fixed in sysvinit 2.88dsf-41+jessie1
has caused the Debian Bug report #683084,
regarding Make invoke-rc.d/update-rc.d systemd-aware
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
683084: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683084
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: sysv-rc
Version: 2.88dsf-22.1
Severity: wishlist
Tags: patch
Just like invoke-rc.d and update-rc.d can properly deal with a system
using upstart, it should support systemd as well.
The attached patches make invoke-rc.d and update-rc.d systemd aware.
This means that the enable/disable action of update-rc.d additionally
create the appropriate links for systemd (regardless of whether you are
running systemd or not). This will lead to users of sysvinit being able
to switch to systemd (and vice-versa) and still get the same set of
services started at boot.
Roger Leigh reviewed this patches and gave me a few valuable hints,
thanks for that.
It would be great if you could upload a new version of sysv-rc to
experimental which contains these patches. That’d be helpful to work on
other aspects of systemd packaging in Debian.
Best regards,
Michael
--- /usr/sbin/invoke-rc.d.O 2012-07-20 14:58:14.140223575 +0200
+++ /usr/sbin/invoke-rc.d 2012-07-28 15:53:26.969445300 +0200
@@ -38,6 +38,7 @@
RETURNFAILURE=
RC=
is_upstart=
+is_systemd=
# Shell options
set +e
@@ -273,6 +274,8 @@
&& [ -e "$UPSTARTDIR/${INITSCRIPTID}.conf" ]
then
is_upstart=1
+elif test -e /sys/fs/cgroup/systemd ; then
+ is_systemd=1
elif test ! -f "${INITDPREFIX}${INITSCRIPTID}" ; then
## Verifies if the given initscript ID is known
## For sysvinit, this error is critical
@@ -383,7 +386,18 @@
esac
# test if /etc/init.d/initscript is actually executable
-if [ -n "$is_upstart" ] || testexec "${INITDPREFIX}${INITSCRIPTID}" ; then
+_executable=
+if [ -n "$is_upstart" ]; then
+ _executable=1
+elif [ -n "$is_systemd" ]; then
+ _state=$(systemctl -p LoadState show "${INITSCRIPTID}.service" 2>/dev/null)
+ if [ "$_state" != "LoadState=masked" ]; then
+ _executable=1
+ fi
+elif testexec "${INITDPREFIX}${INITSCRIPTID}"; then
+ _executable=1
+fi
+if [ "$_executable" = "1" ]; then
if test x${RC} = x && test x${MODE} = xquery ; then
RC=105
fi
@@ -496,6 +510,31 @@
initctl "$saction" "$INITSCRIPTID" && exit 0
;;
esac
+ elif [ -n "$is_systemd" ]; then
+ case $saction in
+ start|stop|restart|status)
+ systemctl "${saction}" "${INITSCRIPTID}.service" && exit 0
+ ;;
+ reload)
+ _canreload="$(systemctl -p CanReload show $service 2>/dev/null)"
+ if [ "$_canreload" = "CanReload=no" ]; then
+ "${INITDPREFIX}${INITSCRIPTID}" "${saction}" "$@" && exit 0
+ else
+ systemctl reload "${INITSCRIPTID}.service" && exit 0
+ fi
+ ;;
+ force-stop)
+ systemctl --signal=KILL kill "${INITSCRIPTID}.service" && exit 0
+ ;;
+ force-reload)
+ systemctl restart "${INITSCRIPTID}.service" && exit 0
+ ;;
+ *)
+ # We try to run non-standard actions by running
+ # the init script directly.
+ "${INITDPREFIX}${INITSCRIPTID}" "${saction}" "$@" && exit 0
+ ;;
+ esac
else
"${INITDPREFIX}${INITSCRIPTID}" "${saction}" "$@" && exit 0
fi
--- /usr/sbin/update-rc.d.O 2012-07-20 16:48:26.446152769 +0200
+++ /usr/sbin/update-rc.d 2012-07-21 10:55:41.408503038 +0200
@@ -5,6 +5,7 @@
use strict;
use warnings;
+use File::Path qw(make_path); # in core since Perl 5.001
my $initd = "/etc/init.d";
my $etcd = "/etc/rc";
@@ -424,6 +425,42 @@
error("initscript does not exist: /etc/init.d/$scriptname");
}
} elsif ("disable" eq $action || "enable" eq $action) {
+ # In addition to the insserv call we also enable/disable the service
+ # for systemd by creating the appropriate symlink in case there is a
+ # native systemd service. We need to do this on our own instead of
+ # using systemctl because systemd might not even be installed yet.
+ my $service_path;
+ if (-f "/etc/systemd/system/$scriptname.service") {
+ $service_path = "/etc/systemd/system/$scriptname.service";
+ } elsif (-f "/lib/systemd/system/$scriptname.service") {
+ $service_path = "/lib/systemd/system/$scriptname.service";
+ }
+ if (defined($service_path)) {
+ my $changed_sth;
+ open my $fh, '<', $service_path or error("unable to read $service_path");
+ while (<$fh>) {
+ chomp;
+ if (/^\s*WantedBy=(.+)$/i) {
+ my $wants_dir = "/etc/systemd/system/$1.wants";
+ my $service_link = "$wants_dir/$scriptname.service";
+ if ("enable" eq $action) {
+ make_path($wants_dir);
+ symlink($service_path, $service_link);
+ } else {
+ unlink($service_link) if -e $service_link;
+ }
+ $changed_sth = 1;
+ }
+ }
+ close($fh);
+
+ # If we changed anything and this machine is running systemd, tell
+ # systemd to reload so that it will immediately pick up our
+ # changes.
+ if ($changed_sth && -e "/sys/fs/cgroup/systemd") {
+ system("systemctl", "daemon-reload");
+ }
+ }
insserv_toggle($notreally, $action, $scriptname, @args);
# Call insserv to resequence modified links
my $rc = system("insserv", @opts, $scriptname) >> 8;
--- End Message ---
--- Begin Message ---
Source: sysvinit
Source-Version: 2.88dsf-41+jessie1
We believe that the bug you reported is fixed in the latest version of
sysvinit, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Roger Leigh <[email protected]> (supplier of updated sysvinit package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Format: 1.8
Date: Sat, 28 Jul 2012 20:09:11 +0100
Source: sysvinit
Binary: sysvinit sysvinit-utils sysv-rc initscripts bootlogd
Architecture: source amd64 all
Version: 2.88dsf-41+jessie1
Distribution: experimental
Urgency: low
Maintainer: Debian sysvinit maintainers
<[email protected]>
Changed-By: Roger Leigh <[email protected]>
Description:
bootlogd - daemon to log boot messages
initscripts - scripts for initializing and shutting down the system
sysv-rc - System-V-like runlevel change mechanism
sysvinit - System-V-like init utilities
sysvinit-utils - System-V-like utilities
Closes: 630723 660862 683084 683804 693960 701031 703571 704923 705052
Changes:
sysvinit (2.88dsf-41+jessie1) experimental; urgency=low
.
[ Roger Leigh ]
* initscripts:
- Move /etc/nologin and /var/lib/initscripts/nologin to
/run/nologin. This means that nologin is always created on
a writable, available filesystem. Closes: #660862.
- Remove code to generate /etc/mtab. /etc/mtab is now always a
symbolic link to /proc/mounts. Closes: #630723.
- Remove incorrect use of break in case blocks in vars.sh. Thanks
to Raphaël Hertzog for this patch. Closes: #701031.
- /etc/network/if-up.d/mountnfs: Skip lo if already configured.
Closes: #705052. Thanks to Timo Weingärtner.
* sysvinit:
- Document length limit of 127 in inittab process field. Thanks
to Johannes Truschnigg. Closes: #693960.
* sysv-rc:
- Fix typo in invoke-rc.d(8). Closes: #683804. Thanks to
Martin-Éric Racine.
.
[ Michael Stapelberg ]
* systemd: update check to look for /run/systemd/system.
Closes: #703571
* sysv-rc:
- Add systemd support to update-rc.d(8) and invoke-rc.d(8).
Closes: #683084.
- service(8): use systemctl on machines that run systemd.
Closes: #704923
Checksums-Sha1:
3e073e226692e933daefb2d55378cab257731f6d 2374 sysvinit_2.88dsf-41+jessie1.dsc
a47b2d70e510f7098aba89fe2eba26c196d066c9 212142
sysvinit_2.88dsf-41+jessie1.debian.tar.gz
cd63abd9fa0b87ea28f4d761bcbf6035a2ce7962 134570
sysvinit_2.88dsf-41+jessie1_amd64.deb
df250df290d0e6d71555e2aa5051c9e9809fb546 101032
sysvinit-utils_2.88dsf-41+jessie1_amd64.deb
2206a90f65fc38836bb724e8a6b9aefc29a77969 82634
sysv-rc_2.88dsf-41+jessie1_all.deb
472b7b7b6f46778f643c16a44084d2a19d4378e1 93228
initscripts_2.88dsf-41+jessie1_amd64.deb
63dc8553b49bf13d2857fa8152af82accc9d6ac2 55554
bootlogd_2.88dsf-41+jessie1_amd64.deb
Checksums-Sha256:
f6155495cff2b2cca47e13fdb6424d1a4b7c5e341647165e336f667b42878b09 2374
sysvinit_2.88dsf-41+jessie1.dsc
c1839fae3271bf9dd9b52cfdbdea019919b60d8797162b2d1c8805c7bdda6315 212142
sysvinit_2.88dsf-41+jessie1.debian.tar.gz
63f4dc5142206fa63c264d7255814e4e312e74ed2197ed3728e6f009539eb313 134570
sysvinit_2.88dsf-41+jessie1_amd64.deb
cfed2f9351dae0c1e1e701264ec90799a0b17b6a9d3f05e7699bbfd42e2b57ba 101032
sysvinit-utils_2.88dsf-41+jessie1_amd64.deb
742e4119a6831f68a6e7ab785a16bdf74c0c76c1d73cb573dc671cee427765b2 82634
sysv-rc_2.88dsf-41+jessie1_all.deb
70299d0c25894e1ab9549790c2860ebeb92cb6a4c625497312fe88c795fc76d4 93228
initscripts_2.88dsf-41+jessie1_amd64.deb
821b9c168fbe03bc9ca9eea44d28242bfeec1fe88892bcb335e4fd8c6f4f0101 55554
bootlogd_2.88dsf-41+jessie1_amd64.deb
Files:
c47415dab8f5c16436f30ac9e8302dc5 2374 admin required
sysvinit_2.88dsf-41+jessie1.dsc
9dbcce4045b083ee806450d3344856b4 212142 admin required
sysvinit_2.88dsf-41+jessie1.debian.tar.gz
5dd49a0ce67c410ca1004b4b23703029 134570 admin required
sysvinit_2.88dsf-41+jessie1_amd64.deb
391f565a4199ddb30d4b67acf7df9b69 101032 admin required
sysvinit-utils_2.88dsf-41+jessie1_amd64.deb
0c0c1e28bbb957afd1881047579ff89d 82634 admin required
sysv-rc_2.88dsf-41+jessie1_all.deb
4b440fbce78b2dc6106c3dd64ba1529e 93228 admin required
initscripts_2.88dsf-41+jessie1_amd64.deb
a99ed829ae0195ecd233299d69bbc1f3 55554 admin optional
bootlogd_2.88dsf-41+jessie1_amd64.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAEBCgAGBQJRaudqAAoJEOJSSsUKn1xZiY8P/ittf5I8F1doi/YzrP2eIsiU
/k8EEorphMgF2hZBk3vgnocjIUqRjaftZVlSpYfD8Ldq7GWGhTYsglll6vJDW1s8
77mjqa+cvZNQ7dJ/V9zes2a2S/PF1M6qZNPy4OvpSn8MPAoGqYdxc7+vuKr/LbLS
8Q3ay//x6Wci0H9k4USNyy3phEX/n3TnCFro1vLT9CHVm6IT2LxaQkRS6qkR6y8h
lHcSUk/AaAeT8FWarGrd3VhQUF0zaljMRD0MjikxkdIa/gZ8ipmWxspKKay90cj8
uAftYlwXdciJtS9iP1geUozaJIH6Qi2toWOJaZww8RdEcYB/rIT9l9f7V13nmfa4
BS9KKCJqfVu7pRLksDoJAYaZq6sCzU2fwLb2dYrXf6u9MZdOdM7KPi7lvVHO1Hqw
L78KJlkWZrEil98E6a4tZnUtb3HAaf+FVhnDYcZn+RKuK9r1qPuYQgfUP0lhxdUX
zjksH0g/WCxERrehwepZ06mEtwcykzsWFe8GnWsa0jYsAjRP+Mv5+p6dGXu2jmtC
ceMHswaio0hDCzl5yasJ7tLbwI7egbmsL/Q6E+ULgglfZojFKB3MpRsR6YodSNWM
PcgrTsm4nNrxiT9uJdKkIkoTs92rEFPQTK54Fn1Ia/nkDxiZuEc+qntiCm1hcdS6
jchSjNFOLncIdRyXguU9
=CzQa
-----END PGP SIGNATURE-----
--- End Message ---
_______________________________________________
Pkg-sysvinit-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-sysvinit-devel