Browse code

Changes and improvements for SuSE 8.1.

Nils Ohlmeier authored on 29/10/2002 22:36:23
Showing 2 changed files
... ...
@@ -1,75 +1,81 @@
1 1
 #! /bin/sh
2 2
 # Copyright (c) 2002 Frauenhofer Gesellschaft FOKUS, Germany.
3
+# All rights reserved.
3 4
 #
4 5
 # Author: Nils Ohlmeier <ohlmeier@fokus.fhg.de>
5 6
 #
6 7
 # /etc/init.d/ser
7 8
 #
8 9
 ### BEGIN INIT INFO
9
-# Provides: sip
10
-# Required-Start: $network
11
-# Required-Stop:  $network
12
-# Default-Start:  3 5
13
-# Default-Stop:   0 1 2 6
14
-# Description:    Start the SIP Express Router.
10
+# Provides:          sip
11
+# Required-Start:    $network
12
+# X-UnitedLinux-Should-Start: $network
13
+# Required-Stop:     $network
14
+# X-UnitedLinux-Should-Stop: $network
15
+# Default-Start:     3 5
16
+# Default-Stop:      0 1 2 6
17
+# Short-Description: SIP Express Router
18
+# Description:       Start SER and provide the routing of SIP requests.
15 19
 ### END INIT INFO
16 20
 
17
-# Source SuSE config
18
-. /etc/rc.config
19
-
20
-# Determine the base and follow a runlevel link name.
21
-base=${0##*/}
22
-link=${base#*[SK][0-9][0-9]}
23 21
 
22
+# Check for missing binaries (stale symlinks should not happen)
24 23
 SER_BIN=/usr/sbin/ser
25 24
 test -x $SER_BIN || exit 5
26 25
 
26
+# Check for existence of needed config file and read it
27
+SER_CONFIG=/etc/ser/ser.cfg
28
+test -r $SER_CONFIG || exit 6
29
+#. $FOO_CONFIG
30
+
27 31
 # Shell functions sourced from /etc/rc.status:
28 32
 #      rc_check         check and set local and overall rc status
29 33
 #      rc_status        check and set local and overall rc status
30 34
 #      rc_status -v     ditto but be verbose in local rc status
31 35
 #      rc_status -v -r  ditto and clear the local rc status
36
+#      rc_status -s     display "skipped" and exit with status 3
37
+#      rc_status -u     display "unused" and exit with status 3
32 38
 #      rc_failed        set local and overall rc status to failed
33
-#      rc_failed <num>  set local and overall rc status to <num><num>
39
+#      rc_failed <num>  set local and overall rc status to <num>
34 40
 #      rc_reset         clear local rc status (overall remains)
35 41
 #      rc_exit          exit appropriate to overall rc status
42
+#      rc_active	checks whether a service is activated by symlinks
43
+#      rc_splash arg    sets the boot splash screen to arg (if active)
36 44
 . /etc/rc.status
37 45
 
38
-# First reset status of this service
46
+# Reset status of this service
39 47
 rc_reset
40 48
 
41 49
 # Return values acc. to LSB for all commands but status:
42
-# 0 - success
43
-# 1 - generic or unspecified error
44
-# 2 - invalid or excess argument(s)
45
-# 3 - unimplemented feature (e.g. "reload")
46
-# 4 - insufficient privilege
47
-# 5 - program is not installed
48
-# 6 - program is not configured
49
-# 7 - program is not running
50
+# 0	  - success
51
+# 1       - generic or unspecified error
52
+# 2       - invalid or excess argument(s)
53
+# 3       - unimplemented feature (e.g. "reload")
54
+# 4       - user had insufficient privileges
55
+# 5       - program is not installed
56
+# 6       - program is not configured
57
+# 7       - program is not running
58
+# 8--199  - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
50 59
 # 
51 60
 # Note that starting an already running service, stopping
52 61
 # or restarting a not-running service as well as the restart
53
-# with force-reload (in case signalling is not supported) are
62
+# with force-reload (in case signaling is not supported) are
54 63
 # considered a success.
55 64
 
56 65
 case "$1" in
57 66
     start)
58
-	echo -n "Starting SIP Express Router"
67
+	echo -n "Starting SIP Express Router "
59 68
 	## Start daemon with startproc(8). If this fails
60
-	## the echo return value is set appropriate.
61
-
62
-	# NOTE: startproc return 0, even if service is 
63
-	# already running to match LSB spec.
69
+	## the return value is set appropriately by startproc.
64 70
 	startproc $SER_BIN
65 71
 
66 72
 	# Remember status and be verbose
67 73
 	rc_status -v
68 74
 	;;
69 75
     stop)
