Bug#701863: invoke-rc.d: report service when policy-rc.d prevents execution.

Dmitry Bogatov KAction at debian.org
Fri Jan 11 12:37:12 GMT 2019


control: tags -1 +patch

[2013-02-28 18:48] "Trent W. Buck" <trentbuck at gmail.com>
> When doing "dpkg-reconfigure -a" in a chroot where everything is
> denied by policy-rc.d, I see a sequence like this:
> 
>     live-boot: core filesystems devices utils udev blockdev.
>     update-initramfs: deferring update (trigger activated)
>     invoke-rc.d: policy-rc.d denied execution of stop.
>     invoke-rc.d: policy-rc.d denied execution of start.
>     invoke-rc.d: policy-rc.d denied execution of restart.
>     invoke-rc.d: policy-rc.d denied execution of stop.
>     invoke-rc.d: policy-rc.d denied execution of start.
>     invoke-rc.d: policy-rc.d denied execution of restart.
>     Not restarting sysvinit
> 
> I can't tell which services weren't restarted.
> How do you feel about including the service name in that output?

Here I propose patch to implement request:

From aaf747cf7e2a0256f62a25fd69b720b466bfaee2 Mon Sep 17 00:00:00 2001
From: Dmitry Bogatov <KAction at debian.org>
Date: Thu, 10 Jan 2019 16:50:13 +0000
Subject: [PATCH] update-rc.d: make policy deny message more informative

If action on service was denied by policy-rc.d, include name of the
service in error message. (Closes: #701863)
---
 script/invoke-rc.d | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/script/invoke-rc.d b/script/invoke-rc.d
index d4ac2c6..cda56db 100755
--- a/script/invoke-rc.d
+++ b/script/invoke-rc.d
@@ -145,10 +145,10 @@ if test "x${POLICYHELPER}" != x && test -x "${POLICYHELPER}" ; then
 	1)   RC=105
 	     ;;
 	101) if test x${FORCE} != x ; then
-		printerror Overriding policy-rc.d denied execution of ${printaction}.
+		printerror "Overriding policy-rc.d denied execution of ${printaction} for ${INITSCRIPTID}."
 		RC=104
 	     else
-		printerror policy-rc.d denied execution of ${printaction}.
+		printerror "policy-rc.d denied execution of ${printaction} for ${INITSCRIPTID}."
 	     fi
 	     ;;
     esac



More information about the Pkg-systemd-maintainers mailing list