I tryed the script
---------------
#!/bin/sh
#
# Startup script for aMuled
#
# chkconfig: 345 80 30
#
# description: Starts the aMule deamon. The service is available \
# via
http://localhost:4711. The deamon runs under \
# the amule account
#
# processname: amule
USER=antcasq
RETVAL=0
# Source function library.
if [ -f /etc/init.d/functions ] ; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
. /etc/rc.d/init.d/functions
else
exit 0
fi
# Avoid using root's TMPDIR
unset TMPDIR
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -f /usr/bin/amuled -o -f /usr/local/bin/amuled ] || exit 0
start() {
printf "Starting the aMule daemon: "
daemon --user $USER amuled &
#RETVAL is never returned by aMule?
RETVAL=0
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/amuled || \
RETVAL=1
return $RETVAL
}
stop() {
printf "Shutting down the aMule daemon: "
killproc amuled
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/amuled
echo
return $RETVAL
}
status() {
status amuled
RETVAL=$?
}
restart() {
$0 stop
$0 start
}
rhstatus() {
status amuled
}
# Allow status as non-root.
if [ "$1" = status ]; then
rhstatus
exit $?
fi
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
status)
rhstatus
;;
condrestart)
[ -f /var/lock/subsys/smb ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}"
exit 1
esac
exit $?
---------------
But it doesn't work on SUSE or I need to install something...
I changed the script, commenting
[1]
## Source function library.
#if [ -f /etc/init.d/functions ] ; then
# . /etc/init.d/functions
#elif [ -f /etc/rc.d/init.d/functions ] ; then
# . /etc/rc.d/init.d/functions
#else
# exit 0
#fi
because it always fails
[2]
# Check that networking is up.
#[ ${NETWORKING} = "no" ] && exit 0
#[ -f /usr/bin/amuled -o -f /usr/local/bin/amuled ] || exit 0
I get an error
[3]
daemon --user $USER amuled &
changed it to
startproc -u $USER -l /var/log/amuled_antcasq.log /usr/bin/amuled -o -f
because it seans deamon command doesn't exist!?!
however it still doesn't start, I get the following error in the log:
--------------
16:48:54: Error: Directory '//.aMule/' couldn't be created (error 13: Permission denied)
16:48:54: Error: can't open file '//.aMule//logfile' (error 2: No such file or directory)
ERROR: unable to open log file
amuled: OnInit - starting timer
Daemon will fork to background - log to stdout disabled
Initialising aMule
Checking if there is an instance already running...
--------------
I think it's trying to use roots account although I told the process to start as another user.
Is there a way to fix it?
What's wrong?