I'm already doing the start on starting mountall, but while the job is copying the directory some other jobs are processing. I don't know why, but when I do that the system simply stops (possibly triggers a deadlock) and after 2 minutes it says that the task modprobe is not responding for 120 seconds.<br>
<br>I figured that this task might be the module-init-tools, so I did:<br><br>start on (starting mountall or starting module-init-tools)<br><br>With that the system stops locking, but strangely my job runs twice. Is that expected?<br>
<br><div class="gmail_quote">2012/5/10 James Hunt <span dir="ltr"><<a href="mailto:james.hunt@ubuntu.com" target="_blank">james.hunt@ubuntu.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 10/05/12 14:25, Rogerio Vinhal Nunes wrote:<br>
> Hi, I'm trying to make a diskless client with an Ubuntu image booting from a read-only common root<br>
> folder.<br>
><br>
> To do so, we usually mount the /var partition in memory and populates it with the read-only content<br>
> so the services would work. But this seems to be causing some problems due to the copy process<br>
> taking some time while the other jobs are running.<br>
><br>
> Is there a way to run a job before everyone else or making a job to stall all other processes until<br>
> it finishes? Without upstart we did this in the rc.sysinit script that executed before the init scripts.<br>
><br>
> At least an option to make part of the job synchronized would be nice.<br>
><br>
><br>
</div></div>Rogerio,<br>
<br>
If you haven't already done so, I recommend reading the Upstart Cookbook [1].<br>
<br>
For the scenario you describe you can create a job that specifies a 'start on' condition of:<br>
<br>
        start on starting mountall<br>
<br>
That job can mount /var and perform the copy. Crucially, the mountall job will:<br>
<br>
- not run until your /var copy job has finished.<br>
- will not mount /var itself in this scenario since will already be mounted.<br>
<br>
This works because the 'starting' event is a "hook" which blocks. See:<br>
<br>
- <a href="http://upstart.ubuntu.com/cookbook/#event-types" target="_blank">http://upstart.ubuntu.com/cookbook/#event-types</a><br>
- upstart-events(7) or <a href="http://upstart.ubuntu.com/cookbook/#ubuntu-well-known-events-ubuntu-specific" target="_blank">http://upstart.ubuntu.com/cookbook/#ubuntu-well-known-events-ubuntu-specific</a><br>
<br>
Kind regards,<br>
<br>
James.<br>
<br>
[1] - <a href="http://upstart.ubuntu.com/cookbook/" target="_blank">http://upstart.ubuntu.com/cookbook/</a><br>
--<br>
James Hunt<br>
____________________________________<br>
<a href="http://upstart.ubuntu.com/cookbook" target="_blank">http://upstart.ubuntu.com/cookbook</a><br>
<a href="http://upstart.ubuntu.com/cookbook/upstart_cookbook.pdf" target="_blank">http://upstart.ubuntu.com/cookbook/upstart_cookbook.pdf</a><br>
</blockquote></div><br>