From 887af775a52a78e1e1552b5c0b83aaa5b98fa1a2 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Tue, 22 Mar 2022 11:30:52 +0100 Subject: [PATCH] Adapt template to new semantics of S/K symlinks --- bootscripts/lfs/init.d/template | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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)