Re: [systemd-devel] Service not restarting after Condition failed

2014-12-02 Thread D.S. Ljungmark
On 01/12/14 01:20, Lennart Poettering wrote:
> On Mon, 24.11.14 20:02, D.S. Ljungmark (spi...@aanstoot.se) wrote:
> 
>> Basically, some files (config & certificates) may not exist on a system
>> until it's provisioned properly, something that may take a while ( a few
>> days)
>>
>> After provisioning, we want the services depending on those file to
>> start automatically.
> 
> I'd be really careful with schemes like this. What is "after
> provisioning" supposed to mean? When precisely do you want to start
> those services? After the first file is in the process of being copied
> in? After all files are copied in and the copying is complete? If so
> how do you detect "all"? How do you detect "copying is complete"?
> 
> .path units can be used for this, but they require a strict regime how
> precisely the files are dropped in, for example atomically via rename,
> and which file is the last one.

Okay, that makes sense.   That sort of thing has to be done carefully
anyhow, just to make sure it's a habit.


//D.S.

-- 
8362 CB14 98AD 11EF CEB6  FA81 FCC3 7674 449E 3CFC



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Service not restarting after Condition failed

2014-11-30 Thread Lennart Poettering
On Mon, 24.11.14 20:02, D.S. Ljungmark (spi...@aanstoot.se) wrote:

> Basically, some files (config & certificates) may not exist on a system
> until it's provisioned properly, something that may take a while ( a few
> days)
> 
> After provisioning, we want the services depending on those file to
> start automatically.

I'd be really careful with schemes like this. What is "after
provisioning" supposed to mean? When precisely do you want to start
those services? After the first file is in the process of being copied
in? After all files are copied in and the copying is complete? If so
how do you detect "all"? How do you detect "copying is complete"?

.path units can be used for this, but they require a strict regime how
precisely the files are dropped in, for example atomically via rename,
and which file is the last one.

Lennart

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


Re: [systemd-devel] Service not restarting after Condition failed

2014-11-30 Thread Umut Tezduyar Lindskog
On Tue, Nov 25, 2014 at 2:38 PM, D.S. Ljungmark  wrote:
> On 24/11/14 20:30, Umut Tezduyar Lindskog wrote:
>> Hi
>>
>> On Monday, November 24, 2014, D.S. Ljungmark > > wrote:
>>
>> On 10/11/14 23:09, Lennart Poettering wrote:
>> > On Thu, 30.10.14 18:47, D.S. Ljungmark (spi...@aanstoot.se
>> ) wrote:
>> >
>> >> Hi
>> >>  we have a service set to:
>> >> ConditionFileNotEmpty=
>> >>
>> >> and
>> >>
>> >> Restart=Always
>> >>
>> >>
>> >> This combination would (in my feebled mind) cause the service to
>> restart
>> >> once the Condition was fulfilled, but that doesn't seem to be the
>> >> case.
>> >
>> > Conditions are something that are on-time evaluated right before we
>> > would start a unit, and cause this starting to be shortcut. That's all
>> > really. Restarts are only triggered when a running service dies, and
>> > the start job queued by that will then check the conditions again. If
>> > the condition doesn't hold then this start will not be executed, and
>> > hence no restart ever again either...
>> >
>> >> Is there a way I can get a service to restart even after it has
>> been set
>> >> as inactive (dead) "start condition failed"?
>> >
>> > Nope, conditions are not for that. For the specific check of
>> > file-not-empty there's no nice way to handle this, however for
>> > directory-not-empty you could set up DirectoryNotEmpty=...
>> >
>> >> Should I simply remove the Condition, or something else?
>> >
>> > What precisely are you trying to do?
>> >
>> > Lennart
>>
>> Basically, some files (config & certificates) may not exist on a system
>> until it's provisioned properly, something that may take a while ( a few
>> days)
>>
>> After provisioning, we want the services depending on those file to
>> start automatically.
>>
>>
>> Path unit files should work for
>> you,  http://www.freedesktop.org/software/systemd/man/systemd.path.html
>>
>> Umut
>
> Thanks, those would work well. I take it those should be in combination
> to the ConditionFileNotEmpty=  for the same files?

