[PATCH] Remove/fix deprecated start-stop-daemon functions

10 views
Skip to first unread message

Lance Albertson

unread,
Aug 9, 2011, 2:45:29 AM8/9/11
to ganeti...@googlegroups.com
daemon-util uses the deprecated functions --startas, --chuid and, most
importantly, --oknodo. The last one causes start-stop-daemon to exit with a
non-zero status, which makes openrc think it crashed (when in reality it just
shut down properly) [1].

[1] https://bugs.gentoo.org/show_bug.cgi?id=377905

Signed-off-by: Lance Albertson <rame...@gmail.com>
---
daemons/daemon-util.in | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in
index 819fd6b..00fe1b6 100644
--- a/daemons/daemon-util.in
+++ b/daemons/daemon-util.in
@@ -172,10 +172,10 @@ start() {

@PKGLIBDIR@/ensure-dirs

- start-stop-daemon --start --quiet --oknodo \
+ start-stop-daemon --start --quiet \
--pidfile $(_daemon_pidfile $name) \
- --startas $(_daemon_executable $name) \
- --chuid $(_daemon_usergroup $plain_name) \
+ --exec $(_daemon_executable $name) \
+ --user $(_daemon_usergroup $plain_name) \
-- $args "$@"
}

@@ -188,7 +188,7 @@ stop() {

local name="$1"; shift

- start-stop-daemon --stop --quiet --oknodo --retry 30 \
+ start-stop-daemon --stop --quiet --retry 30 \
--pidfile $(_daemon_pidfile $name)
}

--
1.7.4.1

Michael Hanselmann

unread,
Aug 9, 2011, 7:52:08 AM8/9/11
to Lance Albertson, ganeti...@googlegroups.com
Am 9. August 2011 08:45 schrieb Lance Albertson <rame...@gmail.com>:
> daemon-util uses the deprecated functions --startas, --chuid and, most
> importantly, --oknodo. The last one causes start-stop-daemon to exit with a
> non-zero status, which makes openrc think it crashed (when in reality it just
> shut down properly) [1].

I tried to test this, but it doesn't work with an older
start-stop-daemon version (1.13.11; “start-stop-daemon: user
`root:root' not found”). Since when are those options deprecated?
There doesn't even seem to be an authoritative upstream version of
start-stop-daemon.

Michael

Lance Albertson

unread,
Aug 9, 2011, 11:03:16 AM8/9/11
to Michael Hanselmann, ganeti...@googlegroups.com

It seems as though the start-stop-daemon that runs on Gentoo is a
fork/re-write of the original version from Debian [1]. That will
complicate things. Do you have any suggestions as to how to work around
this? In the meantime I can attempt to maintain a patch on gentoo
systems to work around this which is pretty simple.

[1] http://goo.gl/n2eb8

--
Lance Albertson
Systems Administrator / Architect Open Source Lab
Information Services Oregon State University

signature.asc

Lance Albertson

unread,
Aug 9, 2011, 12:21:00 PM8/9/11
to Michael Hanselmann, ganeti...@googlegroups.com
On 08/09/2011 08:03 AM, Lance Albertson wrote:
> On 08/09/2011 04:52 AM, Michael Hanselmann wrote:
>> Am 9. August 2011 08:45 schrieb Lance Albertson <rame...@gmail.com>:
>>> daemon-util uses the deprecated functions --startas, --chuid and, most
>>> importantly, --oknodo. The last one causes start-stop-daemon to exit with a
>>> non-zero status, which makes openrc think it crashed (when in reality it just
>>> shut down properly) [1].
>>
>> I tried to test this, but it doesn't work with an older
>> start-stop-daemon version (1.13.11; “start-stop-daemon: user
>> `root:root' not found”). Since when are those options deprecated?
>> There doesn't even seem to be an authoritative upstream version of
>> start-stop-daemon.
>
> It seems as though the start-stop-daemon that runs on Gentoo is a
> fork/re-write of the original version from Debian [1]. That will
> complicate things. Do you have any suggestions as to how to work around
> this? In the meantime I can attempt to maintain a patch on gentoo
> systems to work around this which is pretty simple.

Hmm, the more I dive into this the more I see that this fork does not
work well with the daemon-util. I see the Gentoo's start-stop-daemon
does not pass on the exit codes such as "11" for noting its not a master
and instead just returns "1" like usual. I'm going to dig further and
see how I can make this work better with Gentoo.

signature.asc
Reply all
Reply to author
Forward
0 new messages