Your message dated Mon, 12 May 2014 14:01:20 +0200
with message-id <[email protected]>
and subject line Re: Bug#747854: sysvrc: invoke-rc.d fails on masked systemd
units
has caused the Debian Bug report #747854,
regarding sysvrc: invoke-rc.d fails on masked systemd units
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.)
--
747854: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=747854
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: sysv-rc
Version: 2.88dsf-55
Tags: patch
User: [email protected]
Usertags: origin-ubuntu ubuntu-patch utopic
Hello,
if you have a masked systemd unit, i. e. one that just points to
/dev/null, invoke-rc.d fails with error code 100:
| $ sudo sh -x /usr/sbin/invoke-rc.d cgroup-lite start
| [...]
| + test -d /run/systemd/system
| + is_systemd=1
| [...]
| + systemctl -p LoadState show cgroup-lite.service
| + _state=LoadState=masked
| + [ LoadState=masked != LoadState=masked ]
| + [ = 1 ]
| + [ -z ]
| + test ! -f /etc/init.d/cgroup-lite
| + querypolicy
| + policyaction=start
| + test x = x101
| + test x/usr/sbin/policy-rc.d != x
| + test -x /usr/sbin/policy-rc.d
| + test x = x
| + RC=104
| + return
| + exit 100
As these units are meant to be no-ops, I think invoke-rc.d should
succeed instead of failing a package install/upgrade due to that.
Tested patch against current git attached (on top of the one in bug
#747851, but this only collides on debian/changelog).
Thanks for considering,
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
>From 52acfe6c9e0dcbb40f81785416b1d726765c1267 Mon Sep 17 00:00:00 2001
From: Martin Pitt <[email protected]>
Date: Mon, 12 May 2014 11:24:03 +0200
Subject: [PATCH 2/2] invoke-rc.d: Don't fail if a systemd unit is masked.
A masked systemd unit (i. e. symlinked to /dev/null) is meant to be a no-op, so
just succeed in this case instead of erroring with code 100.
LP: #1312975
---
debian/changelog | 1 +
debian/src/sysv-rc/sbin/invoke-rc.d | 3 +++
2 files changed, 4 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 9beb398..a97083a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,6 +21,7 @@ sysvinit (2.88dsf-56) UNRELEASED; urgency=medium
[ Martin Pitt ]
* invoke-rc.d: Fix actions to run under systemd if there is no init.d
script.
+ * invoke-rc.d: Don't fail if a systemd unit is masked. (LP: #1312975)
-- Dimitri John Ledkov <[email protected]> Tue, 22 Apr 2014 14:41:18 +0100
diff --git a/debian/src/sysv-rc/sbin/invoke-rc.d b/debian/src/sysv-rc/sbin/invoke-rc.d
index 2ce4abc..598fe22 100644
--- a/debian/src/sysv-rc/sbin/invoke-rc.d
+++ b/debian/src/sysv-rc/sbin/invoke-rc.d
@@ -395,6 +395,9 @@ elif [ -n "$is_systemd" ]; then
_state=$(systemctl -p LoadState show "${UNIT}" 2>/dev/null)
if [ "$_state" != "LoadState=masked" ]; then
_executable=1
+ else
+ printerror Unit ${UNIT} is masked
+ exit 0
fi
elif testexec "${INITDPREFIX}${INITSCRIPTID}"; then
_executable=1
--
2.0.0.rc0
--- End Message ---
--- Begin Message ---
Martin Pitt [2014-05-12 12:34 +0200]:
> elif [ -z "$is_upstart" ] && test ! -f "${INITDPREFIX}${INITSCRIPTID}" ;
> then
Argh. This is an Ubuntu-ism. I thought I was testing with
Debian's invoke-rc.d, but apparently I mixed up the versions.
I'm sorry for the noise! Closing.
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
signature.asc
Description: Digital signature
--- End Message ---
_______________________________________________
Pkg-sysvinit-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-sysvinit-devel