Subversion Repositories DevTools

Rev

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

Rev 3924 Rev 4123
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
### BEGIN INIT INFO
2
### BEGIN INIT INFO
3
# Provides:          JatsBuildDaemon
3
# Provides:          JatsBuildDaemon
4
# Required-Start:    $local_fs $remote_fs
4
# Required-Start:    $all
5
# Required-Stop:
5
# Required-Stop:
6
# Default-Start:     2 3 4 5
6
# Default-Start:     2 3 4 5
7
# Default-Stop:      0 1 6
7
# Default-Stop:      0 1 6
8
# X-Interactive:     true
8
# X-Interactive:     true
9
# Short-Description: Jats Build Deamon
9
# Short-Description: Jats Build Deamon
Line 85... Line 85...
85
    if [ ! -f /etc/init.d/buildtool ] ; then
85
    if [ ! -f /etc/init.d/buildtool ] ; then
86
        echo "Error: /etc/init.d/buildtool does not exist"
86
        echo "Error: /etc/init.d/buildtool does not exist"
87
        exit 1
87
        exit 1
88
    fi
88
    fi
89
 
89
 
-
 
90
    mtype=`uname`
90
    if [ "$USER" = "root" ] ; then
91
    if [ -x /usr/sbin/update-rc.d ] ; then mtype=Ubuntu; fi
91
    
92
    
92
        mtype=`uname`
93
    case "$mtype" in
-
 
94
    Ubuntu)
-
 
95
        /usr/sbin/update-rc.d -f buildtool remove
93
        if [ -x /usr/sbin/update-rc.d ] ; then mtype=Ubuntu; fi
96
        /usr/sbin/update-rc.d buildtool defaults
-
 
97
        ;;
94
    
98
    
95
        case "$mtype" in
-
 
96
        Ubuntu)
-
 
97
            /usr/sbin/update-rc.d -f buildtool remove
-
 
98
            /usr/sbin/update-rc.d buildtool defaults
-
 
99
            ;;
-
 
100
    
-
 
101
        Linux)
99
    Linux)
102
            for ii in 2 3 4 5; do
100
        for ii in 2 3 4 5; do
103
                file=/etc/rc.d/rc$ii.d/S80buildtool
101
            file=/etc/rc.d/rc$ii.d/S80buildtool
104
                [ -f $file ] || ln -s /etc/init.d/buildtool $file
102
            [ -f $file ] || ln -s /etc/init.d/buildtool $file
105
            done
103
        done
106
        
104
        
107
            for ii in 0 1 6 ; do 
105
        for ii in 0 1 6 ; do 
108
                file=/etc/rc.d/rc$ii.d/K30buildtool
106
            file=/etc/rc.d/rc$ii.d/K30buildtool
109
                [ -f $file ] || ln -s /etc/init.d/buildtool $file
107
            [ -f $file ] || ln -s /etc/init.d/buildtool $file
110
            done
108
        done
111
            ;;
109
        ;;
112
        
110
        
113
        SunOS)
111
    SunOS)
114
            for ii in 2 3; do
112
        for ii in 2 3; do
115
                file=/etc/rc$ii.d/S80buildtool
113
            file=/etc/rc$ii.d/S80buildtool
116
                [ -f $file ] || ln -s /etc/init.d/buildtool $file
114
            [ -f $file ] || ln -s /etc/init.d/buildtool $file
117
            done
115
        done
118
        
116
        
119
            for ii in 0 1 S ; do 
117
        for ii in 0 1 S ; do 
120
                file=/etc/rc$ii.d/K30buildtool
118
            file=/etc/rc$ii.d/K30buildtool
121
                [ -f $file ] || ln -s /etc/init.d/buildtool $file
119
            [ -f $file ] || ln -s /etc/init.d/buildtool $file
122
            done
120
        done
123
            ;;
121
        ;;
124
        
122
        
125
        *)
123
    *)
126
            echo "$0 setup - Unknown machine type: $mtype"
124
        echo "$0 setup - Unknown machine type: $mtype"
127
            exit 1
125
        exit 1
128
            ;;
126
        ;;
129
        esac        
127
    esac        
130
    fi    
-
 
131
}
128
}
132
 
129
 
133
#
130
#
134
#   Determine user command
131
#   Determine user command
135
#
132
#
136
case "$1" in
133
case "$1" in
137
  start)    setup
134
  start)    start
138
            start
-
 
139
            ;;
135
            ;;
140
  stop)     stop
136
  stop)     stop
141
            ;;
137
            ;;
142
  status)   status
138
  status)   status
143
            RETVAL=$?
139
            RETVAL=$?