Skip to content
Snippets Groups Projects
Commit 567ea78c authored by Steven Murray's avatar Steven Murray
Browse files

Removed CTA/tapeserver/cta-taped.init

parent b25f6f12
No related branches found
No related tags found
No related merge requests found
#! /bin/sh
#
#
# The CERN Tape Archive (CTA) project
# Copyright (C) 2015 CERN
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Source function library.
. /etc/rc.d/init.d/functions
# Variables
prog="cta-taped"
export DAEMON_COREFILE_LIMIT="unlimited"
RETVAL=0
# Source sysconfig files
if [ -f /etc/sysconfig/cta-taped ]; then
. /etc/sysconfig/cta-taped
fi
if [ -f /etc/sysconfig/$prog ]; then
. /etc/sysconfig/$prog
fi
start() {
# Run daemon
echo -n $"Starting $prog: "
cd /var/log/cta
daemon /usr/bin/$prog $CTA_TAPED_OPTIONS
# Write the pid to a file.
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
pid=`ps -eo pid,ppid,comm | egrep " 1 $prog\$" | awk '{print $1}'`
rm -f /var/run/$prog.pid
if [ -n "$pid" ]; then
echo $pid > /var/run/$prog.pid
RETVAL=0
else
RETVAL=1
fi
fi
[ $RETVAL -eq 0 ] && success $"$base startup" || failure $"$base startup"
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
return $RETVAL
}
stop() {
echo -n $"Stopping $prog and cleaning up the drive (maximum delay of 10 minutes): "
killproc -d 600 $prog
RETVAL=$?
echo
[ -f /var/lock/subsys/$prog ] && rm -f /var/lock/subsys/$prog
return $RETVAL
}
restart() {
stop
start
}
# See how we were called
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $prog
RETVAL=$?
;;
restart)
restart
;;
condrestart)
[ -f /var/lock/subsys/$prog ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
exit 1
esac
exit $RETVAL
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment