Subversion Repositories DevTools

Rev

Rev 1038 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1038 Rev 1044
Line 1... Line 1...
1
#!/usr/bin/env bash
1
#!/bin/sh
-
 
2
#
-
 
3
# Note: Solaris init.d scripts are run under a 'sh' shell at system startup
-
 
4
#       The above line has does not control this.
-
 
5
#       The script MUST be 'sh' complient
2
 
6
 
3
#set -x
7
#set -x
4
BLATUSR=releasem
8
BLATUSR=releasem
5
BLATBIN=/home/${BLATUSR}/blat
9
BLATBIN=/home/${BLATUSR}/blat
6
PID="${BLATBIN}/run/blat.pid"
10
PID="${BLATBIN}/run/blat.pid"
7
 
11
 
8
 
12
 
9
ARG=$1
13
ARG=$1
10
cd "$BLATBIN"
14
cd "$BLATBIN"
11
 
15
 
12
start () { 
16
start () {
13
        echo Starting blat daemon now...
17
        echo Starting blat daemon now...
-
 
18
        SU="bash -c "
-
 
19
        [ "$USER" != "$BLATUSR" ] && SU="su - ${BLATUSR} -c "
14
        su - ${BLATUSR} -c "perl $BLATBIN/blat.pl -pid=$PID 2>/tmp/blat.log 1>&2"
20
        $SU "perl $BLATBIN/blat.pl -pid=$PID 2>/tmp/blat.log 1>&2"
15
}
21
}
16
 
22
 
-
 
23
 
17
stop () { 
24
stop () { 
18
        if [ -f $PID ]; then
25
        if [ -f $PID ]; then
19
                echo Stopping daemon now...
26
                echo Stopping daemon now...
20
                kill $(cat $PID);
27
                kill `cat $PID`;
21
        else
28
        else
22
                echo "No pidfile found (not running?)"
29
                echo "No pidfile found (not running?)"
23
        fi
30
        fi
24
}
31
}
25
 
32
 
26
logrotate () {
33
logrotate () {
27
        echo Triggering a logrotate
34
        echo Triggering a logrotate
28
        kill -HUP $(cat $PID)
35
        kill -HUP `cat $PID`
29
}
36
}
30
 
37
 
31
#
38
#
32
#   Setup init levels
39
#   Setup init levels
33
#   Linux and Solaris are different
40
#   Linux and Solaris are different