From: Greg KH <greg@kroah.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: Cold plug starting services too soon
Date: Thu, 19 Jan 2006 03:45:16 +0000 [thread overview]
Message-ID: <20060119034516.GA16688@kroah.com> (raw)
In-Reply-To: <20060117203244.GA3135@kroah.com>
On Wed, Jan 18, 2006 at 09:28:31AM +0000, Roy Marples wrote:
> On Wednesday 18 January 2006 00:27, Greg KH wrote:
> > On Tue, Jan 17, 2006 at 09:43:03PM +0100, Kay Sievers wrote:
> > > All running events are exported in /dev/.udev/queue/, events that fail
> > > will be moved to /dev/.udev/failed/. Make sure the script return non-zero
> > > if it can't run and retry all failed events from /dev/.udev/failed/
> > > after "localfs" is done. If the same event then runs successfully, it
> > > will go away from /dev/.udev/failed/. On SUSE I have a second udev boot
> > > script that is called /etc/init.d/boot.udev_retry.
> >
> > Cool, I'll try doing that for Gentoo and see how it works out. Thanks
> > for adding this to udev already.
> >
> > Roy, do you think this will work out properly?
>
> Yes, this can work out nicely. However, I don't see /dev/.udev/failed when we
> exit with code 1. Is there something I'm missing?
>
> Currently I have this fairly near the top of runscript.sh
>
> # Ensure that we have completed sysinit
> if [[ ${IN_HOTPLUG} = 1 ]] ; then
> for pid in $(pidof bash) ; do
> if [[ "$(cat "/proc/${pid}/cmdline" 2>/dev/null)" \
> = "/bin/bash/sbin/rcsysinit" ]] ; then
> eerror "ERROR: cannot hotplug ${myservice} until sysinit has
> run."
> exit 1
> fi
> done
> unset pid
> fi
>
> Now thats very hacky, but the only way I can think of to find out if our rc
> system has completed its sysinit. A better solution would be this
>
> # Ensure that we have completed sysinit
> if [[ ${RC_SYSINIT} = 1 ]] ; then
> eerror "ERROR: cannot run ${myservice} until sysinit has completed."
> exit 1
> fi
>
> Obviously this only works if rc can configure udev to export shell variables
> before triggerring hotplugable events and can change/unset/add it after
> sysinit. Something like this maybe.
>
> udev_set_env "RC_SYSINIT=1"
>
> do stuff to complete sysinit
>
> udev_sev_env "RC_SYSINIT="
>
> Can we do this Greg?
Hm, we might be able to mess around with this some, but why not just
create a temporary file when we start udev, which the rc scripts can
check? When the initial udev startup is done (or whenever you want it),
the file can be removed. That should be a lot simpler, right?
thanks,
greg k-h
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x103432&bid#0486&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
next prev parent reply other threads:[~2006-01-19 3:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-17 20:32 Cold plug starting services too soon Greg KH
2006-01-17 20:34 ` Greg KH
2006-01-17 20:43 ` Kay Sievers
2006-01-17 20:50 ` Marco d'Itri
2006-01-18 0:27 ` Greg KH
2006-01-18 9:28 ` Roy Marples
2006-01-19 3:45 ` Greg KH [this message]
2006-01-19 17:54 ` Roy Marples
2006-01-19 18:04 ` Greg KH
2006-01-19 18:11 ` Roy Marples
2006-01-19 18:19 ` Greg KH
2006-01-19 18:35 ` Roy Marples
2006-01-20 0:09 ` Greg KH
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=20060119034516.GA16688@kroah.com \
--to=greg@kroah.com \
--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).