Add Debian/Ubuntu init files for remaining services

master
Timothy Pearson 12 years ago
parent 869276765f
commit 8ffcca498e

@ -0,0 +1,108 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: remotefpga-adminsysctlserver
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: console-screen kbd acpid hal krb5-kdc nis
# Should-Stop: console-screen kbd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: RemoteFPGA System Administration Control Server
# Description: RemoteFPGA System Administration Control Server
### END INIT INFO
# /etc/init.d/remotefpga-adminsysctlserver: start or stop the RemoteFPGA System Administration Control Server
#
# description: RemoteFPGA System Administration Control Server
#
. /lib/lsb/init-functions
set -e
PATH=/opt/trinity/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/opt/trinity/bin/remotefpga_adminsysctlserver
PIDFILE=/var/run/remotefpga_authserver.pid
UPGRADEFILE=/var/run/remotefpga_authserver.upgrade
DESC="RemoteFPGA System Administration Control Server"
# If we upgraded the daemon, we can't use the --exec argument to
# start-stop-daemon since the inode will have changed. The risk here is that
# in a situation where the daemon died, its pidfile was not cleaned up, and
# some other process is now running under that pid, start-stop-daemon will send
# signals to an innocent process. However, this seems like a corner case.
# C'est la vie!
if [ -e $UPGRADEFILE ]; then
SSD_ARGS="--pidfile $PIDFILE --startas $DAEMON"
else
SSD_ARGS="--pidfile $PIDFILE --exec $DAEMON"
fi
stillrunning () {
if expr "$(cat /proc/$DAEMONPID/cmdline 2> /dev/null)" : "$DAEMON" > /dev/null 2>&1; then
true
else
# if the daemon does not remove its own pidfile, we will
rm -f $PIDFILE $UPGRADEFILE
false
fi;
}
case "$1" in
start)
log_action_begin_msg "Starting $DESC"
if start-stop-daemon --background --start --make-pidfile --quiet $SSD_ARGS -- $ARG; then
log_action_end_msg 0
else
log_warning_msg "already running"
log_action_end_msg 0
fi
;;
restart)
/etc/init.d/remotefpga-adminsysctlserver stop
if [ -f $PIDFILE ]; then
if stillrunning; then
exit 1
fi
fi
/etc/init.d/remotefpga-adminsysctlserver start
;;
reload)
log_action_begin_msg "Reloading $DESC"
if start-stop-daemon --stop --signal 1 --quiet $SSD_ARGS; then
log_action_end_msg 0
else
log_failure_msg "not running"
log_action_end_msg 1
fi
;;
force-reload)
/etc/init.d/remotefpga-adminsysctlserver reload
;;
stop)
log_action_begin_msg "Stopping $DESC"
if [ ! -f $PIDFILE ]; then
log_failure_msg "Not running ($PIDFILE not found)"
log_action_end_msg 0
exit 0
else
if start-stop-daemon --stop --quiet $SSD_ARGS; then
log_action_end_msg 0
else
log_failure_msg "not running"
log_action_end_msg 1
fi
fi
;;
*)
echo "Usage: /etc/init.d/remotefpga-adminsysctlserver {start|stop|restart|reload|force-reload}"
exit 1
;;
esac
exit 0

