Subversion Repositories DevTools

Rev

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

Rev 3840 Rev 3924
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
-
 
2
### BEGIN INIT INFO
-
 
3
# Provides:          JatsBuildDaemon
-
 
4
# Required-Start:    $local_fs $remote_fs
-
 
5
# Required-Stop:
-
 
6
# Default-Start:     2 3 4 5
-
 
7
# Default-Stop:      0 1 6
-
 
8
# X-Interactive:     true
-
 
9
# Short-Description: Jats Build Deamon
-
 
10
# Description:       The Jats Build Daemon provides automated build services
-
 
11
### END INIT INFO
-
 
12
 
2
#set -x
13
#set -x
3
#
14
#
4
# Start, stop buildtool
15
# Start, stop buildtool
5
#
16
#
6
# Note: This must be a 'sh' compatible script
17
# Note: This must be a 'sh' compatible script
Line 74... Line 85...
74
    if [ ! -f /etc/init.d/buildtool ] ; then
85
    if [ ! -f /etc/init.d/buildtool ] ; then
75
        echo "Error: /etc/init.d/buildtool does not exist"
86
        echo "Error: /etc/init.d/buildtool does not exist"
76
        exit 1
87
        exit 1
77
    fi
88
    fi
78
 
89
 
-
 
90
    if [ "$USER" = "root" ] ; then
-
 
91
    
79
    mtype=`uname`
92
        mtype=`uname`
-
 
93
        if [ -x /usr/sbin/update-rc.d ] ; then mtype=Ubuntu; fi
-
 
94
    
80
    case "$mtype" in
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
    
81
    Linux)
101
        Linux)
82
        for ii in 2 3 4 5; do
102
            for ii in 2 3 4 5; do
83
            file=/etc/rc.d/rc$ii.d/S80buildtool
103
                file=/etc/rc.d/rc$ii.d/S80buildtool
84
            [ -f $file ] || ln -s /etc/init.d/buildtool $file
104
                [ -f $file ] || ln -s /etc/init.d/buildtool $file
85
        done
105
            done
86
        
106
        
87
        for ii in 0 1 6 ; do 
107
            for ii in 0 1 6 ; do 
88
            file=/etc/rc.d/rc$ii.d/K30buildtool
108
                file=/etc/rc.d/rc$ii.d/K30buildtool
89
            [ -f $file ] || ln -s /etc/init.d/buildtool $file
109
                [ -f $file ] || ln -s /etc/init.d/buildtool $file
90
        done
110
            done
91
        ;;
111
            ;;
92
        
112
        
93
    SunOS)
113
        SunOS)
94
        for ii in 2 3; do
114
            for ii in 2 3; do
95
            file=/etc/rc$ii.d/S80buildtool
115
                file=/etc/rc$ii.d/S80buildtool
96
            [ -f $file ] || ln -s /etc/init.d/buildtool $file
116
                [ -f $file ] || ln -s /etc/init.d/buildtool $file
97
        done
117
            done
98
        
118
        
99
        for ii in 0 1 S ; do 
119
            for ii in 0 1 S ; do 
100
            file=/etc/rc$ii.d/K30buildtool
120
                file=/etc/rc$ii.d/K30buildtool
101
            [ -f $file ] || ln -s /etc/init.d/buildtool $file
121
                [ -f $file ] || ln -s /etc/init.d/buildtool $file
102
        done
122
            done
103
        ;;
123
            ;;
104
        
124
        
105
    *)
125
        *)
106
        echo "$0 setup - Unknown machine type: $mtype"
126
            echo "$0 setup - Unknown machine type: $mtype"
107
        exit 1
127
            exit 1
108
        ;;
128
            ;;
109
    esac        
129
        esac        
-
 
130
    fi    
110
}
131
}
111
 
132
 
112
#
133
#
113
#   Determine user command
134
#   Determine user command
114
#
135
#