I believe you need to use ConditionFileNotEmpty=. Did it work out for you?

Umut

>
>
>
> //D.S.
>
>
> --
> 8362 CB14 98AD 11EF CEB6  FA81 FCC3 7674 449E 3CFC
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Service not restarting after Condition failed

2014-11-25 Thread D.S. Ljungmark
On 24/11/14 20:30, Umut Tezduyar Lindskog wrote:
> Hi
> 
> On Monday, November 24, 2014, D.S. Ljungmark  > wrote:
> 
> On 10/11/14 23:09, Lennart Poettering wrote:
> > On Thu, 30.10.14 18:47, D.S. Ljungmark (spi...@aanstoot.se
> ) wrote:
> >
> >> Hi
> >>  we have a service set to:
> >> ConditionFileNotEmpty=
> >>
> >> and
> >>
> >> Restart=Always
> >>
> >>
> >> This combination would (in my feebled mind) cause the service to
> restart
> >> once the Condition was fulfilled, but that doesn't seem to be the
> >> case.
> >
> > Conditions are something that are on-time evaluated right before we
> > would start a unit, and cause this starting to be shortcut. That's all
> > really. Restarts are only triggered when a running service dies, and
> > the start job queued by that will then check the conditions again. If
> > the condition doesn't hold then this start will not be executed, and
> > hence no restart ever again either...
> >
> >> Is there a way I can get a service to restart even after it has
> been set
> >> as inactive (dead) "start condition failed"?
> >
> > Nope, conditions are not for that. For the specific check of
> > file-not-empty there's no nice way to handle this, however for
> > directory-not-empty you could set up DirectoryNotEmpty=...
> >
> >> Should I simply remove the Condition, or something else?
> >
> > What precisely are you trying to do?
> >
> > Lennart
> 
> Basically, some files (config & certificates) may not exist on a system
> until it's provisioned properly, something that may take a while ( a few
> days)
> 
> After provisioning, we want the services depending on those file to
> start automatically.
> 
>  
> Path unit files should work for
> you,  http://www.freedesktop.org/software/systemd/man/systemd.path.html
> 
> Umut

Thanks, those would work well. I take it those should be in combination
to the ConditionFileNotEmpty=  for the same files?



//D.S.


-- 
8362 CB14 98AD 11EF CEB6  FA81 FCC3 7674 449E 3CFC



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Service not restarting after Condition failed

2014-11-24 Thread Umut Tezduyar Lindskog
Hi

On Monday, November 24, 2014, D.S. Ljungmark  wrote:

> On 10/11/14 23:09, Lennart Poettering wrote:
> > On Thu, 30.10.14 18:47, D.S. Ljungmark (spi...@aanstoot.se
> ) wrote:
> >
> >> Hi
> >>  we have a service set to:
> >> ConditionFileNotEmpty=
> >>
> >> and
> >>
> >> Restart=Always
> >>
> >>
> >> This combination would (in my feebled mind) cause the service to restart
> >> once the Condition was fulfilled, but that doesn't seem to be the
> >> case.
> >
> > Conditions are something that are on-time evaluated right before we
> > would start a unit, and cause this starting to be shortcut. That's all
> > really. Restarts are only triggered when a running service dies, and
> > the start job queued by that will then check the conditions again. If
> > the condition doesn't hold then this start will not be executed, and
> > hence no restart ever again either...
> >
> >> Is there a way I can get a service to restart even after it has been set
> >> as inactive (dead) "start condition failed"?
> >
> > Nope, conditions are not for that. For the specific check of
> > file-not-empty there's no nice way to handle this, however for
> > directory-not-empty you could set up DirectoryNotEmpty=...
> >
> >> Should I simply remove the Condition, or something else?
> >
> > What precisely are you trying to do?
> >
> > Lennart
>
> Basically, some files (config & certificates) may not exist on a system
> until it's provisioned properly, something that may take a while ( a few
> days)
>
> After provisioning, we want the services depending on those file to
> start automatically.


