1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
|
# Begin /lib/lsb/init-funtions
# Provides initialization funtions as defined by the Linux Standard Base
# specification, version 3.1.0
# Source rc configuration if not inherited from the environment
if [ "${RC_BASE}" = "" ]; then
. /etc/default/rc
fi
###############################################################################
# start_daemon() #
# Usage: start_daemon [-f] [-n nicelevel] [-p pidfile] pathname [args...] #
# #
# Purpose: This runs the specified program as a daemon #
# #
# Inputs: -f: (force) run the program even if it is already running. #
# -n nicelevel: specify a nice level. See 'man nice(1)'. #
# -p pidfile: use the specified file to determine PIDs. #
# pathname: the complete path to the specified program #
# args: additional arguments passed to the program (pathname) #
# #
# Return values (as defined by LSB exit codes): #
# 0 - program is running or service is OK #
# 1 - generic or unspecified error #
# 2 - invalid or excessive argument(s) #
# 5 - program is not installed #
###############################################################################
start_daemon()
{
local force=""
local nice="0"
local pidfile=""
local pidlist=""
local retval=""
# Process arguments
while true
do
case "${1}" in
-f)
force="1"
shift 1
;;
-n)
nice="${2}"
shift 2
;;
-p)
pidfile="${2}"
shift 2
;;
-*)
return 2
;;
*)
program="${1}"
break
;;
esac
done
# Check for a valid program
if [ ! -e "${program}" ]
then
return 5
fi
# Execute
if [ -z "${force}" ]
then
if [ -z "${pidfile}" ]
then
# determine the pid by discovery
pidlist=`pidofproc "${1}"`
retval="${?}"
else
# The PID file contains the needed PIDs
# Note that by LSB requirement, the path must be given to pidofproc,
# however, it is not used by the current implementation or standard.
pidlist=`pidofproc -p "${pidfile}" "${1}"`
retval="${?}"
fi
# return a value ONLY
# It is the init script's (or distribution's functions) responsibilty
# to log messages!
case "${retval}" in
0)
# program is already running correctly, this is a
# succesful start.
return 0
;;
1)
# program is not running, but an invalid pid file exists
# remove the pid file and continue
rm -f "${pidfile}"
;;
3)
# program is not running and no pidfile exists
# do nothing here, let start_deamon continue.
;;
*)
# Others as returned by status values shall not be interpreted
# and returned as an unspecified error.
return 1
;;
esac
fi
# do the start!
nice -n "${nice}" "${@}"
}
###############################################################################
# killproc() #
# Usage: killproc [-p pidfile] pathname [signal] #
# #
# Purpose: Send control signals to running processes #
# #
# Inputs: -p pidfile, uses the specified pidfile #
# pathname, pathname to the specified program #
# signal, send this signal to pathname #
# #
# Return values (as defined by LSB exit codes): #
# 0 - program (pathname) has stopped/is already stopped or a #
# running program has been sent specified signal and stopped #
# successfully #
# 1 - generic or unspecified error #
# 2 - invalid or excessive argument(s) #
# 5 - program is not installed #
# 7 - program is not running and a signal was supplied #
###############################################################################
killproc()
{
local pidfile
local program
local prefix
local progname
local signal="-TERM"
local fallback="-KILL"
local nosig
local pidlist
local retval
local pid
local delay="30"
local piddead
local dtime
# Process arguments
while true
do
case "${1}" in
-p)
pidfile="${2}"
shift 2
;;
*)
program="${1}"
if [ -n "${2}" ]
then
signal="${2}"
fallback=""
else
nosig=1
fi
# error on additional arguments
if [ -n "${3}" ]
then
return 2
else
break
fi
;;
esac
done
# Check for a valid program
if [ ! -e "${program}" ]
then
return 5
fi
# Check for a valid signal
check_signal "${signal}"
if [ "${?}" -ne "0" ]
then
return 2
fi
# Get a list of pids
if [ -z "${pidfile}" ]
then
# determine the pid by discovery
pidlist=`pidofproc "${1}"`
retval="${?}"
else
# The PID file contains the needed PIDs
# Note that by LSB requirement, the path must be given to pidofproc,
# however, it is not used by the current implementation or standard.
pidlist=`pidofproc -p "${pidfile}" "${1}"`
retval="${?}"
fi
# return a value ONLY
# It is the init script's (or distribution's functions) responsibilty
# to log messages!
case "${retval}" in
0)
# program is running correctly
# do nothing here, let killproc continue.
;;
1)
# program is not running, but an invalid pid file exists
# remove the pid file.
rm -f "${pidfile}"
# this is only a success if no signal was passed.
if [ -n "${nosig}" ]
then
return 0
else
return 7
fi
;;
3)
# program is not running and no pidfile exists
# this is only a success if no signal was passed.
if [ -n "${nosig}" ]
then
return 0
else
return 7
fi
;;
*)
# Others as returned by status values shall not be interpreted
# and returned as an unspecified error.
return 1
;;
esac
# perform different actions for exit signals and control signals
check_sig_type "${signal}"
if [ "${?}" -eq "0" ] # signal is used to terminate the program
then
# account for empty pidlist (pid file still exists and nosignal was given)
if [ "${pidlist}" != "" ]; then
#kill the list of pids
for pid in ${pidlist}
do
kill -0 "${pid}" 2> /dev/null
if [ "${?}" -ne "0" ]; then
# process is dead, continue to next and assume all is well
continue
else
kill "${signal}" "${pid}" 2> /dev/null
# Wait up to ${delay}/10 seconds to for "${pid}" to
# terminate in 10ths of a second
while [ "${delay}" -ne "0" ]
do
kill -0 "${pid}" 2> /dev/null || piddead="1"
if [ "${piddead}" = "1" ]
then
break
fi
sleep 0.1
delay="$(( ${delay} - 1 ))"
done
# If a fallback is set, and program is still running, then
# use the fallback
if [ -n "${fallback}" -a "${piddead}" != "1" ]
then
kill "${fallback}" "${pid}" 2> /dev/null
sleep 1
# Check again, and fail if still running
kill -0 "${pid}" 2> /dev/null && return 1
else
# just check one last time and if still alive, fail
sleep 1
kill -0 "${pid}" 2> /dev/null && return 1
fi
fi
done
fi
# Check for and remove stale PID files.
if [ -z "${pidfile}" ]
then
#find the basename of $program
prefix=`echo "${program}" | sed 's/[^/]*$//'`
progname=`echo "${program}" | sed "s@${prefix}@@"`
if [ -e "/var/run/${progname}.pid" ]
then
rm -f "/var/run/${progname}.pid" 2> /dev/null
fi
else
if [ -e "${pidfile}" ]
then
rm -f "${pidfile}" 2> /dev/null
fi
fi
# For signals that do not expect a program to exit, simply
# let kill do it's job, and evaluate kills return for value
else # check_sig_type - signal is not used to terminate program
for pid in ${pidlist}
do
kill "${signal}" "${pid}"
if [ "${?}" -ne "0" ]; then
return 1
fi
done
fi
}
###############################################################################
# pidofproc() #
# Usage: pidofproc [-p pidfile] pathname #
# #
# Purpose: This function returns one or more pid(s) for a particular daemon #
# #
# Inputs: -p pidfile, use the specified pidfile instead of pidof #
# pathname, path to the specified program #
# #
# Return values (as defined by LSB status codes): #
# 0 - Success (PIDs to stdout) #
# 1 - Program is dead, PID file still exists (remaining PIDs output) #
# 3 - Program is not running (no output) #
###############################################################################
pidofproc()
{
local pidfile
local program
local prefix
local progname
local pidlist
local lpids
local exitstatus="0"
# Process arguments
while true
do
case "${1}" in
-p)
pidfile="${2}"
shift 2
;;
*)
program="${1}"
if [ -n "${2}" ]
then
# Too many arguments
# Since this is status, return unknown
return 4
else
break
fi
;;
esac
done
# If a PID file is not specified, try and find one.
if [ -z "${pidfile}" ]
then
# get the program's basename
prefix=`echo "${program}" | sed 's/[^/]*$//'`
progname=`echo "${program}" | sed "s@${prefix}@@"`
# if a PID file exists with that name, assume that is it.
if [ -e "/var/run/${progname}.pid" ]
then
pidfile="/var/run/${progname}.pid"
fi
fi
# if a PID file is set and exists, use it.
if [ -n "${pidfile}" -a -e "${pidfile}" ]
then
# use the value in the first line of the pidfile
pidlist=`/bin/head -n1 "${pidfile}"`
# This can optionally be written as 'sed 1q' to repalce 'head -n1'
# should LFS move /bin/head to /usr/bin/head
else
# use pidof
pidlist=`pidof "${program}"`
fi
# Figure out if all listed PIDs are running.
for pid in ${pidlist}
do
kill -0 ${pid} 2> /dev/null
if [ "${?}" -eq "0" ]; then
lpids="${pids}${pid} "
else
exitstatus="1"
fi
done
if [ -z "${lpids}" -a ! -f "${pidfile}" ]; then
return 3
else
echo "${lpids}"
return "${exitstatus}"
fi
}
###############################################################################
# log_success_msg() #
# Usage: log_success_msg [$MESSAGE | "message"] #
# #
# Purpose: Print a successful status message to the screen and optionally #
# a boot log file. #
# #
# Inputs: accepts one string value, either a quoted string or optionally #
# the value of $MESSAGE if set in the running environment. #
# #
# Return values: Not used #
###############################################################################
log_success_msg()
{
echo -n -e "${PREFIX_SUCCESS}${@}"
echo -e "${SET_COL}${BRACKET}[${SUCCESS} OK ${BRACKET}]${NORMAL}"
if [ "${BOOTLOG_ENAB}" = "yes" ]; then
if [ $( hostname ) = "(none)" ]; then
BTTIMESPEC=""
else
BTTIMESPEC="$(echo `date -u +"%b %d %T"` `hostname`) "
fi
if [ "${RUNLEVEL}" != "0" -a "${RUNLEVEL}" != "6" ]; then
echo "${BTTIMESPEC}bootlog: ${@} Successful" >> /run/.bootlog
fi
fi
return 0
}
###############################################################################
# log_failure_msg() #
# Usage: log_failure_msg [$MESSAGE | "message"] #
# #
# Purpose: Print a failure status message to the screen and optionally #
# a boot log file. #
# #
# Inputs: accepts one string value, either a quoted string or optionally #
# the value of $MESSAGE if set in the running environment. #
# #
# Return values: Not used #
###############################################################################
log_failure_msg()
{
echo -n -e "${PREFIX_FAILURE}${@}"
echo -e "${SET_COL}${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"
if [ "${BOOTLOG_ENAB}" = "yes" ]; then
if [ $( hostname ) = "(none)" ]; then
BTTIMESPEC=""
else
BTTIMESPEC="$(echo `date -u +"%b %d %T"` `hostname`) "
fi
if [ "${RUNLEVEL}" != "0" -a "${RUNLEVEL}" != "6" ]; then
echo "${BTTIMESPEC}bootlog: ${@} Failed!" >> /run/.bootlog
fi
fi
return 0
}
###############################################################################
# log_warning_msg() #
# Usage: log_warning_msg [$MESSAGE | "message"] #
# #
# Purpose: Print a warning status message to the screen and optionally #
# a boot log file. #
# #
# Inputs: accepts one string value, either a quoted string or optionally #
# the value of $MESSAGE if set in the running environment. #
# #
# Return values: Not used #
###############################################################################
log_warning_msg()
{
echo -n -e "${PREFIX_WARNING}${@}"
echo -e "${SET_COL}${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}"
if [ "${BOOTLOG_ENAB}" = "yes" ]; then
if [ $( hostname ) = "(none)" ]; then
BTTIMESPEC=""
else
BTTIMESPEC="$(echo `date -u +"%b %d %T"` `hostname`) "
fi
if [ "${RUNLEVEL}" != "0" -a "${RUNLEVEL}" != "6" ]; then
echo "${BTTIMESPEC}bootlog: ${@} Warning" >> /run/.bootlog
fi
fi
return 0
}
# The remaining fucntions are distro specific and are not defined by the LSB
###############################################################################
# check_signal() #
# Usage: check_signal [ -{signal} | {signal} ] #
# #
# Purpose: Check for a valid signal. This is not defined by any LSB draft, #
# however, it is required to check the signals to determine if the #
# signals chosen are invalid arguments to the other functions. #
# #
# Inputs: accepts a single string value in the form or -{signal} or {signal} #
# #
# Return values: #
# 0 - Success (signal is valid #
# 1 - Signal is not valid #
###############################################################################
check_signal()
{
local valsig
# Add error handling for invalid signals
valsig="-ALRM -HUP -INT -KILL -PIPE -POLL -PROF -TERM -USR1 -USR2"
valsig="${valsig} -VTALRM -STKFLT -PWR -WINCH -CHLD -URG -TSTP -TTIN"
valsig="${valsig} -TTOU -STOP -CONT -ABRT -FPE -ILL -QUIT -SEGV -TRAP"
valsig="${valsig} -SYS -EMT -BUS -XCPU -XFSZ -0 -1 -2 -3 -4 -5 -6 -8 -9"
valsig="${valsig} -11 -13 -14 -15"
echo "${valsig}" | grep -- " ${1} " > /dev/null
if [ "${?}" -eq "0" ]
then
return 0
else
return 1
fi
}
###############################################################################
# check_sig_type() #
# Usage: check_signal [ -{signal} | {signal} ] #
# #
# Purpose: Check if signal is a program termination signal or a control #
# signal. This is not defined by any LSB draft, however, it is #
# required to check the signals to determine if they are intended #
# to end a program or simply to control it. #
# #
# Inputs: accepts a single string value in the form or -{signal} or {signal} #
# #
# Return values: #
# 0 - Signal is used for program termination #
# 1 - Signal is used for program control #
###############################################################################
check_sig_type()
{
local valsig
# The list of termination signals (limited to generally used items)
valsig="-ALRM -INT -KILL -TERM -PWR -STOP -ABRT -QUIT -2 -3 -6 -9 -14 -15"
echo "${valsig}" | grep -- " ${1} " > /dev/null
if [ "${?}" -eq "0" ]
then
return 0
else
return 1
fi
}
###############################################################################
# chkstat() #
# Usage: chckstat BIN_FILE {CONFIG_FILE} #
# #
# Purpose: chk_stat checks the status of a script by checking for both a #
# binary file to execute, and if set, a config file that may be #
# needed for the program to run successfully. #
# #
# Inputs: accepts first argument of an executable file, and optionally a #
# second arugument of a configuration file. If BIN_FILE and #
# CONFIG_FILE are set in the calling environment, either or both #
# arguments may be omitted. #
# #
# Return values: #
# 0 - The executable, and optionally the configuration file exists #
# 2 - Invalid or excessive arguments #
# 5 - BIN_FILE does not exist #
# 6 - CONFIG_FILE (if set) does not exist #
###############################################################################
chk_stat()
{
if [ "${#}" -gt "0" -a "${#}" -lt "3" ]; then
BIN_FILE="${1}"
if [ -z "${2}" ]; then
CONFIG_FILE=""
else
CONFIG_FILE="${2}"
fi
elif [ -z "${BIN_FILE}" ]; then
echo "Usage: 'chk_stat BIN_FILE CONFIG_FILE'"
exit 1 # Generic Error
fi
if [ ! -e "${BIN_FILE}" ]; then
log_failure_msg "${BIN_FILE} not installed" &&
exit 5
fi
if [ ! -z "${CONFIG_FILE}" ]; then
if [ ! -e "${CONFIG_FILE}" ]; then
log_failure_msg "${CONFIG_FILE} does not exist" &&
exit 6
fi
fi
}
###############################################################################
# loadproc() #
# Usage: loadproc {arguments} #
# #
# Purpose: loadproc is just a wrapper to start_daemon for simple scripts, #
# which will require no aruguments if $BIN_FILE is set. #
# #
# Inputs: Any optional arguments passed to loadproc will be passed on to the #
# executable defined by $BIN_FILE. #
# #
# Return values: (none) #
###############################################################################
loadproc()
{
start_daemon "${BIN_FILE}" "${@}"
}
###############################################################################
# endproc() #
# Usage: endproc {arguments} #
# #
# Purpose: endproc is just a wrapper to killproc for simple scripts, which #
# which will require no aruguments if $BIN_FILE is set. #
# #
# Inputs: Any optional arguments passed to endproc will be passed on to the #
# executable defined by $BIN_FILE. #
# #
# Return values: (none) #
###############################################################################
endproc()
{
killproc "${BIN_FILE}" "${@}"
}
###############################################################################
# statusproc() #
# Usage: statusproc $BIN_FILE $MESSAGE #
# #
# Purpose: stautsproc is just a wrapper to pidofproc for simple scripts, #
# which will require no aruguments if $BIN_FILE and MESSAGE are set. #
# #
# Inputs: accepts first argument of an executable file, and a second message #
# arugument "MESSAGE" to be displayed. If BIN_FILE and MESSAGE are #
# set in the calling environment, both arguments may be omitted. #
# #
# Return values: exit values of pidofproc #
###############################################################################
statusproc()
{
if [ "${#}" -gt "0" -a "${#}" -lt "3" ]; then
BIN_FILE="${1}"
MESSAGE="${2}"
elif [ -z "${BIN_FILE}" -o -z "${MESSAGE}" ]; then
echo "Usage: 'statusproc BIN_FILE MESSAGE'"
exit 1 # Generic Error
fi
pidlist=`pidofproc "${BIN_FILE}"`
STATUS=$?
echo "Checking ${MESSAGE} status:"
if [ "${STATUS}" -eq "0" ]; then
log_success_msg "Running with PID(s) ${pidlist}"
else
log_warning_msg "Not running!"
fi
return "${STATUS}"
}
###############################################################################
# reloadproc() #
# Usage: reloadproc {--force} $BIN_FILE $MESSAGE #
# #
# Purpose: reloadproc sends a HUP signal to the running program (relaod #
# configuration). It optionally, using the -force switch, checks the #
# status of a particular program and starts it if it is not already #
# running. #
# #
# Inputs: accepts one optional switch (must be the first argument), and #
# either two, or zero string arguments. If BIN_FILE and MESSAGE are #
# set in the calling envirnoment it will use those values, else it #
# requires the bin file as the first argument (following -force if #
# used), and the message as the second. If the --force argument is #
# given, it follows the LSB definition of 'force-reload' - the #
# program is started if not already running. #
# #
# Return values: 1 - generic error #
###############################################################################
reloadproc()
{
local force="0"
if [ "${#}" -gt "0" -a "${1}" = "-force" ]; then
force="1"
shift 1
fi
if [ "${#}" -gt "0" -a "${#}" -lt "3" ]; then
BIN_FILE="${1}"
MESSAGE="${2}"
elif [ -z "${BIN_FILE}" -o -z "${MESSAGE}" ]; then
echo "Usage: 'reloadproc BIN_FILE MESSAGE'"
exit 1 # Generic Error
fi
}
###############################################################################
# evaluate_retval() #
# Usage: evaluate_retval \ #
# [standard|start|stop|reload|force-reload|restart|try-restart] #
# #
# Purpose: determines the sucess or failure of a previous command based on #
# LSB exit values, and prints messages to the screen using the #
# log_*_msg() functions. #
# #
# Inputs: accepts one argument which determines the output of the message #
# displayed on the screen based on the LSB input values for init #
# scripts. The 'standard' argument makes no changes to the value of #
# $message or $MESSAGE, but only one can be set in the calling #
# environment. #
# #
# Return values: (none) #
###############################################################################
evaluate_retval()
{
local error_value="${?}"
# Handle LSB defined return values
case "${1}" in
start)
case "${error_value}" in
0)
log_success_msg "Starting ${MESSAGE} "
return "${error_value}"
;;
2)
log_failure_msg "Starting ${MESSAGE} Error: Invalid argument!"
return "${error_value}"
;;
5)
log_failure_msg "Starting ${MESSAGE} Error: Not available!"
return "${error_value}"
;;
*)
log_failure_msg "Starting ${MESSAGE} Error: General failure!"
return "${error_value}"
;;
esac
;;
stop)
case "${error_value}" in
0)
log_success_msg "Stopping ${MESSAGE} "
return "${error_value}"
;;
2)
log_failure_msg "Stopping ${MESSAGE} Error: Invalid argument!"
return "${error_value}"
;;
5)
log_failure_msg "Stopping ${MESSAGE} Error: Not available!"
return "${error_value}"
;;
7)
log_warning_msg "Stopping ${MESSAGE} Warning: Not running!"
return "${error_value}"
;;
*)
log_failure_msg "Stopping ${MESSAGE} Error: General failure!"
return "${error_value}"
;;
esac
;;
force-reload)
message="Forcefully reloading "
;;
reload)
message="Reloading "
;;
restart)
message="Restarting "
;;
try-restart)
message="Trying restart "
;;
standard)
# $message or $MESSAGE must be set, but not both in order
# to use the 'standard' target.
;;
esac
# Print messages for the generic force-reload, reload, restart,
# and try-restart targets
if [ "${error_value}" -eq "0" ]
then
log_success_msg "${message}${MESSAGE} "
return "${error_value}"
else
log_failure_msg "${message}${MESSAGE} "
return "${error_value}"
fi
}
# End /lib/lsb/init-functions
|