Re: [systemd-devel] Why does sysv generator translate Required-Start keyword into an After= ordering dep only ?

2016-03-10 Thread Andrei Borzenkov
10.03.2016 18:05, Francis Moreau пишет:
> On Tue, Mar 8, 2016 at 10:19 AM, Andrei Borzenkov  wrote:
>> 08.03.2016 11:33, Francis Moreau пишет:
>>> On Tue, Mar 8, 2016 at 9:23 AM, Andrei Borzenkov  
>>> wrote:
 08.03.2016 11:07, Francis Moreau пишет:
> On Tue, Mar 8, 2016 at 7:51 AM, Andrei Borzenkov  
> wrote:
>> 07.03.2016 10:04, Francis Moreau пишет:
>>> Hello,
>>>
>>> Sorry for the long delay.
>>>
>>> On Fri, Feb 26, 2016 at 5:05 AM, Andrei Borzenkov  
>>> wrote:
 26.02.2016 00:55, Francis Moreau пишет:
>
> But now I'm wondering how the following case is handled: a sysinit
> script "a" has "Required-Start: b". But "b" is a native systemd
> service. I don't think the tool that enable/disable sysv services can
> enable and order correctly the native service.
>

 What difference does it make?
>>>
>>> The difference is that in my current understanding nothing will pull 
>>> "b" in.
>>
>> That was answered in part you trimmed off. sysvinit never actively
>> pulled "b" in either so nothing really changed here.
>>
>
> In my understanding insserv is part of the sysvinit implementation.
>
> Therefore to enable a service with sysvinit, we do:
>
>  - insserv a (this will create Sa *and* Sb" with yy < xx)

 That would be new to me. insserv creates links ("enables") exactly those
 services that you specify. So if you say "insserv a" you will get only
 "a" enabled; this /may/ rearrange other services including "b" if they
 are already enabled but this will not enable "b".

>>>
>>> That's how I understood Lennart's excerpt I was referring to previously.
>>>
>>
>> Hmm ... I tested on SLES11 and indeed, while "insserv a" will not enable
>> "b" it will refuse to enable "a" if "b" is not enabled. And conversely
>> it will not disable "b" if "a" is enabled.
>>
>> So at least it tries to ensure that set of enabled services is consistent.
> 
> Is this system uses systemd ?
> 

No; it is too old for this. It is classical sysvinit.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Why does sysv generator translate Required-Start keyword into an After= ordering dep only ?

2016-03-10 Thread Francis Moreau
On Tue, Mar 8, 2016 at 10:19 AM, Andrei Borzenkov  wrote:
> 08.03.2016 11:33, Francis Moreau пишет:
>> On Tue, Mar 8, 2016 at 9:23 AM, Andrei Borzenkov  wrote:
>>> 08.03.2016 11:07, Francis Moreau пишет:
 On Tue, Mar 8, 2016 at 7:51 AM, Andrei Borzenkov  
 wrote:
> 07.03.2016 10:04, Francis Moreau пишет:
>> Hello,
>>
>> Sorry for the long delay.
>>
>> On Fri, Feb 26, 2016 at 5:05 AM, Andrei Borzenkov  
>> wrote:
>>> 26.02.2016 00:55, Francis Moreau пишет:

 But now I'm wondering how the following case is handled: a sysinit
 script "a" has "Required-Start: b". But "b" is a native systemd
 service. I don't think the tool that enable/disable sysv services can
 enable and order correctly the native service.

>>>
>>> What difference does it make?
>>
>> The difference is that in my current understanding nothing will pull "b" 
>> in.
>
> That was answered in part you trimmed off. sysvinit never actively
> pulled "b" in either so nothing really changed here.
>

 In my understanding insserv is part of the sysvinit implementation.

 Therefore to enable a service with sysvinit, we do:

  - insserv a (this will create Sa *and* Sb" with yy < xx)
>>>
>>> That would be new to me. insserv creates links ("enables") exactly those
>>> services that you specify. So if you say "insserv a" you will get only
>>> "a" enabled; this /may/ rearrange other services including "b" if they
>>> are already enabled but this will not enable "b".
>>>
>>
>> That's how I understood Lennart's excerpt I was referring to previously.
>>
>
> Hmm ... I tested on SLES11 and indeed, while "insserv a" will not enable
> "b" it will refuse to enable "a" if "b" is not enabled. And conversely
> it will not disable "b" if "a" is enabled.
>
> So at least it tries to ensure that set of enabled services is consistent.

Is this system uses systemd ?

-- 
Francis
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Why does sysv generator translate Required-Start keyword into an After= ordering dep only ?

2016-03-08 Thread Andrei Borzenkov
08.03.2016 11:33, Francis Moreau пишет:
> On Tue, Mar 8, 2016 at 9:23 AM, Andrei Borzenkov  wrote:
>> 08.03.2016 11:07, Francis Moreau пишет:
>>> On Tue, Mar 8, 2016 at 7:51 AM, Andrei Borzenkov  
>>> wrote:
 07.03.2016 10:04, Francis Moreau пишет:
> Hello,
>
> Sorry for the long delay.
>
> On Fri, Feb 26, 2016 at 5:05 AM, Andrei Borzenkov  
> wrote:
>> 26.02.2016 00:55, Francis Moreau пишет:
>>>
>>> But now I'm wondering how the following case is handled: a sysinit
>>> script "a" has "Required-Start: b". But "b" is a native systemd
>>> service. I don't think the tool that enable/disable sysv services can
>>> enable and order correctly the native service.
>>>
>>
>> What difference does it make?
>
> The difference is that in my current understanding nothing will pull "b" 
> in.

 That was answered in part you trimmed off. sysvinit never actively
 pulled "b" in either so nothing really changed here.

>>>
>>> In my understanding insserv is part of the sysvinit implementation.
>>>
>>> Therefore to enable a service with sysvinit, we do:
>>>
>>>  - insserv a (this will create Sa *and* Sb" with yy < xx)
>>
>> That would be new to me. insserv creates links ("enables") exactly those
>> services that you specify. So if you say "insserv a" you will get only
>> "a" enabled; this /may/ rearrange other services including "b" if they
>> are already enabled but this will not enable "b".
>>
> 
> That's how I understood Lennart's excerpt I was referring to previously.
> 

Hmm ... I tested on SLES11 and indeed, while "insserv a" will not enable
"b" it will refuse to enable "a" if "b" is not enabled. And conversely
it will not disable "b" if "a" is enabled.

So at least it tries to ensure that set of enabled services is consistent.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Why does sysv generator translate Required-Start keyword into an After= ordering dep only ?

2016-03-08 Thread Francis Moreau
On Tue, Mar 8, 2016 at 9:23 AM, Andrei Borzenkov  wrote:
> 08.03.2016 11:07, Francis Moreau пишет:
>> On Tue, Mar 8, 2016 at 7:51 AM, Andrei Borzenkov  wrote:
>>> 07.03.2016 10:04, Francis Moreau пишет:
 Hello,

 Sorry for the long delay.

 On Fri, Feb 26, 2016 at 5:05 AM, Andrei Borzenkov  
 wrote:
> 26.02.2016 00:55, Francis Moreau пишет:
>>
>> But now I'm wondering how the following case is handled: a sysinit
>> script "a" has "Required-Start: b". But "b" is a native systemd
>> service. I don't think the tool that enable/disable sysv services can
>> enable and order correctly the native service.
>>
>
> What difference does it make?

 The difference is that in my current understanding nothing will pull "b" 
 in.
>>>
>>> That was answered in part you trimmed off. sysvinit never actively
>>> pulled "b" in either so nothing really changed here.
>>>
>>
>> In my understanding insserv is part of the sysvinit implementation.
>>
>> Therefore to enable a service with sysvinit, we do:
>>
>>  - insserv a (this will create Sa *and* Sb" with yy < xx)
>
> That would be new to me. insserv creates links ("enables") exactly those
> services that you specify. So if you say "insserv a" you will get only
> "a" enabled; this /may/ rearrange other services including "b" if they
> are already enabled but this will not enable "b".
>

That's how I understood Lennart's excerpt I was referring to previously.

-- 
Francis
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Why does sysv generator translate Required-Start keyword into an After= ordering dep only ?

2016-03-08 Thread Andrei Borzenkov
08.03.2016 11:07, Francis Moreau пишет:
> On Tue, Mar 8, 2016 at 7:51 AM, Andrei Borzenkov  wrote:
>> 07.03.2016 10:04, Francis Moreau пишет:
>>> Hello,
>>>
>>> Sorry for the long delay.
>>>
>>> On Fri, Feb 26, 2016 at 5:05 AM, Andrei Borzenkov  
>>> wrote:
 26.02.2016 00:55, Francis Moreau пишет:
>
> But now I'm wondering how the following case is handled: a sysinit
> script "a" has "Required-Start: b". But "b" is a native systemd
> service. I don't think the tool that enable/disable sysv services can
> enable and order correctly the native service.
>

 What difference does it make?
>>>
>>> The difference is that in my current understanding nothing will pull "b" in.
>>
>> That was answered in part you trimmed off. sysvinit never actively
>> pulled "b" in either so nothing really changed here.
>>
> 
> In my understanding insserv is part of the sysvinit implementation.
> 
> Therefore to enable a service with sysvinit, we do:
> 
>  - insserv a (this will create Sa *and* Sb" with yy < xx)

That would be new to me. insserv creates links ("enables") exactly those
services that you specify. So if you say "insserv a" you will get only
"a" enabled; this /may/ rearrange other services including "b" if they
are already enabled but this will not enable "b".

>  - init will start *both* a and b
> 
> However with systemd and 'b' being a native unit:
> 
>  - insserv a (this will create Sa only)
>  - systemd will only start a
> 

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Why does sysv generator translate Required-Start keyword into an After= ordering dep only ?

2016-03-08 Thread Francis Moreau
On Tue, Mar 8, 2016 at 7:51 AM, Andrei Borzenkov  wrote:
> 07.03.2016 10:04, Francis Moreau пишет:
>> Hello,
>>
>> Sorry for the long delay.
>>
>> On Fri, Feb 26, 2016 at 5:05 AM, Andrei Borzenkov  
>> wrote:
>>> 26.02.2016 00:55, Francis Moreau пишет:

 But now I'm wondering how the following case is handled: a sysinit
 script "a" has "Required-Start: b". But "b" is a native systemd
 service. I don't think the tool that enable/disable sysv services can
 enable and order correctly the native service.

>>>
>>> What difference does it make?
>>
>> The difference is that in my current understanding nothing will pull "b" in.
>
> That was answered in part you trimmed off. sysvinit never actively
> pulled "b" in either so nothing really changed here.
>

In my understanding insserv is part of the sysvinit implementation.

Therefore to enable a service with sysvinit, we do:

 - insserv a (this will create Sa *and* Sb" with yy < xx)
 - init will start *both* a and b

However with systemd and 'b' being a native unit:

 - insserv a (this will create Sa only)
 - systemd will only start a

-- 
Francis
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Why does sysv generator translate Required-Start keyword into an After= ordering dep only ?

2016-03-07 Thread Andrei Borzenkov
07.03.2016 10:04, Francis Moreau пишет:
> Hello,
> 
> Sorry for the long delay.
> 
> On Fri, Feb 26, 2016 at 5:05 AM, Andrei Borzenkov  wrote:
>> 26.02.2016 00:55, Francis Moreau пишет:
>>>
>>> But now I'm wondering how the following case is handled: a sysinit
>>> script "a" has "Required-Start: b". But "b" is a native systemd
>>> service. I don't think the tool that enable/disable sysv services can
>>> enable and order correctly the native service.
>>>
>>
>> What difference does it make?
> 
> The difference is that in my current understanding nothing will pull "b" in.

That was answered in part you trimmed off. sysvinit never actively
pulled "b" in either so nothing really changed here.

> 
> Indeed "a" will have "After=b" ordering dep but that's not sufficient
> to start "b". And since "b" is native it will not have a "SXXb"
> installed by insserv.
> 
> 
> Thanks.
> 

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Why does sysv generator translate Required-Start keyword into an After= ordering dep only ?

2016-03-07 Thread Francis Moreau
On Mon, Mar 7, 2016 at 2:13 PM, Lukáš Nykrýn  wrote:
> Francis Moreau píše v Po 07. 03. 2016 v 08:04 +0100:
>> Hello,
>>
>> Sorry for the long delay.
>>
>> On Fri, Feb 26, 2016 at 5:05 AM, Andrei Borzenkov <
>> arvidj...@gmail.com> wrote:
>> > 26.02.2016 00:55, Francis Moreau пишет:
>> > >
>> > > But now I'm wondering how the following case is handled: a
>> > > sysinit
>> > > script "a" has "Required-Start: b". But "b" is a native systemd
>> > > service. I don't think the tool that enable/disable sysv services
>> > > can
>> > > enable and order correctly the native service.
>> > >
>> >
>> > What difference does it make?
>>
>> The difference is that in my current understanding nothing will pull
>> "b" in.
>>
>> Indeed "a" will have "After=b" ordering dep but that's not sufficient
>> to start "b". And since "b" is native it will not have a "SXXb"
>> installed by insserv.
>
> IIRC the behavior is still the same as it always was. Chkconfig on (at
> least rhel-based systems) did not enable the dependencies for the
> service. It only assured that the services will be started in the
> correct order.

That doesnt seem to match what Lennart said previously:

"""
Well, on SysV the requirement in the "Required-Start:" concept is
actually a request to the tool that enables/disables a service
(i.e. the chkconfig or update-rcd tool, depending on the distro). It
means that it shall enable another service "b" if "a" is to be
enabled.
"""

Thanks.
-- 
Francis
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Why does sysv generator translate Required-Start keyword into an After= ordering dep only ?

2016-03-07 Thread Lukáš Nykrýn
Francis Moreau píše v Po 07. 03. 2016 v 08:04 +0100:
> Hello,
> 
> Sorry for the long delay.
> 
> On Fri, Feb 26, 2016 at 5:05 AM, Andrei Borzenkov <
> arvidj...@gmail.com> wrote:
> > 26.02.2016 00:55, Francis Moreau пишет:
> > > 
> > > But now I'm wondering how the following case is handled: a
> > > sysinit
> > > script "a" has "Required-Start: b". But "b" is a native systemd
> > > service. I don't think the tool that enable/disable sysv services
> > > can
> > > enable and order correctly the native service.
> > > 
> > 
> > What difference does it make?
> 
> The difference is that in my current understanding nothing will pull
> "b" in.
> 
> Indeed "a" will have "After=b" ordering dep but that's not sufficient
> to start "b". And since "b" is native it will not have a "SXXb"
> installed by insserv.

IIRC the behavior is still the same as it always was. Chkconfig on (at
least rhel-based systems) did not enable the dependencies for the
service. It only assured that the services will be started in the
correct order.

The only script that cared about enabled dependencies was the
install_initd, which refused to install the initscript if its
requirements were not met.

If you want that behavior to change you should file a RFE to your
chkconfig/install_initd/systemd-sysv-install implementation.

Lukas
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Why does sysv generator translate Required-Start keyword into an After= ordering dep only ?

2016-03-06 Thread Francis Moreau
Hello,

Sorry for the long delay.

On Fri, Feb 26, 2016 at 5:05 AM, Andrei Borzenkov  wrote:
> 26.02.2016 00:55, Francis Moreau пишет:
>>
>> But now I'm wondering how the following case is handled: a sysinit
>> script "a" has "Required-Start: b". But "b" is a native systemd
>> service. I don't think the tool that enable/disable sysv services can
>> enable and order correctly the native service.
>>
>
> What difference does it make?

The difference is that in my current understanding nothing will pull "b" in.

Indeed "a" will have "After=b" ordering dep but that's not sufficient
to start "b". And since "b" is native it will not have a "SXXb"
installed by insserv.


Thanks.
-- 
Francis
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Why does sysv generator translate Required-Start keyword into an After= ordering dep only ?

2016-02-25 Thread Andrei Borzenkov
26.02.2016 00:55, Francis Moreau пишет:
> On Wed, Feb 24, 2016 at 6:12 PM, Lennart Poettering
>  wrote:
>> On Wed, 24.02.16 17:40, Francis Moreau (francis.m...@gmail.com) wrote:
>>
>>> Hello,
>>>
>>> It seems that the unit generator for sysv init scripts translate
>>> "Required-Start: X" into "After=X" native ordering deps only.
>>>
>>> I would also have expected it to add the following dependency "Requires=X" 
>>> too.
>>>
>>> What am I missing ?
>>
>> Well, on SysV the requirement in the "Required-Start:" concept is
>> actually a request to the tool that enables/disables a service
>> (i.e. the chkconfig or update-rcd tool, depending on the distro). It
>> means that it shall enable another service "b" if "a" is to be
>> enabled.
> 
> "mbiebl" on #debian-systemd gave me the same explanation (thanks to him).
> 
> However beside enabling service "b", the tool will also enable it so
> that "b" will be started by sysvinit before service "a"
> 

That is ensured in case if systemd by After=b in a.
...

> 
> But now I'm wondering how the following case is handled: a sysinit
> script "a" has "Required-Start: b". But "b" is a native systemd
> service. I don't think the tool that enable/disable sysv services can
> enable and order correctly the native service.
> 

What difference does it make? a will still have After=b, and sysvinit
never had any run-time check whether b is actually started or not
anyway. So we are just as good with systemd here - if b is configured to
be started, it will be started before a.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Why does sysv generator translate Required-Start keyword into an After= ordering dep only ?

2016-02-25 Thread Francis Moreau
On Wed, Feb 24, 2016 at 6:12 PM, Lennart Poettering
 wrote:
> On Wed, 24.02.16 17:40, Francis Moreau (francis.m...@gmail.com) wrote:
>
>> Hello,
>>
>> It seems that the unit generator for sysv init scripts translate
>> "Required-Start: X" into "After=X" native ordering deps only.
>>
>> I would also have expected it to add the following dependency "Requires=X" 
>> too.
>>
>> What am I missing ?
>
> Well, on SysV the requirement in the "Required-Start:" concept is
> actually a request to the tool that enables/disables a service
> (i.e. the chkconfig or update-rcd tool, depending on the distro). It
> means that it shall enable another service "b" if "a" is to be
> enabled.

"mbiebl" on #debian-systemd gave me the same explanation (thanks to him).

However beside enabling service "b", the tool will also enable it so
that "b" will be started by sysvinit before service "a"

>
> Requires= in systemd otoh is something that applies to the actual
> activation time of a service. The counterpart of "Required-Start:" in
> systemd concepts would actually be the Also= line in [Install], if you
> follow what I mean.

hmm but Also= doesn't have the notion of ordering, I think.

>
> systemd leaves enabling/disabling of sysv services to
> chkconfig/update-rcd hence it will not act on that line regarding
> requirement. It will however act on the ordering, since that's
> inherently something systemd itself cares about.
>
> Hope that makes sense?
>

Yes Thanks.

But now I'm wondering how the following case is handled: a sysinit
script "a" has "Required-Start: b". But "b" is a native systemd
service. I don't think the tool that enable/disable sysv services can
enable and order correctly the native service.
-- 
Francis
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Why does sysv generator translate Required-Start keyword into an After= ordering dep only ?

2016-02-24 Thread Lennart Poettering
On Wed, 24.02.16 17:40, Francis Moreau (francis.m...@gmail.com) wrote:

> Hello,
> 
> It seems that the unit generator for sysv init scripts translate
> "Required-Start: X" into "After=X" native ordering deps only.
> 
> I would also have expected it to add the following dependency "Requires=X" 
> too.
> 
> What am I missing ?

Well, on SysV the requirement in the "Required-Start:" concept is
actually a request to the tool that enables/disables a service
(i.e. the chkconfig or update-rcd tool, depending on the distro). It
means that it shall enable another service "b" if "a" is to be
enabled.

Requires= in systemd otoh is something that applies to the actual
activation time of a service. The counterpart of "Required-Start:" in
systemd concepts would actually be the Also= line in [Install], if you
follow what I mean.

systemd leaves enabling/disabling of sysv services to
chkconfig/update-rcd hence it will not act on that line regarding
requirement. It will however act on the ordering, since that's
inherently something systemd itself cares about.

Hope that makes sense?

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Why does sysv generator translate Required-Start keyword into an After= ordering dep only ?

2016-02-24 Thread Francis Moreau
Hello,

It seems that the unit generator for sysv init scripts translate
"Required-Start: X" into "After=X" native ordering deps only.

I would also have expected it to add the following dependency "Requires=X" too.

What am I missing ?

Thanks.
-- 
Francis
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel