This repository has been archived by the owner on Feb 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
greenginecode
75 lines (65 loc) · 1.81 KB
/
greenginecode
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# This file is part of Greenginecode.
# Copyright (c) 2012, Remy Dernat, CNRS
# Greenginecode is free software. This software is governed
# by the CeCILL license under French law and abiding
# by the rules of distribution of free software.
# As a counterpart to the access to the source code
# and rights to copy,modify and redistribute granted
# by the license, users are provided only with a
# limited warranty and the software's author, the
# holder of the economic rights, and the successive
# licensors have only limited liability.See the
# files license-en.txt or license-fr.txt for more
# details.
# description: Green Code server
# SGE queue listener
# Get function from functions library
. /etc/init.d/functions
. /etc/greenginecode.conf
source $BINARIES
if [ ! -d $logdirectory ];then
mkdir $logdirectory
fi;
if [ ! -d $directory ];then
mkdir $directory
fi;
rm -f $directory/*-avail-lvl.txt > /dev/null
LOGFILE="$logdirectory/service.log"
# Start the greenginecode service
start() {
initlog -c "echo -n Starting greenginecode server: "
/sbin/greenginecode.sh >> $LOGFILE 2>&1 &
### Creating the lock file ###
touch /var/lock/subsys/greenginecode
success $"greenginecode server startup"
echo
}
# Restart the service greenginecode
stop() {
initlog -c "echo -n Stopping greenginecode server: "
killproc greenginecode.sh
### Now, delete the lock file ###
rm -f /var/lock/subsys/greenginecode
echo
}
### main logic ###
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status greenginecode
;;
restart|reload)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0