Re: [systemd-devel] A question about the race condition between two service

2018-11-05 Thread piliu


On 11/05/2018 07:42 PM, Cristian Rodríguez wrote:
> 
> 
> El 01-11-2018 a las 5:34, piliu escribió:
> 
>> Any suggestion?
>>
> 
> Yeah. Don't..if poweroff fails reboot will too..please attack the root
> cause of this problem.. why the machine fails to poweroff, is it a
> service blocking poweroff ? is there a kernel bug ?
No, it is not kernel bug. Our kdump script always uses reboot as a
back-end method. And if in kdump.conf, choosing poweroff as default
action, then there is the race sequence poweroff -> reboot.
Maybe the script should not launch reboot-service if it already launched
a poweroff service
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Router Advertisement in systemd

2018-11-05 Thread Daniel Wang
Thank you.
On Mon, Nov 5, 2018 at 11:36 AM Lennart Poettering
 wrote:
>
> On Mo, 05.11.18 11:09, Daniel Wang (wonder...@google.com) wrote:
>
> > Hi all,
> >
> > Recently I realized that systemd-networkd implements its own Router
> > Advertisement and NDISC. While I am perfectly fine with using it, I
> > wonder what motivated it given that the Linux kernel already
> > implemented both. Is it features? Flexibility? Stability?
>
> for starters, if you want the DNS info embedded in it (and other stuff
> like that) then the in-kernel one won#t give it to you.
>
> > Also, what else in the ipv6 stack is duplicated in systemd-networkd?
>
> duplicated from what? I mean, the whole thing is a duplicate of
> NetworkManager if you so will, or of dhclient, and so on. Nothing
> networkd implements hasn't been implemented before. it just integrates
> stuff better, that's all.
>
> Lennart
>
> --
> Lennart Poettering, Red Hat



-- 
Best,
Daniel


smime.p7s
Description: S/MIME Cryptographic Signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Add timer exception

2018-11-05 Thread Andy Pieters
On Mon, Nov 5, 2018 at 2:38 PM Lennart Poettering
 wrote:
Note that you can combined OnCalendar= (i.e. calendar time events) and
> OnUnitInactiveSec= and friends (i.e. monotonic time events) in a
> single .timer unit.
>

Until this is implemented I think I will just do a

 `at -t 201901010325 systemctl stop mytimer.timer`

and

`at -t 201901020330 systemctl start mytimer.timer`

Assuming no artefacts will arise from this?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Add timer exception

2018-11-05 Thread Kenneth Porter
--On Monday, November 05, 2018 2:37 PM +0100 Lennart Poettering 
 wrote:



I would be great to add a concept for that, but so far nobody
suggested a nice syntax and a patch for it yet.


For prior art, take a look at the RRULE syntax in calendar files.






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


Re: [systemd-devel] Router Advertisement in systemd

2018-11-05 Thread Lennart Poettering
On Mo, 05.11.18 11:09, Daniel Wang (wonder...@google.com) wrote:

> Hi all,
> 
> Recently I realized that systemd-networkd implements its own Router
> Advertisement and NDISC. While I am perfectly fine with using it, I
> wonder what motivated it given that the Linux kernel already
> implemented both. Is it features? Flexibility? Stability?

for starters, if you want the DNS info embedded in it (and other stuff
like that) then the in-kernel one won#t give it to you.

> Also, what else in the ipv6 stack is duplicated in systemd-networkd?

duplicated from what? I mean, the whole thing is a duplicate of
NetworkManager if you so will, or of dhclient, and so on. Nothing
networkd implements hasn't been implemented before. it just integrates
stuff better, that's all.

Lennart

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


[systemd-devel] Router Advertisement in systemd

2018-11-05 Thread Daniel Wang
Hi all,

Recently I realized that systemd-networkd implements its own Router
Advertisement and NDISC. While I am perfectly fine with using it, I
wonder what motivated it given that the Linux kernel already
implemented both. Is it features? Flexibility? Stability?

Also, what else in the ipv6 stack is duplicated in systemd-networkd?

-- 
Best,
Daniel


smime.p7s
Description: S/MIME Cryptographic Signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Question about hardware watchdog

2018-11-05 Thread Lennart Poettering
On Mo, 05.11.18 16:21, Liu, Shuang (ADITG/ESM) (s...@de.adit-jv.com) wrote:

> Hi,
> 
> We are facing problem with hardware watchdog.
> 
> To my understanding, the watchdog is pinged inside the manager_loop(),
> which means, during e.g. systemctl daemon-reload, watchdog cannot be pinged.
> 
> Here, perhaps other timeouts are involved in, e.g. generator timeout, dbus 
> timeout, systemctl timeout, ...
> which could be larger than the RuntimeWatchdogSec.
> 
> Thus a problem with systemctl daemon-reload could trigger the watchdog 
> timeout.

Yes, and that's intended. If an event is dispatched (such as a reload
request) and we don't return to normal event loop processing within
the watchdog timeout, then the watchdog will react and reboot. 

Lennart

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


Re: [systemd-devel] Add timer exception

2018-11-05 Thread Lennart Poettering
On Mo, 05.11.18 09:36, Andy Pieters (syst...@andypieters.me.uk) wrote:

> What can we do about this, please? Is there a better way to define a
> timer to run every other day? Can we perhaps add an exception for a
> specific date?