@ -0,0 +1,108 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: remotefpga-adminusermgmtserver
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: console-screen kbd acpid hal krb5-kdc nis
# Should-Stop: console-screen kbd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: RemoteFPGA System Administration User Management Server
# Description: RemoteFPGA System Administration User Management Server
### END INIT INFO
# /etc/init.d/remotefpga-adminusermgmtserver: start or stop the RemoteFPGA System Administration User Management Server
#
# description: RemoteFPGA System Administration User Management Server
#
. /lib/lsb/init-functions
set -e
PATH=/opt/trinity/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/opt/trinity/bin/remotefpga_adminsysctlserver
PIDFILE=/var/run/remotefpga_authserver.pid
UPGRADEFILE=/var/run/remotefpga_authserver.upgrade
DESC="RemoteFPGA System Administration User Management Server"
# If we upgraded the daemon, we can't use the --exec argument to
# start-stop-daemon since the inode will have changed. The risk here is that
# in a situation where the daemon died, its pidfile was not cleaned up, and
# some other process is now running under that pid, start-stop-daemon will send
# signals to an innocent process. However, this seems like a corner case.
# C'est la vie!
if [ -e $UPGRADEFILE ]; then
SSD_ARGS="--pidfile $PIDFILE --startas $DAEMON"
else
SSD_ARGS="--pidfile $PIDFILE --exec $DAEMON"
fi
stillrunning () {
if expr "$(cat /proc/$DAEMONPID/cmdline 2> /dev/null)" : "$DAEMON" > /dev/null 2>&1; then
true
else
# if the daemon does not remove its own pidfile, we will
rm -f $PIDFILE $UPGRADEFILE
false
fi;
}
case "$1" in
start)
log_action_begin_msg "Starting $DESC"
if start-stop-daemon --background --start --make-pidfile --quiet $SSD_ARGS -- $ARG; then
log_action_end_msg 0
else
log_warning_msg "already running"
log_action_end_msg 0
fi
;;
restart)
/etc/init.d/remotefpga-adminusermgmtserver stop
if [ -f $PIDFILE ]; then
if stillrunning; then
exit 1
fi
fi
/etc/init.d/remotefpga-adminusermgmtserver start
;;
reload)
log_action_begin_msg "Reloading $DESC"
if start-stop-daemon --stop --signal 1 --quiet $SSD_ARGS; then
log_action_end_msg 0
else
log_failure_msg "not running"
log_action_end_msg 1
fi
;;
force-reload)
/etc/init.d/remotefpga-adminusermgmtserver reload
;;
stop)
log_action_begin_msg "Stopping $DESC"
if [ ! -f $PIDFILE ]; then
log_failure_msg "Not running ($PIDFILE not found)"
log_action_end_msg 0
exit 0
else
if start-stop-daemon --stop --quiet $SSD_ARGS; then
log_action_end_msg 0
else
log_failure_msg "not running"
log_action_end_msg 1
fi
fi
;;
*)
echo "Usage: /etc/init.d/remotefpga-adminusermgmtserver {start|stop|restart|reload|force-reload}"
exit 1
;;
esac
exit 0

@ -0,0 +1,108 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: remotefpga-fpgaprogserver
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: console-screen kbd acpid hal krb5-kdc nis
# Should-Stop: console-screen kbd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: RemoteFPGA FPGA Programming Server
# Description: RemoteFPGA FPGA Programming Server
### END INIT INFO
# /etc/init.d/remotefpga-fpgaprogserver: start or stop the RemoteFPGA FPGA Programming Server
#
# description: RemoteFPGA FPGA Programming Server
#
. /lib/lsb/init-functions
set -e
PATH=/opt/trinity/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/opt/trinity/bin/remotefpga_fpgaprogserver
PIDFILE=/var/run/remotefpga_authserver.pid
UPGRADEFILE=/var/run/remotefpga_authserver.upgrade
DESC="RemoteFPGA FPGA Programming Server"
# If we upgraded the daemon, we can't use the --exec argument to
# start-stop-daemon since the inode will have changed. The risk here is that
# in a situation where the daemon died, its pidfile was not cleaned up, and
# some other process is now running under that pid, start-stop-daemon will send
# signals to an innocent process. However, this seems like a corner case.
# C'est la vie!
if [ -e $UPGRADEFILE ]; then
SSD_ARGS="--pidfile $PIDFILE --startas $DAEMON"
else
SSD_ARGS="--pidfile $PIDFILE --exec $DAEMON"
fi
stillrunning () {
if expr "$(cat /proc/$DAEMONPID/cmdline 2> /dev/null)" : "$DAEMON" > /dev/null 2>&1; then
true
else
# if the daemon does not remove its own pidfile, we will
rm -f $PIDFILE $UPGRADEFILE
false
fi;
}
case "$1" in
start)
log_action_begin_msg "Starting $DESC"
if start-stop-daemon --background --start --make-pidfile --quiet $SSD_ARGS -- $ARG; then
log_action_end_msg 0
else
log_warning_msg "already running"
log_action_end_msg 0
fi
;;
restart)
/etc/init.d/remotefpga-fpgaprogserver stop
if [ -f $PIDFILE ]; then
if stillrunning; then
exit 1
fi
fi
/etc/init.d/remotefpga-fpgaprogserver start
;;
reload)
log_action_begin_msg "Reloading $DESC"
if start-stop-daemon --stop --signal 1 --quiet $SSD_ARGS; then
log_action_end_msg 0
else
log_failure_msg "not running"
log_action_end_msg 1
fi
;;
force-reload)
/etc/init.d/remotefpga-fpgaprogserver reload
;;
stop)
log_action_begin_msg "Stopping $DESC"
if [ ! -f $PIDFILE ]; then
log_failure_msg "Not running ($PIDFILE not found)"
log_action_end_msg 0
exit 0
else
if start-stop-daemon --stop --quiet $SSD_ARGS; then
log_action_end_msg 0
else
log_failure_msg "not running"
log_action_end_msg 1
fi
fi
;;
*)
echo "Usage: /etc/init.d/remotefpga-fpgaprogserver {start|stop|restart|reload|force-reload}"
exit 1
;;
esac
exit 0

