Subversion Repositories DevTools

Rev

Rev 914 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 914 Rev 3840
Line 9... Line 9...
9
# Note: This file should be installed into /etc/init.d
9
# Note: This file should be installed into /etc/init.d
10
#
10
#
11
# Note: Use /etc/init.d/buildtool setup
11
# Note: Use /etc/init.d/buildtool setup
12
#        to perform additional setup of adding files to setup sequence
12
#        to perform additional setup of adding files to setup sequence
13
#
13
#
-
 
14
#set -x
-
 
15
BUILDUSR=buildadm
-
 
16
 
14
 
17
 
15
pid=0
18
pid=0
16
#pid null if not running, pid if running
19
#pid null if not running, pid if running
17
check_running() {
20
check_running() {
18
        pid=`ps -fe|grep java|grep abtdD.jar|awk '{print $2}'`
21
        pid=`ps -fe|grep java|grep abtdD.jar|awk '{print $2}'`
Line 25... Line 28...
25
    check_running
28
    check_running
26
    if [ "$pid" ]; then
29
    if [ "$pid" ]; then
27
          echo 'running'
30
          echo 'running'
28
    else
31
    else
29
          echo 'starting'
32
          echo 'starting'
-
 
33
          SU="/bin/sh -c"
-
 
34
          [ "$USER" != "$BUILDUSR" ] && SU="su - ${BUILDUSR} -c "
30
          su - buildadm -c 'source /etc/profile;unset GBE_PLATFORM;jats -NoExportVars eprog /home/buildadm/buildtool/abtlaunch 2>/tmp/buildtool 1>&2' &
35
          $SU '. /etc/profile;unset GBE_PLATFORM;jats -NoExportVars eprog /home/buildadm/buildtool/abtlaunch 2>/tmp/buildtool 1>&2' &
31
    fi
36
    fi
32
}
37
}
33
 
38
 
34
#
39
#
35
# Stop daemons.
40
# Stop daemons.