Hello again
i have been "playing" with FreeBSD again (now 7.0), and i'm interested to load some scripts on startup (i dont know if is necesary to convert them in daemons)...
that scripts was written for Red Hat like distributions, and with some fixes can run in Debian...
i have cheked that part of handbook that you talk about (
Starting Services)
then, i have to add that part:
...
utility_enable=${utility_enable-"NO"}
utility_flags=${utility_flags-""}
utility_pidfile=${utility_pidfile-"/var/run/utility.pid"}
...
in order to load that scripts (and executhe their tasks) on boot???
The scripts have this form (for Red Hat "chkconfig")
Code:
#!/bin/bash
# chkconfig: 2345 80 13
# description: Starts and stops SGUIL security monitoring server. \
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
sguild="/usr/local/sguil/server/sguild"
prog="sguild"
sguil_user="sguil"
start() {
echo -n $"Starting $prog: "
RETVAL=0
daemon --user $sguil_user $sguild -P /var/run/sguil/sguild.pid -O /usr/local/tcltls/lib/libtls1.50.so -D
RETVAL=$?
echo
}
stop() {
echo -n $"Shutting down $prog: "
kill -9 `ps -auxww | grep tclsh | grep sguild | awk '{print $2}'`
echo
}
status() {
NUM_PROCS=`ps -auxww | grep tclsh | grep sguild | grep -v grep | awk '{print $2}' | wc -l`
if [ $NUM_PROCS -eq 3 ]; then
echo "Sguild daemon is UP"
exit 0
else
# The funky sed is necessary to chop some extra spaces before
# $NUM_PROCS, which were inserted by the output from "wc -l" above.
echo "Sguild daemon is DOWN ($NUM_PROCS/3 processes up)" | sed -e 's/\s\s//g'
exit -1
fi
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
sleep 3
start
;;
status)
status
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 1
esac Thanks to everybody
See you
