* Little problem and questions about hotplug init script
@ 2003-07-09 11:32 Frank Murphy
0 siblings, 0 replies; only message in thread
From: Frank Murphy @ 2003-07-09 11:32 UTC (permalink / raw)
To: linux-hotplug
[-- 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-07-09 11:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-09 11:32 Little problem and questions about hotplug init script Frank Murphy
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).