Koozali.org: home of the SME Server
Obsolete Releases => SME Server 7.x => Topic started by: stian on February 15, 2007, 03:30:57 PM
-
I have a service I want to start at boot.
/usr/local/sbin/archttp32
Can anyone guide me to do this correct on smeserver? So it stays like that after upgrades etc..
-
I have a service I want to start at boot.
/usr/local/sbin/archttp32
Can anyone guide me to do this correct on smeserver? So it stays like that after upgrades etc..
See the developers guide, chapter 9: http://mirror.contribs.org/smeserver/contribs/gordonr/devguide/html/c830.htm
-
I found some tips around on the net. Could it be done like this?
# vi /etc/rc.d/init.d/areca
Enter this in this file:
---------------------------------------
#! /bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/sbin/archttp32
NAME=archttp32
DESC="Areca RAID controller management interface"
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
set -e
case "$1" in
start)
log_begin_msg "Starting $DESC..."
start-stop-daemon --start --quiet -b -m --pidfile /var/run/$NAME.pid \
--exec $DAEMON -- $DAEMON_OPTS 2>/dev/null || log_end_msg 1
log_end_msg 0
;;
stop)
log_begin_msg "Stopping $DESC..."
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
-s INT --exec $DAEMON --oknodo || log_end_msg 1
sleep 5
log_end_msg 0
;;
restart|force-reload)
log_begin_msg "Restarting $DESC..."
start-stop-daemon --stop --quiet --exec $DAEMON --pidfile \
/var/run/$NAME.pid --oknodo
sleep 6
start-stop-daemon --start -m -b --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS || log_end_msg 1
log_end_msg 0
;;
*)
N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|force-reload}" >&2
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
-------------------------------
# cd /etc/rc.d/rc7.d
# ln -s /etc/rc.d/init.d/areca S95areca
# /sbin/e-smith/config set areca service InitscriptOrder 95 status enabled
I tried it just now, but it gives me an error when the service should start. Cant find the error in the log though... Could it be in the /etc/rc.d/init.d/areca script?
-
Thanks cactus, but I am a beginner in linux, so I don`t get so much of the out of the developers guide... :oops:
-
Tried this in /etc/rc.d/init.d/areca:
#! /bin/sh
depend() {
use net logger
}
start() {
ebegin "Starting Areca Webserver"
start-stop-daemon --start --quiet --exec /usr/local/sbin/archttp32 > /dev/null&
eend $?
}
stop() {
ebegin "Stopping Areca Webserver"
start-stop-daemon --stop -s INT --exec /usr/local/sbin/archttp32
sleep 5
eend $?
}
No error, but it does not seem to start.