@ -0,0 +1,108 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: remotefpga-fpgaserver
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: console-screen kbd acpid hal krb5-kdc nis
# Should-Stop: console-screen kbd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: RemoteFPGA FPGA Server
# Description: RemoteFPGA FPGA Server
### END INIT INFO
# /etc/init.d/remotefpga-fpgaserver: start or stop the RemoteFPGA FPGA Server
#
# description: RemoteFPGA FPGA Server
#
. /lib/lsb/init-functions
set -e
PATH=/opt/trinity/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/opt/trinity/bin/remotefpga_fpgaserver
PIDFILE=/var/run/remotefpga_authserver.pid
UPGRADEFILE=/var/run/remotefpga_authserver.upgrade
DESC="RemoteFPGA FPGA Server"
# If we upgraded the daemon, we can't use the --exec argument to
# start-stop-daemon since the inode will have changed. The risk here is that
# in a situation where the daemon died, its pidfile was not cleaned up, and
# some other process is now running under that pid, start-stop-daemon will send
# signals to an innocent process. However, this seems like a corner case.
# C'est la vie!
if [ -e $UPGRADEFILE ]; then
SSD_ARGS="--pidfile $PIDFILE --startas $DAEMON"
else
SSD_ARGS="--pidfile $PIDFILE --exec $DAEMON"
fi
stillrunning () {
if expr "$(cat /proc/$DAEMONPID/cmdline 2> /dev/null)" : "$DAEMON" > /dev/null 2>&1; then
true
else
# if the daemon does not remove its own pidfile, we will
rm -f $PIDFILE $UPGRADEFILE
false
fi;
}
case "$1" in
start)
log_action_begin_msg "Starting $DESC"
if start-stop-daemon --background --start --make-pidfile --quiet $SSD_ARGS -- $ARG; then
log_action_end_msg 0
else
log_warning_msg "already running"
log_action_end_msg 0
fi
;;
restart)
/etc/init.d/remotefpga-fpgaserver stop
if [ -f $PIDFILE ]; then
if stillrunning; then
exit 1
fi
fi
/etc/init.d/remotefpga-fpgaserver start
;;
reload)
log_action_begin_msg "Reloading $DESC"
if start-stop-daemon --stop --signal 1 --quiet $SSD_ARGS; then
log_action_end_msg 0
else
log_failure_msg "not running"
log_action_end_msg 1
fi
;;
force-reload)
/etc/init.d/remotefpga-fpgaserver reload
;;
stop)
log_action_begin_msg "Stopping $DESC"
if [ ! -f $PIDFILE ]; then
log_failure_msg "Not running ($PIDFILE not found)"
log_action_end_msg 0
exit 0
else
if start-stop-daemon --stop --quiet $SSD_ARGS; then
log_action_end_msg 0
else
log_failure_msg "not running"
log_action_end_msg 1
fi
fi
;;
*)
echo "Usage: /etc/init.d/remotefpga-fpgaserver {start|stop|restart|reload|force-reload}"
exit 1
;;
esac
exit 0

