From: Frank Murphy <murphyf+hotplug@f-m.fm>
To: linux-hotplug@vger.kernel.org
Subject: Little problem and questions about hotplug init script
Date: Wed, 09 Jul 2003 11:32:36 +0000 [thread overview]
Message-ID: <marc-linux-hotplug-105775053217133@msgid-missing> (raw)
[-- Attachment #1: Type: text/plain, Size: 1115 bytes --]
I've been looking at some of the hotplug stuff, and I found a typo and another
problem in the init.d/rc.d script. It also prompts some questions for me.
I've attached a diff as well as the whole script with the changes,
My first question is about the /var/lock/subsys/hotplug lock file. What is it
supposed to be locking? Because for the force-reload case, it doesn't work
properly (a lockfile exists during startup, but not afterwards -- the exact
opposite of what would happen if the script were called first with stop, then
start).
My second question is about the /etc/init.d/functions. I assume that each
distribution has a different method for these init scripts, so the version
that ships with hotplug is more of a reference implementation that will be
modified. Seeing as this version doesn't use any included functions, and
hotplug doesn't ship with this functions file, perhaps this should be
deleted?
My third question is about the description at the top. Why are the comment
lines followed by a backslash (\) ? Is there some tool being used to parse
these?
Thanks for any help.
Frank
[-- Attachment #2: hotplug --]
[-- Type: application/x-shellscript, Size: 1160 bytes --]
[-- Attachment #3: hotplug.patch --]
[-- Type: text/x-diff, Size: 1106 bytes --]
--- hotplug 2003-07-09 13:24:09.000000000 +0200
+++ hotplug.old 2003-07-09 13:24:58.000000000 +0200
@@ -20,30 +20,35 @@
. /etc/rc.d/init.d/functions
fi
-run_rc_files () {
- for RC in /etc/hotplug/*.rc
- do
- $RC $1
- done
-}
-
case "$1" in
start|restart|status)
- run_rc_files $1
+ for RC in /etc/hotplug/*.rc
+ do
+ $RC $1
+ done
touch /var/lock/subsys/hotplug
;;
stop)
- run_rc_files $1
+ for RC in /etc/hotplug/*.rc
+ do
+ $RC stop
+ done
rm -f /var/lock/subsys/hotplug
;;
force-reload)
- run_rc_files stop
- run_rc_files start
+ for RC in /etc/hotplug/*.rc
+ do
+ $RC stop
+ done
+ for RC in /etc/hotplug/*.rc
+ do
+ $RC start
+ done
rm -f /var/lock/subsys/hotplug
;;
*)
- echo $"Usage: $0 {start|stop|restart|status|force-reload}"
+ echo $"Usage: $0 {start|stop|restart|status|force_reload}"
exit 3
;;
esac
reply other threads:[~2003-07-09 11:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-linux-hotplug-105775053217133@msgid-missing \
--to=murphyf+hotplug@f-m.fm \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).