The startup-event worked fine, thanks! :)<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="im">On 10/05/12 17:24, Rogerio Vinhal Nunes wrote:<br>
> I'm already doing the start on starting mountall, but while the job is copying the directory some<br>
> other jobs are processing. I don't know why, but when I do that the system simply stops (possibly<br>
> triggers a deadlock) and after 2 minutes it says that the task modprobe is not responding for 120<br>
> 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>
</div>Yes: <a href="http://upstart.ubuntu.com/cookbook/#run-a-job-for-all-of-a-number-of-conditions" target="_blank">http://upstart.ubuntu.com/cookbook/#run-a-job-for-all-of-a-number-of-conditions</a><br>
<br>
The way to have your job start before *any* other is to use 'and' and specify all the jobs that<br>
'start on startup'. To determine that list of jobs:<br>
<br>
initctl show-config -e|egrep -v "\<emits\>"|grep -B1 " start on startup"|egrep -v "(start on|^--)"<br>
<br>
However it might be easier and simpler to start your system with Upstart by adding the following to<br>
the kernel command-line:<br>
<br>
--startup-event=foo<br>
<br>
...and then having your job do:<br>
<br>
start on foo<br>
emits startup<br>
<br>
script<br>
# copy /var here.<br>
end script<br>
<br>
post-stop script<br>
# kick off the rest of the system<br>
initctl emit startup<br>
end script<br>
<br>
This is in fact essentially what friendly-recovery does in recent versions on Ubuntu.<br>
<br>
See: <a href="http://upstart.ubuntu.com/cookbook/#command-line-options" target="_blank">http://upstart.ubuntu.com/cookbook/#command-line-options</a><br>
<br>
Kind regards,<br>
<br>
James.<br>
<div class="HOEnZb"><div class="h5">--<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>
</div></div></blockquote></div><br>