Path unit files should work for you,
http://www.freedesktop.org/software/systemd/man/systemd.path.html

Umut

>
> //D.S.
>
>
> --
> 8362 CB14 98AD 11EF CEB6  FA81 FCC3 7674 449E 3CFC
>
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Service not restarting after Condition failed

2014-11-24 Thread D.S. Ljungmark
On 10/11/14 23:09, Lennart Poettering wrote:
> On Thu, 30.10.14 18:47, D.S. Ljungmark (spi...@aanstoot.se) wrote:
> 
>> Hi
>>  we have a service set to:
>> ConditionFileNotEmpty=
>>
>> and
>>
>> Restart=Always
>>
>>
>> This combination would (in my feebled mind) cause the service to restart
>> once the Condition was fulfilled, but that doesn't seem to be the
>> case.
> 
> Conditions are something that are on-time evaluated right before we
> would start a unit, and cause this starting to be shortcut. That's all
> really. Restarts are only triggered when a running service dies, and
> the start job queued by that will then check the conditions again. If
> the condition doesn't hold then this start will not be executed, and
> hence no restart ever again either...
> 
>> Is there a way I can get a service to restart even after it has been set
>> as inactive (dead) "start condition failed"?
> 
> Nope, conditions are not for that. For the specific check of
> file-not-empty there's no nice way to handle this, however for
> directory-not-empty you could set up DirectoryNotEmpty=...
> 
>> Should I simply remove the Condition, or something else?
> 
> What precisely are you trying to do?
> 
> Lennart

Basically, some files (config & certificates) may not exist on a system
until it's provisioned properly, something that may take a while ( a few
days)

After provisioning, we want the services depending on those file to
start automatically.

//D.S.


-- 
8362 CB14 98AD 11EF CEB6  FA81 FCC3 7674 449E 3CFC



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Service not restarting after Condition failed

2014-11-10 Thread Lennart Poettering
On Thu, 30.10.14 18:47, D.S. Ljungmark (spi...@aanstoot.se) wrote:

> Hi
>  we have a service set to:
> ConditionFileNotEmpty=
> 
> and
> 
> Restart=Always
> 
> 
> This combination would (in my feebled mind) cause the service to restart
> once the Condition was fulfilled, but that doesn't seem to be the
> case.

Conditions are something that are on-time evaluated right before we
would start a unit, and cause this starting to be shortcut. That's all
really. Restarts are only triggered when a running service dies, and
the start job queued by that will then check the conditions again. If
the condition doesn't hold then this start will not be executed, and
hence no restart ever again either...

> Is there a way I can get a service to restart even after it has been set
> as inactive (dead) "start condition failed"?

Nope, conditions are not for that. For the specific check of
file-not-empty there's no nice way to handle this, however for
directory-not-empty you could set up DirectoryNotEmpty=...

> Should I simply remove the Condition, or something else?

What precisely are you trying to do?

Lennart

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


[systemd-devel] Service not restarting after Condition failed

2014-10-30 Thread D.S. Ljungmark
Hi
 we have a service set to:
ConditionFileNotEmpty=

and

Restart=Always


This combination would (in my feebled mind) cause the service to restart
once the Condition was fulfilled, but that doesn't seem to be the case.

Is there a way I can get a service to restart even after it has been set
as inactive (dead) "start condition failed"?

Should I simply remove the Condition, or something else?

//D.S.


-- 
8362 CB14 98AD 11EF CEB6  FA81 FCC3 7674 449E 3CFC



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel