apache as dependency
James Hunt
james.hunt at ubuntu.com
Thu Oct 27 13:56:00 UTC 2011
Hi Vasyl,
On 26/10/11 12:34, Vasyl Zuzyak wrote:
> Hi all!
>
> I am trying to write custom service that runs ruby script. Everything is seems to be ok except
> condition/event which triggers actual start
>
> I use following condition:
>
> start on started apache2
>
> When I run check-config it says following:
>
> root at vv-Latitude-E5520:/etc/init# initctl check-config http-log-monitor
> http-log-monitor
> start on: unknown job apache2
> stop on: unknown job apache2
> root at vv-Latitude-E5520:/etc/init#
>
> However when I run
>
> initctl emit started JOB=apache2
That's not the same as starting a job :) What the check-config command is telling you is that there
is no /etc/init/apache2.conf on your system.
Unless xubuntu have changed the package, I think you'll find that "apache2" is still a SysV job
(/etc/init.d/apache2). With help from the community, we'd like to change that situation by
converting all SysV services in the main archive to Upstart jobs:
https://blueprints.launchpad.net/ubuntu/+spec/foundations-p-upstart-convert-main-initd-to-jobs
What we could even if that does happen this cycle is to modify "/etc/init.d/rc" so that it calls the
following immediately before and immediately after each SysV job is started:
initctl emit starting JOB=<Sys5_service_name>
initctl emit started JOB=<Sys5_service_name>
(we'd apply the same logic for stopping SysV jobs too of course). It's crude, but it would allow
better integration between Upstart and "the legacy world".
For now, I'd suggest you change your http-log-monitor job so that it specifies:
start on started rc
That will guarantee that all the SysV jobs have started for the runlevel in question. One warning:
due to limitations in the SysV system, some services background themselves to give the illusion
they've started when actually they are not "ready".
Kind regards,
James.
--
James Hunt
____________________________________
http://upstart.ubuntu.com/cookbook
http://upstart.ubuntu.com/cookbook/upstart_cookbook.pdf
More information about the upstart-devel
mailing list