A similar feature has been requested before: a way to configure
bi-weekly calendar events
(https://github.com/systemd/systemd/issues/6024)

If we add bi-weekly calendar events it would make a ton of sense to
also add bi-daily events (and other similar ones)

I would be great to add a concept for that, but so far nobody
suggested a nice syntax and a patch for it yet.

To deal nicely with the year-end issue I figure one option would be to
define a linear day/week/month index based on 1st jan 1970 and then
base repetitions on that, always adjusting things to the current
timezone correctly.

Lennart

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


Re: [systemd-devel] A question about the race condition between two service

2018-11-05 Thread Cristian Rodríguez



El 01-11-2018 a las 5:34, piliu escribió:


Any suggestion?



Yeah. Don't..if poweroff fails reboot will too..please attack the root 
cause of this problem.. why the machine fails to poweroff, is it a 
service blocking poweroff ? is there a kernel bug ?

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


Re: [systemd-devel] Add timer exception

2018-11-05 Thread Andy Pieters
On Mon, Nov 5, 2018 at 10:05 AM Jérémy Rosen  wrote:

> I would have my timer be duration-based instead of calandar based
> (assuming that fits your need)
>
> You could use one of the following
>
> OnActiveSec=48h (two days after the timer last triggered
> OnUnitActiveSec=48h (two days afte the unit was last started)
>
> Or slightly different
>
> OnUnitInactiveSec=24h (one day after the service FINISHED)
>
> In all those cases, since this is interval based, you would need a way to
> "prime the pump" I usually do this with
>
> OnStartupSec=15m (1/4h after the machine was started)
>
> or simply by enabling the service itself so it's part of the boot sequence
> (this will work with OnUnitActive and OnUnitInactive, but not with OnActive)
>

Ok but I don't want to have to wait until 3.30AM to manually prime the
thing, and I don't want to start it outside of its normal run window...
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Add timer exception

2018-11-05 Thread Jérémy Rosen
I would have my timer be duration-based instead of calandar based 
(assuming that fits your need)


You could use one of the following

OnActiveSec=48h (two days after the timer last triggered
OnUnitActiveSec=48h (two days afte the unit was last started)

Or slightly different

OnUnitInactiveSec=24h (one day after the service FINISHED)

In all those cases, since this is interval based, you would need a way 
to "prime the pump" I usually do this with


OnStartupSec=15m (1/4h after the machine was started)

or simply by enabling the service itself so it's part of the boot 
sequence (this will work with OnUnitActive and OnUnitInactive, but not 
with OnActive)


On 05/11/2018 09:36, Andy Pieters wrote:

Dear Systemd list

I have got a job that I want to execute every other day.

The job is rather lengthy and takes more than 24 hours to complete but
less than 48.

So here are my criteria:

Start today
Start the day after tomorrow (t+2d)*1
Start the (t+2d)*2
Start 2 days after that (t+2d)*n


My timer unit:

[Timer]
OnCalendar=*-*-01,03,05,07,09,11,13,15,17,19,21,23,25,27,29,31 03:30:00

The problem with that is when I simulate the execution dates,
specifically at newyear:

Tue 2018-12-25 03:30:00 CET
Thu 2018-12-27 03:30:00 CET
Sat 2018-12-29 03:30:00 CET
 Mon 2018-12-31 03:30:00 CET
 Tue 2019-01-01 03:30:00 CET
Thu 2019-01-03 03:30:00 CET
Sat 2019-01-05 03:30:00 CET
Mon 2019-01-07 03:30:00 CET
Wed 2019-01-09 03:30:00 CET

We can see that the timer would be triggered two days in a row.

What can we do about this, please? Is there a better way to define a
timer to run every other day? Can we perhaps add an exception for a
specific date?

Thank you kindly

Keep up the good work!



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


--
SMILE 

20 rue des Jardins
92600 Asnières-sur-Seine


*Jérémy ROSEN*
Architecte technique
Responsable de l'expertise Smile-ECS

email jeremy.ro...@smile.fr 
phone +33141402967
url http://www.smile.eu

Twitter  Facebook 
 LinkedIn 
 Github 




Découvrez l’univers Smile, rendez-vous sur smile.eu 



eco Pour la planète, n'imprimez ce mail que si c'est nécessaire
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Add timer exception

2018-11-05 Thread Andy Pieters
Dear Systemd list

I have got a job that I want to execute every other day.

The job is rather lengthy and takes more than 24 hours to complete but
less than 48.

So here are my criteria:

Start today
Start the day after tomorrow (t+2d)*1
Start the (t+2d)*2
Start 2 days after that (t+2d)*n


My timer unit:

[Timer]
OnCalendar=*-*-01,03,05,07,09,11,13,15,17,19,21,23,25,27,29,31 03:30:00

The problem with that is when I simulate the execution dates,
specifically at newyear:

Tue 2018-12-25 03:30:00 CET
Thu 2018-12-27 03:30:00 CET
Sat 2018-12-29 03:30:00 CET
Mon 2018-12-31 03:30:00 CET
Tue 2019-01-01 03:30:00 CET
Thu 2019-01-03 03:30:00 CET
Sat 2019-01-05 03:30:00 CET
Mon 2019-01-07 03:30:00 CET
Wed 2019-01-09 03:30:00 CET

We can see that the timer would be triggered two days in a row.

What can we do about this, please? Is there a better way to define a
timer to run every other day? Can we perhaps add an exception for a
specific date?

Thank you kindly

Keep up the good work!



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