Re: [systemd-devel] How to start a task after system boot but only on specific days using systemd.timer

2018-01-09 Thread Andrei Borzenkov
09.01.2018 22:28, Joerg Diederich пишет:
> Hello,
> 
> I have a little (perhaps strange) requirement:
> I want to execute a script about five minutes after system boot, but only on 
> specific weekdays (e. g. Sundays) using systemd.timer. I tried a combination 
> of OnBootSec and OnCalendar like
> 
> OnBootSec=5m
> OnCalendar=Sun
> 
> but this doesn't work.

Well, it works but not they way you want it :) As documented, multiple
directives are additive - timer will trigger when any of them elapses.
May be it could be expressed more obviously.

> My script executes always after boot. I'm running systemd-228-38.1.x86_64 on 
> SuSE LEAP 42.3. Of course, I can modify my script to ask for the current 
> weekday, but I thought, it would be more elegant to configure it all together 
> in the timer unit file.

This would likely require new directive or at least new syntax. Timers
define point in time, not period of time.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] How to start a task after system boot but only on specific days using systemd.timer

2018-01-09 Thread Joerg Diederich
Hello,

I have a little (perhaps strange) requirement:
I want to execute a script about five minutes after system boot, but only on 
specific weekdays (e. g. Sundays) using systemd.timer. I tried a combination of 
OnBootSec and OnCalendar like

OnBootSec=5m
OnCalendar=Sun

but this doesn't work. My script executes always after boot. I'm running 
systemd-228-38.1.x86_64 on SuSE LEAP 42.3. Of course, I can modify my script to 
ask for the current weekday, but I thought, it would be more elegant to 
configure it all together in the timer unit file.

Any hint is really appreciated.

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


Re: [systemd-devel] Required kernel version for pid1 only?

2018-01-09 Thread 林自均
Hi Zbyszek and Mantas,

I got it. Thank you for the detailed answers.

John Lin

Mantas Mikulėnas  於 2018年1月9日 週二 下午4:23寫道:

> On Tue, Jan 9, 2018 at 10:10 AM, 林自均  wrote:
>
>> Hi folks,
>>
>> I saw the following lines in README:
>>
>> > REQUIREMENTS:
>> > Linux kernel >= 3.13
>> > Linux kernel >= 4.2 for unified cgroup hierarchy support
>>
>> I guess it means that some part of the whole systemd project requires
>> Linux kernel 3.13. What if I don't need that part and only pid1 is relevant
>> to me? Is such information provided somewhere?
>>
>
> There's no full list. You can only check commit logs to find out why the
> requirement was bumped (git log -p README), but once the new dependency is
> published, it's always possible that other parts of systemd code will start
> implicitly depending on *other* kernel features available in that release.
>
> For example, here's what prompted each bump:
>
> 3.13 - DM_DEFERRED_REMOVE (dcce98a4bdc3)
> 3.12 - %P in core_pattern (58015d7815bc)
> 3.11 - arbitrary (a0c3e16b7bce)
> 3.7 - kernel-based firmware loading (be2ea723b1d0)
> 3.0 - cgroup.procs (e946948eff51)
> 2.6.39 - oh come on
>
> ~
>
> In short, if it says "REQUIREMENTS: Linux ≥ 3.13", that's what you need to
> use. Anything below that is at your own risk.
>
> --
> Mantas Mikulėnas
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Required kernel version for pid1 only?

2018-01-09 Thread Mantas Mikulėnas
On Tue, Jan 9, 2018 at 10:10 AM, 林自均  wrote:

> Hi folks,
>
> I saw the following lines in README:
>
> > REQUIREMENTS:
> > Linux kernel >= 3.13
> > Linux kernel >= 4.2 for unified cgroup hierarchy support
>
> I guess it means that some part of the whole systemd project requires
> Linux kernel 3.13. What if I don't need that part and only pid1 is relevant
> to me? Is such information provided somewhere?
>

There's no full list. You can only check commit logs to find out why the
requirement was bumped (git log -p README), but once the new dependency is
published, it's always possible that other parts of systemd code will start
implicitly depending on *other* kernel features available in that release.

For example, here's what prompted each bump:

3.13 - DM_DEFERRED_REMOVE (dcce98a4bdc3)
3.12 - %P in core_pattern (58015d7815bc)
3.11 - arbitrary (a0c3e16b7bce)
3.7 - kernel-based firmware loading (be2ea723b1d0)
3.0 - cgroup.procs (e946948eff51)
2.6.39 - oh come on

~

In short, if it says "REQUIREMENTS: Linux ≥ 3.13", that's what you need to
use. Anything below that is at your own risk.

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


Re: [systemd-devel] Required kernel version for pid1 only?

2018-01-09 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Jan 09, 2018 at 08:10:55AM +, 林自均 wrote:
> Hi folks,
> 
> I saw the following lines in README:
> 
> > REQUIREMENTS:
> > Linux kernel >= 3.13
> > Linux kernel >= 4.2 for unified cgroup hierarchy support
> 
> I guess it means that some part of the whole systemd project requires Linux
> kernel 3.13. What if I don't need that part and only pid1 is relevant to
> me? Is such information provided somewhere?
Generally it's pid1 that has the strongest requirements. Sometimes
we need a specific system call, in which case the requirement applies
to library code and all of the project.

Usually you can find _why_ this specific version is required by
looking at the commit that raised the requirement in docs, it should
contain a brief justification. But it's not guaranteed to list all the
reasons, and new uses could have been added in the meantime, and as
long as the latest required kernel version supports them, this
wouldn't be mentioned anywhere. It should be possible to compile and
use systemd with older kernel versions using some workarounds or by
omitting features, but this is not supported and you're basically on
your own.

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


[systemd-devel] Required kernel version for pid1 only?

2018-01-09 Thread 林自均
Hi folks,

I saw the following lines in README:

> REQUIREMENTS:
> Linux kernel >= 3.13
> Linux kernel >= 4.2 for unified cgroup hierarchy support

I guess it means that some part of the whole systemd project requires Linux
kernel 3.13. What if I don't need that part and only pid1 is relevant to
me? Is such information provided somewhere?

Thanks.

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