source: bootscripts/contrib/lsb-v3/init.d/template@ 6f69b5c

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 6f69b5c was 1c48007, checked in by Bruce Dubbs <bdubbs@…>, 16 years ago

Moved bootscripts and udev-config to BOOK
Updated Makefile to automatically generate bootscript and udev-config tarballs
Updated licesnse to be the same as BLFS

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@8548 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 2.3 KB
Line 
1#!/bin/sh
2# Begin /etc/init.d/template
3
4### BEGIN INIT INFO
5# Provides: template
6# Required-Start:
7# Should-Start:
8# Required-Stop:
9# Should-Stop:
10# Default-Start:
11# Default-Stop:
12# Short-Description:
13# Description:
14# X-LFS-Default-Start:
15# X-LFS-Default-Stop:
16# X-LFS-Provided-By:
17### END INIT INFO
18
19# Source the LSB init-functions, ours are pulled in from there.
20. /lib/lsb/init-functions
21
22# These are optional, but required for chk_stat. They will be used in
23# the rest of the functions if defined, else you must provide a program
24# name to control, and a message ('Starting Template Service...'
25# or 'Stoping Template Service...') to evauate_retval. See the
26# documentaion in the lfs-fucntions file for more information.
27MESSAGE="Template Service"
28BIN_FILE="/some/path/to/template"
29CONFIGFILE="/etc/sysconfig/template.conf"
30
31# check that $BIN_FILE exists and is executable, and $CONFIGFILE exists.
32chk_stat
33
34# LSB Defined functions require that at least $BIN_FILE be passed to them,
35# where as lfs-functions will use the $BIN_FILE environment variable.
36# loadproc() and endproc() are just wrappers that pass everything on to
37# the LSB defined functions.
38
39case "${1}" in
40 start)
41 #start_daemon "${BIN_FILE}" -arg1 -arg2 #... or:
42 loadproc -arg1 -arg2 -arg3 #...
43 evaluate_retval start
44 ;;
45
46 stop)
47 #killproc -TERM "${BIN_FILE}" or:
48 endproc
49 evaluate_retval stop
50 ;;
51
52 force-reload)
53 reloadproc -force
54 evaluate_retval force-reload
55 ;;
56
57 restart)
58 $0 stop
59 $0 start
60 ;;
61
62 status)
63 statusproc
64 ;;
65
66# reload and try-restart are optional per LSB requirements
67 reload)
68 reloadproc
69 evaluate_retval reload
70 ;;
71
72 try-restart)
73 # Since this is optional there is no lfs-function for this one...
74 # might be at a later time if used enough, but I doubt it usefullness.
75 pidofproc "${BIN_FILE}" > /dev/null
76 if [ "${?}" -ne "0" ]; then
77 MESSAGE="${MESSAGE}: Not Running"
78 else
79 $0 stop
80 $0 start
81 exit 0
82 fi
83 evaluate_retval try-restart
84 ;;
85
86 *)
87 echo "Usage: ${0} {start|stop|{force-}reload|{try-}restart|status}"
88 exit 1
89 ;;
90esac
91
92# End /etc/init.d/template
Note: See TracBrowser for help on using the repository browser.