70
-	echo -n "Shutting down SIP Express Router"
76
+	echo -n "Shutting down SIP Express Router "
71 77
 	## Stop daemon with killproc(8) and if this fails
72
-	## set echo the echo return value.
78
+	## killproc sets the return value according to LSB.
73 79
 
74 80
 	killproc -TERM $SER_BIN
75 81
 
... ...
@@ -90,32 +96,36 @@ case "$1" in
90 96
 	## do this on signal 1 (SIGHUP).
91 97
 	## If it does not support it, restart.
92 98
 
93
-	echo -n "Reload service SIP Express Router"
99
+	echo -n "Reload service SIP Express Router "
94 100
 	## Otherwise:
95 101
 	$0 stop  &&  $0 start
96 102
 	rc_status
97 103
 	;;
98 104
     reload)
99 105
 	## Like force-reload, but if daemon does not support
100
-	## signalling, do nothing (!)
106
+	## signaling, do nothing (!)
101 107
 
102 108
 	## Otherwise if it does not support reload:
103 109
 	rc_failed 3
104 110
 	rc_status -v
105 111
 	;;
106 112
     status)
107
-	echo -n "Checking for SIP Express Router: "
113
+	echo -n "Checking for service SIP Express Router "
108 114
 	## Check status with checkproc(8), if process is running
109 115
 	## checkproc will return with exit status 0.
110 116
 
111
-	# Status has a slightly different for the status command:
112
-	# 0 - service running
117
+	# Return value is slightly different for the status command:
118
+	# 0 - service up and running
113 119
 	# 1 - service dead, but /var/run/  pid  file exists
114 120
 	# 2 - service dead, but /var/lock/ lock file exists
115
-	# 3 - service not running
116
-
121
+	# 3 - service not running (unused)
122
+	# 4 - service status unknown :-(
123
+	# 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
124
+	
117 125
 	# NOTE: checkproc returns LSB compliant status values.
118 126
 	checkproc $SER_BIN
127
+	# NOTE: rc_status knows that we called this init script with
128
+	# "status" option and adapts its messages accordingly.
119 129
 	rc_status -v
120 130
 	;;
121 131
     *)
... ...
@@ -32,7 +32,8 @@ Module, Registrar and User Location.
32 32
 %package  mysql
33 33
 Summary:  MySQL connectivity for the SIP Express Router.
34 34
 Group:    System Environment/Daemons
35
-Requires: ser
35
+Requires: ser mysql
36
+BuildPrereq: mysql-devel
36 37
 
37 38
 %description mysql
38 39
 The ser-mysql package contains MySQL database connectivity that you
... ...
@@ -149,6 +150,9 @@ sbin/insserv etc/init.d/
149 150
 
150 151
 
151 152
 %changelog
153
+* Mon Oct 28 2002 Nils Ohlmeier <ohlmeier@fokus.fhg.de>
154
+- Added mysql and mysql-devel to the Req for the ser-mysql rpm.
155
+
152 156
 * Thu Sep 26 2002 Nils Ohlmeier <ohlmeier@fokus.fhg.de>
153 157
 - Added library path to mysql/Makefile to build on SuSE 8.0
154 158