From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roy Marples Date: Wed, 18 Jan 2006 09:28:31 +0000 Subject: Re: Cold plug starting services too soon Message-Id: <200601180928.34889.uberlord@gentoo.org> MIME-Version: 1 Content-Type: multipart/mixed; boundary="nextPart3169137.uiiZIkMfc7" List-Id: References: <20060117203244.GA3135@kroah.com> In-Reply-To: <20060117203244.GA3135@kroah.com> To: linux-hotplug@vger.kernel.org --nextPart3169137.uiiZIkMfc7 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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-ze= ro > > 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=20 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} =3D=3D 1 ]] ; then for pid in $(pidof bash) ; do if [[ "$(cat "/proc/${pid}/cmdline" 2>/dev/null)" \ =3D=3D "/bin/bash/sbin/rcsysinit" ]] ; then eerror "ERROR: cannot hotplug ${myservice} until sysinit has=20 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= =20 system has completed its sysinit. A better solution would be this # Ensure that we have completed sysinit if [[ ${RC_SYSINIT} =3D=3D 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 variable= s=20 before triggerring hotplugable events and can change/unset/add it after=20 sysinit. Something like this maybe. udev_set_env "RC_SYSINIT=3D1" do stuff to complete sysinit udev_sev_env "RC_SYSINIT=3D" Can we do this Greg? =2D-=20 Roy Marples Gentoo Linux Developer --nextPart3169137.uiiZIkMfc7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBDzgpCEbVyYKaZ/NERAoCSAJ4sqIAtIi8H+F3vNETh8abCbf/FLwCfS44/ rSqIS0kOEZ7dg/idxkbxhbk= =PxB5 -----END PGP SIGNATURE----- --nextPart3169137.uiiZIkMfc7-- ------------------------------------------------------- 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=103432&bid=230486&dat=121642 _______________________________________________ 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