summaryrefslogtreecommitdiff
path: root/init_scripts/artifact_server
blob: cfe263048f16781774da8ecf69afaee6603ffdd4 (plain)
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
#!/bin/sh
#
# description: a server for the artifact cache
# chkconfig: 2345 90 10

# Make init function library available
. /etc/init.d/functions

# FIXME The kbas dir should be updated to some `/home/ciat` type loction 
# mess up the use of ybd for building which gets replaced all the time
kbas_dir=/home/patrickdarley/ybd
logfile="$kbas_dir"/kbas.log

# Start the service
start() {
        echo "Starting kbas artifact server"
        sudo "$kbas_dir"/kbas.py > "$logfile" &
}
# Stop the service
stop()  {
        echo "Stopping kbas"
        # FIXME, Err, this is probably not the best way to do this
        sudo kill -9 `ps aux|awk '/[k]bas.py/ {print $2}'`
}

### Main logic ###
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart|reload|condrestart)
        stop
        start
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart|reload|status}"
        exit 1
esac
exit 0