3
# Provides: core-daemon
4
# Required-Start: $network $remote_fs
5
# Required-Stop: $network $remote_fs
6
# Default-Start: 2 3 4 5
8
# Short-Description: Start the core-daemon CORE daemon at boot time
9
# Description: Starts and stops the core-daemon CORE daemon used to
10
# provide network emulation services for the CORE GUI
15
# description: Starts and stops the CORE daemon \
16
# used to provide network emulation services.
18
# pidfile: /var/run/core-daemon.pid
19
# config: /usr/local/etc/core/
22
# Source function library.
23
if [ -f /etc/init.d/functions ] ; then
24
. /etc/init.d/functions
25
elif [ -f /etc/rc.d/init.d/functions ] ; then
26
. /etc/rc.d/init.d/functions
27
elif [ -f /lib/lsb/init-functions ] ; then
28
. /lib/lsb/init-functions
34
# search for core-daemon which may or may not be installed
36
for p in /usr/local/sbin \
43
if [ -e $p/core-daemon ] ; then
49
# this function comes from /etc/profile
51
if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
52
if [ "$2" = "after" ] ; then
60
# these lines add to the PATH variable used by CORE and its containers
61
# you can add your own pathmunge statements to change the container's PATH
62
pathmunge "/usr/local/sbin"
63
pathmunge "/usr/local/bin"
66
PIDFILE=/var/run/core-daemon.pid
68
# the /etc/init.d/functions (RedHat) differs from
69
# /usr/lib/init-functions (Debian)
70
if [ $DEB = yes ]; then
71
daemon="start-stop-daemon --start -p ${PIDFILE} --exec /usr/bin/python --"
81
daemon="daemon /usr/bin/python"
93
msg "Starting core-daemon"
101
msg "Shutting down core-daemon"
102
killproc -p ${PIDFILE} $cored
115
$status -p ${PIDFILE} core-daemon core-daemon
137
msg "Usage: $0 {start|stop|restart|status}"