3 # Provides: inetsim Internet Simulation
4 # Required-Start: $local_fs $remote_fs $syslog $network $time
5 # Required-Stop: $local_fs $remote_fs $syslog $network
6 # Default-Start: 2 3 4 5
8 # Short-Description: start and stop the internet simulation
9 # Description: inetsim is a software suite for simulating common internet services
12 # Author inetsim: Matthias Eckert <me@inetsim.org>
13 # Author rc-file: Markus Blasl <markus.blasl (gmail)>
15 # PATH should only include /usr/* if it runs after the mountnfs.sh script
16 PATH
=/sbin
:/usr
/sbin
:/bin
:/usr
/bin
17 DESC
="internet service simulation suite"
19 DAEMON
=/usr
/bin
/inetsim
21 PIDFILE
=/var
/run
/$NAME.pid
22 SCRIPTNAME
=/etc
/rc.d
/$NAME
24 # Exit if the package is not installed
25 [ -x "$DAEMON" ] ||
exit 0
27 # Read configuration variable file if it is present
28 [ -r /etc
/default
/$NAME ] && .
/etc
/default
/$NAME
33 if [ ! x
"$ENABLED" = x
"1" -a ! "$1" = "stop" ]; then
34 printhl
"Edit /etc/default/inetsim to start inetsim"
38 if [ `echo "$DAEMON_ARGS" | grep -c '\-\-pidfile'` -ne 0 ] && [ ! -f $PIDFILE ]; then
39 PIDFILE
=`echo "$DAEMON_ARGS" | sed s/=/\ /g | awk -F'--pidfile ' '{print $2}' | cut -d' ' -f1 | cut -f1`
43 # Function that starts the daemon/service
48 # 0 if daemon has been started
49 # 1 if daemon was already running
50 # 2 if daemon could not be started
51 [ ! -f $PIDFILE ] ||
return 1
52 if [ x
"$AUTO_CONF" = x
"1" -a -x "/usr/share/inetsim/contrib/gen_config.pl" ]; then
53 /usr
/share
/inetsim
/contrib
/gen_config.pl
56 # Add code here, if necessary, that waits for the process to be ready
57 # to handle requests from services started subsequently which depend
58 # on this one. As a last resort, sleep for some time.
63 # Function that stops the daemon/service
68 [ "$VERBOSE" != no
] && stat_busy
"Starting $DESC: $NAME"
78 [ "$VERBOSE" != no
] && stat_busy
"Stopping $DESC: $NAME"
97 # If the "reload" option is implemented then remove the
98 # 'force-reload' alias
105 #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
106 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2