multiple instances of the same script?

Scott James Remnant scott at netsplit.com
Sat Mar 10 17:58:32 GMT 2007


On Sat, 2007-03-10 at 14:32 -0300, Hervé Fache wrote:

> Probably nothing new, but I suppose this means that partition(s)
> checking needs be done one by one by whatever script is called when a
> new drive is detected?
> 
> Paul said upstart received an event for the drive and not for each
> partition, so that would make things just work with the current
> upstart I suppose. 
> 
Upstart receives whatever events you send it; block device events come
from udev, so it's up to the sysadmin/distro maintainer how they do it.

> I am not an expert, so I wouldn't want to waste your time conjecturing
> on this list though...
> 
It's not a waste of time at all, needs to be solved so it's entirely
profitable :p

One way certainly would be to only react to drive events, and then have
something like this:

	instance
	start on block-device-added *[!0-9]

	script
	    for partition in /sys$DEVPATH/$1[0-9]*
	    do
		NAME=${partition##*/}
		initctl emit partition-added ${partition##*/} \
			-eDEVPATH=${partition%/sys}
	    done
	end script

Then for each partition you could do:

	instance
	start on partition-added

	exec /sbin/fsck "$1"

Each call to "initctl emit" will automatically block until the fsck is
complete; thus providing serial events for partitions.

Scott
-- 
Have you ever, ever felt like this?
Had strange things happen?  Are you going round the twist?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/upstart-devel/attachments/20070310/cd233c70/attachment-0001.pgp 


More information about the upstart-devel mailing list