Re: How to check for other init systems from sysvinit script

2013-06-01 Thread Michael Stapelberg
Hi Ondřej, Ondřej Surý writes: > Practical question: if I were to support systemd .service, upstart > init job and/or OpenRC together with standard sysvinit > script, how do I check for currently used init system from sysvinit > script to not start the service for a second time? > > Is there som

Re: How to check for other init systems from sysvinit script

2013-05-31 Thread Thomas Goirand
On 05/31/2013 04:39 AM, Ondřej Surý wrote: > Practical question: if I were to support systemd .service, upstart init job > and/or OpenRC FYI, you meant to write OpenRC runscripts. :) On 05/31/2013 05:00 AM, Ben Hutchings wrote: > If I understand correctly, OpenRC doesn't require init to directl

Re: How to check for other init systems from sysvinit script

2013-05-31 Thread Ben Hutchings
On Fri, May 31, 2013 at 05:10:31PM +0200, Ondřej Surý wrote: > On Thu, May 30, 2013 at 11:00 PM, Ben Hutchings wrote: > > > > Is there some material on wiki.d.o I can use (and if not can > > > somebody prepare it)? > > > > What Tollef, you and Steve wrote. > > As you can see, even you (asking t

Re: How to check for other init systems from sysvinit script

2013-05-31 Thread Ondřej Surý
On Thu, May 30, 2013 at 11:00 PM, Ben Hutchings wrote: > > Is there some material on wiki.d.o I can use (and if not can > > somebody prepare it)? > What Tollef, you and Steve wrote. As you can see, even you (asking this question) made a mistake. So I think it would be a good to have a place to

Re: How to check for other init systems from sysvinit script

2013-05-31 Thread Philipp Kern
On Thu, May 30, 2013 at 04:12:45PM -0700, Russ Allbery wrote: > Vincent Bernat writes: > > I still use /etc/init.d/ start by habit and I find it convenient to > > divert to systemd but I have no strong opinion on this. As long as > > upstart jobs mask init scripts when booting, we are fine. >

Re: How to check for other init systems from sysvinit script

2013-05-30 Thread Russ Allbery
Vincent Bernat writes: > I still use /etc/init.d/ start by habit and I find it convenient to > divert to systemd but I have no strong opinion on this. As long as > upstart jobs mask init scripts when booting, we are fine. Completely independent of the discussion in this thread, I encourage y

Re: How to check for other init systems from sysvinit script

2013-05-30 Thread Vincent Bernat
❦ 30 mai 2013 23:47 CEST, Steve Langasek  : >> > No, it won't. What it will do is provide a shell function you can call to >> > check if init is upstart, and if so, neuter your init script: > >> > if init_is_upstart; then >> > exit 1 >> > fi > >> > Doing this automatically by including /

Re: How to check for other init systems from sysvinit script

2013-05-30 Thread Steve Langasek
On Thu, May 30, 2013 at 10:41:56PM +0100, Ben Hutchings wrote: > On Thu, May 30, 2013 at 02:07:10PM -0700, Steve Langasek wrote: > > On Thu, May 30, 2013 at 10:00:40PM +0100, Ben Hutchings wrote: > > > On Thu, May 30, 2013 at 10:39:55PM +0200, Ondřej Surý wrote: > > > > Practical question: if I wer

Re: How to check for other init systems from sysvinit script

2013-05-30 Thread Steve Langasek
On Thu, May 30, 2013 at 11:36:42PM +0200, Vincent Bernat wrote: > ❦ 30 mai 2013 23:07 CEST, Steve Langasek  : > >> . /lib/lsb/init-functions > >> (Which should be near the top of your init script already.) > >> This will automagically invoke systemd or upstart if appropriate. > > No, it won't.

Re: How to check for other init systems from sysvinit script

2013-05-30 Thread Ben Hutchings
On Thu, May 30, 2013 at 02:07:10PM -0700, Steve Langasek wrote: > On Thu, May 30, 2013 at 10:00:40PM +0100, Ben Hutchings wrote: > > On Thu, May 30, 2013 at 10:39:55PM +0200, Ondřej Surý wrote: > > > Practical question: if I were to support systemd .service, upstart > > > init job and/or OpenRC to

Re: How to check for other init systems from sysvinit script

2013-05-30 Thread Vincent Bernat
❦ 30 mai 2013 23:07 CEST, Steve Langasek  : >> . /lib/lsb/init-functions > >> (Which should be near the top of your init script already.) >> This will automagically invoke systemd or upstart if appropriate. > > No, it won't. What it will do is provide a shell function you can call to > check if

Re: How to check for other init systems from sysvinit script

2013-05-30 Thread Steve Langasek
On Thu, May 30, 2013 at 10:00:40PM +0100, Ben Hutchings wrote: > On Thu, May 30, 2013 at 10:39:55PM +0200, Ondřej Surý wrote: > > Practical question: if I were to support systemd .service, upstart > > init job and/or OpenRC together with standard sysvinit > > script, how do I check for currently u

Re: How to check for other init systems from sysvinit script

2013-05-30 Thread Ben Hutchings
On Thu, May 30, 2013 at 10:39:55PM +0200, Ondřej Surý wrote: > Practical question: if I were to support systemd .service, upstart > init job and/or OpenRC together with standard sysvinit > script, how do I check for currently used init system from sysvinit > script to not start the service for a s

Re: How to check for other init systems from sysvinit script

2013-05-30 Thread Tollef Fog Heen
]] Ondřej Surý > Practical question: if I were to support systemd .service, upstart > init job and/or OpenRC together with standard sysvinit > script, how do I check for currently used init system from sysvinit > script to not start the service for a second time? With systemd, as long as the in

How to check for other init systems from sysvinit script

2013-05-30 Thread Ondřej Surý
Practical question: if I were to support systemd .service, upstart init job and/or OpenRC together with standard sysvinit script, how do I check for currently used init system from sysvinit script to not start the service for a second time? Is there some material on wiki.d.o I can use (and if