From e1184971b59aaf98f2ad758b564adb2c86797bb7 Mon Sep 17 00:00:00 2001 From: Yaroslav Tykhiy Date: Thu, 16 Aug 2007 13:08:42 +0000 Subject: [PATCH] Polish the part on "shutdown" to make it even more precise and understandable. --- .../articles/rc-scripting/article.sgml | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/en_US.ISO8859-1/articles/rc-scripting/article.sgml b/en_US.ISO8859-1/articles/rc-scripting/article.sgml index 0225680357..58c014c9b6 100644 --- a/en_US.ISO8859-1/articles/rc-scripting/article.sgml +++ b/en_US.ISO8859-1/articles/rc-scripting/article.sgml @@ -1140,19 +1140,29 @@ run_rc_command "$1" shutdown - The script wants to run during system shutdown. + This keyword is to be listed + explicitly if the service needs + to be stopped before system shutdown. - When the system is shut down, + When the system is going to shut down, /etc/rc.shutdown runs. It assumes that most rc.d scripts - have nothing to do at system shutdown time. For - faster shutdown, /etc/rc.shutdown - selectively invokes scripts with the - shutdown keyword and passes - the command to them. + have nothing to do at that time. Therefore + /etc/rc.shutdown + selectively invokes rc.d + scripts with the shutdown + keyword, effectively ignoring the + rest of the scripts. For even faster shutdown, + /etc/rc.shutdown passes + the command to the scripts + it runs so that they skip preliminary checks, e.g., + the pidfile check. As dependent services should be + stopped before their prerequisites, + /etc/rc.shutdown runs the scripts + in reverse dependency order. - Threrefore, when writing a real + If writing a real rc.d script, you should consider whether it is relevant at system shutdown time. E.g., if your script does its work in