Skip to content
Snippets Groups Projects
Commit 8cd0c28c authored by Christoph Heidecker's avatar Christoph Heidecker Committed by root
Browse files

Created two services for manager and server

parent 3f14960a
Branches
No related tags found
No related merge requests found
......@@ -9,8 +9,11 @@ INSTANCE="XRootD"
# XRootD installation path
XRD_PATH=/opt/XRootD
# XRootD config path
CONFIG='/opt/XRootD/configs/xrootd.cf'
# XRootD logging directory
LOGDIR=/var/log/XRootD
LOGDIR='/var/log/XRootD'
# Service PID file
PIDFILE=/var/run/xrootd.pid
......@@ -19,9 +22,20 @@ PIDFILE=/var/run/xrootd.pid
#export LD_LIBRARY_PATH=$XRD_PATH/xrd-install/lib64:$LD_LIBRARY_PATH
#export PATH=$XRD_PATH/xrd-install/bin:$PATH
ACTION=''
while getopts 'a:c:l:' flag; do
case "${flag}" in
a) ACTION="${OPTARG}" ;;
c) CONFIG="${OPTARG}" ;;
l) LOGDIR="${OPTARG}" ;;
*) error "Unexpected option ${flag}" ;;
esac
done
# Starting command for XRootD services
XROOTD_COMMAND='xrootd -c '$XRD_PATH'/configs/proxy-server.cf -l '$LOGDIR'/proxy-server-xrootd.log -k 100m &'
CMSD_COMMAND='cmsd -c '$XRD_PATH'/configs/proxy-server.cf -l '$LOGDIR'/proxy-server-cmsd.log -k 100m &'
XROOTD_COMMAND='xrootd -c '$CONFIG' -l '$LOGDIR'/xrootd.log -k 100m &'
CMSD_COMMAND='cmsd -c '$CONFIG' -l '$LOGDIR'/cmsd.log -k 100m &'
# Check for running service processes
if [ -f $PIDFILE ]
......@@ -29,7 +43,7 @@ then
PID=`cat $PIDFILE`
fi
case "$1" in
case "$ACTION" in
'start')
if [ -f $PIDFILE ] ; then
if test `ps -e | grep -c $PID` = 1; then
......@@ -63,9 +77,9 @@ case "$1" in
;;
'restart')
$0 stop
$0 -a stop -l $LOGDIR -c $CONFIG
sleep 5
$0 start
$0 -a start -l $LOGDIR -c $CONFIG
;;
'status')
......
[Unit]
Description=XRootD-Services
After=syslog.target network.target
Wants=network.target
[Service]
User=xrootd
Type=simple
RemainAfterExit=yes
ExecStart=/bin/sh /opt/XRootD/systemd/xrootd-daemon.sh start
ExecStop=/bin/sh /opt/XRootD/systemd/xrootd-daemon.sh stop
[Install]
WantedBy=multi-user.target
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment