aboutsummaryrefslogtreecommitdiffstats
path: root/bootscripts
diff options
context:
space:
mode:
Diffstat (limited to 'bootscripts')
-rw-r--r--bootscripts/lfs/init.d/template14
1 files changed, 14 insertions, 0 deletions
diff --git a/bootscripts/lfs/init.d/template b/bootscripts/lfs/init.d/template
index 59c5f3cba..0a7872d98 100644
--- a/bootscripts/lfs/init.d/template
+++ b/bootscripts/lfs/init.d/template
@@ -30,12 +30,26 @@
case "${1}" in
start)
log_info_msg "Starting..."
+ # if it is possible to use start_daemon
start_daemon fully_qualified_path
+ # if it is not possible to use start_daemon
+ # (command to start the daemon is not simple enough)
+ if ! pidofproc daemon_name_as_reported_by_ps >/dev/null; then
+ command_to_start_the_service
+ fi
+ evaluate_retval
;;
stop)
log_info_msg "Stopping..."
+ # if it is possible to use killproc
killproc fully_qualified_path
+ # if it is not possible to use killproc
+ # (the daemon shoudn't be stopped by killing it)
+ if pidofproc daemon_name_as_reported_by_ps >/dev/null; then
+ command_to_stop_the_service
+ fi
+ evaluate_retval
;;
restart)