Hi,
I think there is a typo in the init.d script.
In line 17:
HOME=`getent passwd soda | awk -F: '{print $6}'`

The user «soda» is fixed, it guess it should be $AMULED_USER. And it
should check that both $AMULED_USER is not empty before obtaining the
home path. It should check that the home path returned is not empty too.

I have made those changes and I have pasted the resulting script at the
end of this mail. Feel free to commit those changes.

Changed lines fon 17 to 27.

Thanks in advance!

Pau Tallada.

----------------BEGIN INIT.D FILE----------------------------------
#! /bin/sh


PATH=/bin:/usr/bin:/usr/local/bin/:/sbin/:/usr/sbin/
DAEMON=/usr/bin/amuled
WEBDAEMON=/usr/bin/amuleweb

if [ -f /etc/default/amule-daemon ]; then
        . /etc/default/amule-daemon
fi

if [ -z "$RUN_AT_STARTUP" -o "$RUN_AT_STARTUP" != "YES" ]; then
        echo "aMule daemon not starting, edit /etc/default/amule-daemon
for start it"
        exit 0
fi

if [ -n "$AMULE_USER" ]; then
        echo "aMule user is empty, check /etc/default/amule-daemon settings"
        exit 0
fi

HOME=`getent passwd $AMULED_USER | awk -F: '{print $6}'`

if [ -n "$HOME" ]; then
        echo "aMule user does not exist or has no home folder, check
/etc/default/amule-daemon settings"
        exit 0
fi

start ()
{
    echo -n "Starting aMule : amuled"
    export HOME
    start-stop-daemon --chuid $AMULED_USER --user $AMULED_USER --start
--exec $DAEMON --background
    echo "."
}

stop ()
{
    echo -n "Stopping aMuleWeb : amuleweb"
    export HOME
    start-stop-daemon --stop --retry 5 --oknodo --quiet --chuid
$AMULED_USER --user $AMULED_USER --exec $DAEMON
    start-stop-daemon --stop --retry 5 --oknodo --quiet --chuid
$AMULED_USER --user $AMULED_USER --exec $WEBDAEMON
    echo "."
}


case "$1" in
  start)
        start
    ;;
  stop)
        stop
    ;;
  reload)
          stop
          start
    ;;
  force-reload|restart)
        stop
        start
        ;;
  *)
    echo "Usage: /etc/init.d/amule-daemon
{start|stop|restart|force-reload|reload}"
    exit 1
    ;;
esac

exit 0
----------------END INIT.D FILE----------------------------------





-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to