On 10/05/12 14:25, Rogerio Vinhal Nunes wrote:
> Hi, I'm trying to make a diskless client with an Ubuntu image booting from a 
> read-only common root
> folder.
> 
> To do so, we usually mount the /var partition in memory and populates it with 
> the read-only content
> so the services would work. But this seems to be causing some problems due to 
> the copy process
> taking some time while the other jobs are running.
> 
> Is there a way to run a job before everyone else or making a job to stall all 
> other processes until
> it finishes? Without upstart we did this in the rc.sysinit script that 
> executed before the init scripts.
> 
> At least an option to make part of the job synchronized would be nice.
> 
> 
Rogerio,

If you haven't already done so, I recommend reading the Upstart Cookbook [1].

For the scenario you describe you can create a job that specifies a 'start on' 
condition of:

        start on starting mountall

That job can mount /var and perform the copy. Crucially, the mountall job will:

- not run until your /var copy job has finished.
- will not mount /var itself in this scenario since will already be mounted.

This works because the 'starting' event is a "hook" which blocks. See:

- http://upstart.ubuntu.com/cookbook/#event-types
- upstart-events(7) or 
http://upstart.ubuntu.com/cookbook/#ubuntu-well-known-events-ubuntu-specific

Kind regards,

James.

[1] - http://upstart.ubuntu.com/cookbook/
--
James Hunt
____________________________________
http://upstart.ubuntu.com/cookbook
http://upstart.ubuntu.com/cookbook/upstart_cookbook.pdf

-- 
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/upstart-devel

Reply via email to