Hi James!<div><br></div><div>Using another source of help I figured out almost same solution.</div><div><br></div><div>Anyway thanks a lot for reply</div><div> <br><br><div class="gmail_quote">On Thu, Oct 27, 2011 at 4:56 PM, James Hunt <span dir="ltr"><<a href="mailto:james.hunt@ubuntu.com">james.hunt@ubuntu.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Vasyl,<br>
<div class="im"><br>
On 26/10/11 12:34, Vasyl Zuzyak wrote:<br>
> Hi all!<br>
><br>
> I am trying to write custom service that runs ruby script. Everything is seems to be ok except<br>
> condition/event which triggers actual start<br>
><br>
> I use following condition:<br>
><br>
> start on started apache2<br>
><br>
> When I run check-config it says following:<br>
><br>
> root@vv-Latitude-E5520:/etc/init# initctl check-config http-log-monitor<br>
> http-log-monitor<br>
> start on: unknown job apache2<br>
> stop on: unknown job apache2<br>
> root@vv-Latitude-E5520:/etc/init#<br>
><br>
> However when I run<br>
><br>
> initctl emit started JOB=apache2<br>
</div>That's not the same as starting a job :) What the check-config command is telling you is that there<br>
is no /etc/init/apache2.conf on your system.<br>
<br>
Unless xubuntu have changed the package, I think you'll find that "apache2" is still a SysV job<br>
(/etc/init.d/apache2). With help from the community, we'd like to change that situation by<br>
converting all SysV services in the main archive to Upstart jobs:<br>
<br>
<a href="https://blueprints.launchpad.net/ubuntu/+spec/foundations-p-upstart-convert-main-initd-to-jobs" target="_blank">https://blueprints.launchpad.net/ubuntu/+spec/foundations-p-upstart-convert-main-initd-to-jobs</a><br>
<br>
What we could even if that does happen this cycle is to modify "/etc/init.d/rc" so that it calls the<br>
following immediately before and immediately after each SysV job is started:<br>
<br>
initctl emit starting JOB=<Sys5_service_name><br>
initctl emit started JOB=<Sys5_service_name><br>
<br>
(we'd apply the same logic for stopping SysV jobs too of course). It's crude, but it would allow<br>
better integration between Upstart and "the legacy world".<br>
<br>
For now, I'd suggest you change your http-log-monitor job so that it specifies:<br>
<br>
start on started rc<br>
<br>
That will guarantee that all the SysV jobs have started for the runlevel in question. One warning:<br>
due to limitations in the SysV system, some services background themselves to give the illusion<br>
they've started when actually they are not "ready".<br>
<br>
Kind regards,<br>
<br>
James.<br>
<font color="#888888">--<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>
</font></blockquote></div><br><br clear="all"><div><br></div>-- <br>Vasyl<br>
</div>