source: bootscripts/lfs/init.d/template@ 887af77

11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 bdubbs/gcc13 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng 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 887af77 was 887af77, checked in by Pierre Labastie <pierre.labastie@…>, 2 years ago

Adapt template to new semantics of S/K symlinks

  • Property mode set to 100644
File size: 1.4 KB
Line 
1#!/bin/sh
2########################################################################
3# Begin scriptname
4#
5# Description :
6#
7# Authors :
8#
9# Version : LFS x.x
10#
11# Notes :
12#
13########################################################################
14
15### BEGIN INIT INFO
16# Provides: template
17# Required-Start:
18# Should-Start:
19# Required-Stop:
20# Should-Stop:
21# Default-Start:
22# Default-Stop:
23# Short-Description:
24# Description:
25# X-LFS-Provided-By:
26### END INIT INFO
27
28. /lib/lsb/init-functions
29
30case "${1}" in
31 start)
32 log_info_msg "Starting..."
33 # if it is possible to use start_daemon
34 start_daemon fully_qualified_path
35 # if it is not possible to use start_daemon
36 # (command to start the daemon is not simple enough)
37 if ! pidofproc daemon_name_as_reported_by_ps >/dev/null; then
38 command_to_start_the_service
39 fi
40 evaluate_retval
41 ;;
42
43 stop)
44 log_info_msg "Stopping..."
45 # if it is possible to use killproc
46 killproc fully_qualified_path
47 # if it is not possible to use killproc
48 # (the daemon shoudn't be stopped by killing it)
49 if pidofproc daemon_name_as_reported_by_ps >/dev/null; then
50 command_to_stop_the_service
51 fi
52 evaluate_retval
53 ;;
54
55 restart)
56 ${0} stop
57 sleep 1
58 ${0} start
59 ;;
60
61 *)
62 echo "Usage: ${0} {start|stop|restart}"
63 exit 1
64 ;;
65esac
66
67exit 0
68
69# End scriptname
Note: See TracBrowser for help on using the repository browser.