From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Thu, 19 Jan 2006 03:45:16 +0000 Subject: Re: Cold plug starting services too soon Message-Id: <20060119034516.GA16688@kroah.com> List-Id: References: <20060117203244.GA3135@kroah.com> In-Reply-To: <20060117203244.GA3135@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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&kid3432&bid#0486&dat1642 _______________________________________________ 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