3 # svscan svscan (scan and run services)
7 # description: svscan (scan and run services) is a server part of the daemontools suite.
12 # Source function library
13 . /etc/rc.d/init.d/functions
16 . /etc/sysconfig/network
19 [ -f /etc/sysconfig/svscan ] && . /etc/sysconfig/svscan
21 # Check that networking is up.
22 if is_no "${NETWORKING}"; then
23 msg_network_down svscan
28 # See how we were called.
31 # Check if the service is already running?
32 if [ ! -f /var/lock/subsys/svscan ]; then
33 msg_starting svscan; busy
34 # we can't get status report from background job
35 # but we can only do simple file check
36 if [ -w $SVSCAN_DIR ]; then
42 echo "Missing service directory!"
43 echo "Create $SVSCAN_DIR first."
46 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/svscan
48 msg_already_running svscan
52 if [ -f /var/lock/subsys/svscan ]; then
55 svc -d -x $SVSCAN_DIR/* \
56 $(find $SVSCAN_DIR/* -maxdepth 0 -follow -perm -1000|sed s-\$-/log-)
57 rm -f /var/run/svscan.pid /var/lock/subsys/svscan >/dev/null 2>&1
59 msg_not_running svscan
72 msg_usage "$0 {start|stop|status|restart}"