Il giorno lun, 21/01/2008 alle 15.56 +0100, Adeodato Simó ha scritto:
> Hello alessandro,
>
> > init.d script return 1 if stopping an already stopped / not running
> > daemon, this breaks autogenerated prerm script.
>
> The current amule-daemon init script does that, you can check. If you
> can see any mistake about that in the script, please don't hesitate to
> write back.
The current init script returns 1, and it's wrong.
Evidence that return 1, taken from /etc/init.d/amule-daemon:
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
start-stop-daemon --stop --quiet --retry="TERM/30/KILL/5" --exec
$DAEMON --user "$AMULED_USER" --chuid "$AMULED_USER"
return "$?"
}
Point where it breaks, aka /var/lib/dpkg/info/amule-daemon.prerm:
#!/bin/sh
set -e
# Automatically added by dh_installinit
if [ -x "/etc/init.d/amule-daemon" ]; then
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d amule-daemon stop || exit $?
else
/etc/init.d/amule-daemon stop || exit $?
fi
fi
# End automatically added section
Evidence that it breaks:
[EMAIL PROTECTED]:~$ LANG=C sudo apt-get remove --purge amule-daemon
[...]
Removing amule-daemon ...
invoke-rc.d: initscript amule-daemon, action "stop" failed.
dpkg: error processing amule-daemon (--purge):
subprocess pre-removal script returned error exit status 1
invoke-rc.d: initscript amule-daemon, action "start" failed.
dpkg: error while cleaning up:
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
amule-daemon
E: Sub-process /usr/bin/dpkg returned an error code (1)
Currently, a quick fix is to remove /etc/default/amule-daemon, obviously
it's only a dirty workaround.
Pointers to useful documentation :
http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
ciao,
--
ale