@ -0,0 +1,108 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: remotefpga-gpibserver
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: console-screen kbd acpid hal krb5-kdc nis
# Should-Stop: console-screen kbd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: RemoteFPGA GPIB Instrumentation Server
# Description: RemoteFPGA GPIB Instrumentation Server
### END INIT INFO
# /etc/init.d/remotefpga-gpibserver: start or stop the RemoteFPGA GPIB Instrumentation Server
#
# description: RemoteFPGA GPIB Instrumentation Server
#
. /lib/lsb/init-functions
set -e
PATH=/opt/trinity/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/opt/trinity/bin/remotefpga_gpibserver
PIDFILE=/var/run/remotefpga_authserver.pid
UPGRADEFILE=/var/run/remotefpga_authserver.upgrade
DESC="RemoteFPGA GPIB Instrumentation Server"
# If we upgraded the daemon, we can't use the --exec argument to
# start-stop-daemon since the inode will have changed. The risk here is that
# in a situation where the daemon died, its pidfile was not cleaned up, and
# some other process is now running under that pid, start-stop-daemon will send
# signals to an innocent process. However, this seems like a corner case.
# C'est la vie!
if [ -e $UPGRADEFILE ]; then
SSD_ARGS="--pidfile $PIDFILE --startas $DAEMON"
else
SSD_ARGS="--pidfile $PIDFILE --exec $DAEMON"
fi
stillrunning () {
if expr "$(cat /proc/$DAEMONPID/cmdline 2> /dev/null)" : "$DAEMON" > /dev/null 2>&1; then
true
else
# if the daemon does not remove its own pidfile, we will
rm -f $PIDFILE $UPGRADEFILE
false
fi;
}
case "$1" in
start)
log_action_begin_msg "Starting $DESC"
if start-stop-daemon --background --start --make-pidfile --quiet $SSD_ARGS -- $ARG; then
log_action_end_msg 0
else
log_warning_msg "already running"
log_action_end_msg 0
fi
;;
restart)
/etc/init.d/remotefpga-gpibserver stop
if [ -f $PIDFILE ]; then
if stillrunning; then
exit 1
fi
fi
/etc/init.d/remotefpga-gpibserver start
;;
reload)
log_action_begin_msg "Reloading $DESC"
if start-stop-daemon --stop --signal 1 --quiet $SSD_ARGS; then
log_action_end_msg 0
else
log_failure_msg "not running"
log_action_end_msg 1
fi
;;
force-reload)
/etc/init.d/remotefpga-gpibserver reload
;;
stop)
log_action_begin_msg "Stopping $DESC"
if [ ! -f $PIDFILE ]; then
log_failure_msg "Not running ($PIDFILE not found)"
log_action_end_msg 0
exit 0
else
if start-stop-daemon --stop --quiet $SSD_ARGS; then
log_action_end_msg 0
else
log_failure_msg "not running"
log_action_end_msg 1
fi
fi
;;
*)
echo "Usage: /etc/init.d/remotefpga-gpibserver {start|stop|restart|reload|force-reload}"
exit 1
;;
esac
exit 0

@ -0,0 +1,108 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: remotefpga-sensormonserver
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: console-screen kbd acpid hal krb5-kdc nis
# Should-Stop: console-screen kbd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: RemoteFPGA Sensor Monitor Server
# Description: RemoteFPGA Sensor Monitor Server
### END INIT INFO
# /etc/init.d/remotefpga-sensormonserver: start or stop the RemoteFPGA Sensor Monitor Server
#
# description: RemoteFPGA Sensor Monitor Server
#
. /lib/lsb/init-functions
set -e
PATH=/opt/trinity/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/opt/trinity/bin/remotefpga_sensormonserver
PIDFILE=/var/run/remotefpga_authserver.pid
UPGRADEFILE=/var/run/remotefpga_authserver.upgrade
DESC="RemoteFPGA Sensor Monitor Server"
# If we upgraded the daemon, we can't use the --exec argument to
# start-stop-daemon since the inode will have changed. The risk here is that
# in a situation where the daemon died, its pidfile was not cleaned up, and
# some other process is now running under that pid, start-stop-daemon will send
# signals to an innocent process. However, this seems like a corner case.
# C'est la vie!
if [ -e $UPGRADEFILE ]; then
SSD_ARGS="--pidfile $PIDFILE --startas $DAEMON"
else
SSD_ARGS="--pidfile $PIDFILE --exec $DAEMON"
fi
stillrunning () {
if expr "$(cat /proc/$DAEMONPID/cmdline 2> /dev/null)" : "$DAEMON" > /dev/null 2>&1; then
true
else
# if the daemon does not remove its own pidfile, we will
rm -f $PIDFILE $UPGRADEFILE
false
fi;
}
case "$1" in
start)
log_action_begin_msg "Starting $DESC"
if start-stop-daemon --background --start --make-pidfile --quiet $SSD_ARGS -- $ARG; then
log_action_end_msg 0
else
log_warning_msg "already running"
log_action_end_msg 0
fi
;;
restart)
/etc/init.d/remotefpga-sensormonserver stop
if [ -f $PIDFILE ]; then
if stillrunning; then
exit 1
fi
fi
/etc/init.d/remotefpga-sensormonserver start
;;
reload)
log_action_begin_msg "Reloading $DESC"
if start-stop-daemon --stop --signal 1 --quiet $SSD_ARGS; then
log_action_end_msg 0
else
log_failure_msg "not running"
log_action_end_msg 1
fi
;;
force-reload)
/etc/init.d/remotefpga-sensormonserver reload
;;
stop)
log_action_begin_msg "Stopping $DESC"
if [ ! -f $PIDFILE ]; then
log_failure_msg "Not running ($PIDFILE not found)"
log_action_end_msg 0
exit 0
else
if start-stop-daemon --stop --quiet $SSD_ARGS; then
log_action_end_msg 0
else
log_failure_msg "not running"
log_action_end_msg 1
fi
fi
;;
*)
echo "Usage: /etc/init.d/remotefpga-sensormonserver {start|stop|restart|reload|force-reload}"
exit 1
;;
esac
exit 0
Loading…
Cancel
Save