Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 102443 - /lib/rcscripts/sh/rc-daemon.sh in baselayout-1.12.0_pre5 is broken
Summary: /lib/rcscripts/sh/rc-daemon.sh in baselayout-1.12.0_pre5 is broken
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-13 16:45 UTC by Ginsu
Modified: 2005-08-17 06:05 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ginsu 2005-08-13 16:45:41 UTC
when issuing /etc/init.d/mpd restart I get this:

# /etc/init.d/mpd restart
 * Stopping service mpd
 * Stopped service mpd
 * Starting service mpd
/usr/bin/mpd already running.                                             [ !! ]
* FAILED to start service mpd!

That's with parallel startup on, with it off I still get the same error.

Reproducible: Always
Steps to Reproduce:
Comment 1 Roy Marples (RETIRED) gentoo-dev 2005-08-15 02:37:14 UTC
Which version of mpd? mpd-0.11.5 works fine with baselayout-1.12.0_pre5
Comment 2 Ginsu 2005-08-15 02:52:30 UTC
I am using the mpd-svn-20050731.  Diff'ing the init script from mpd to mpd-svn
turns up two major differences:

-       start-stop-daemon --start --quiet --exec /usr/bin/mpd -- --no-create-db
/etc/mpd.conf
+       start-stop-daemon --start --exec /usr/bin/mpd -- --no-create-db
/etc/mpd.conf

and

-       start-stop-daemon --stop --quiet --exec /usr/bin/mpd --oknodo
+       start-stop-daemon --stop --pidfile ${pidfile}

Changing the init script to that of the one from regular mpd seems to fix the
problem.
Comment 3 Jeremy Huddleston (RETIRED) gentoo-dev 2005-08-16 23:15:06 UTC
I'm having a similar problem with the webmin init script and
baselayout-1.12.0_pre5... It seems that the bug is in start-stop-daemon because
executing the process manually (as described below) works...

start-stop-daemon --start --quiet -exec /usr/libexec/webmin/miniserv.pl
/etc/webmin/miniserv.conf

to

/usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf

in the init script 
Comment 4 Jeremy Huddleston (RETIRED) gentoo-dev 2005-08-16 23:26:14 UTC
replacing /lib/rcscripts/sh/rc-daemon.sh with the 1.11.3 version makes the
problem go away...
Comment 5 Jeremy Huddleston (RETIRED) gentoo-dev 2005-08-16 23:49:27 UTC
And this might pose a clue... or just another unrelated bug...

$ /etc/init.d/authdaemond start
 * Starting authdaemond.plain ...
pidof: invalid options on command line!
                                                                          [ !! ]

This bit of debugging:
--- rc-daemon.sh.1.12.0_pre5    2005-08-16 23:24:28.000000000 -0700
+++ rc-daemon.sh        2005-08-16 23:32:14.000000000 -0700
@@ -182,12 +182,15 @@ rc_kill_pid() {
 # This is to handle the rpc.nfsd program which acts weird
 pidof() {
        local arg args 
-       
+
+       > /tmp/a
        for arg in "$@"; do
                [[ ${arg##*/} == "rpc.nfsd" ]] && arg="${arg%/*}/nfsd"
+               echo "${arg}" >> /tmp/a
                args="${args} '"${arg}"'"
        done
 
+       echo "eval /bin/pidof -x ${args}" >> /tmp/a
        eval /bin/pidof -x ${args}
 }
 
produced this:

$ cat /tmp/a 
'-'
'/usr/lib/courier-imap/courierlogger'
'-pid=/var/run/authdaemon.pid'
'-start'
'/usr/lib/courier-imap/authlib/authdaemond.plain'
eval /bin/pidof -x  ''-'' ''/usr/lib/courier-imap/courierlogger''
''-pid=/var/run/authdaemon.pid'' ''-start''
''/usr/lib/courier-imap/authlib/authdaemond.plain''

this call is coming from is_daemon_running from rc_start_daemon
Comment 6 Roy Marples (RETIRED) gentoo-dev 2005-08-17 06:05:23 UTC
(In reply to comment #5)
> And this might pose a clue... or just another unrelated bug...
> 
> $ /etc/init.d/authdaemond start
>  * Starting authdaemond.plain ...
> pidof: invalid options on command line!

Bug #98745 has fixed scripts for courier-imap and related stuff
Bug #102826 has a patch for the webmin script to call start-stop-daemon correctly

The rc-daemon.sh prior to baselayout-1.12 didn't actually do anything btw, so we
either ship this and fix init scripts (which are the issue 90% of the time) or
leave things as is.

Marking as invalid as the reporter has a working mpd init script now.