Re: [systemd-devel] [PATCH v7] run: introduce timer support option

2014-12-10 Thread Jóhann B. Guðmundsson


On 12/10/2014 12:05 PM, Lennart Poettering wrote:

No. At least on Fedora we only have a limited number of system cron
jobs,


Right less then 45 ( out of 100 in total ) that might have been 
applicable for migration



and I'd rather see those converted natively, rather than
maintaining a compatibility generator for a longer time


Right arguably upstream should never carry generators of anykind ( and 
at one point we will need to drop the legacy sysv initscript 
compatibility otherwise those legacy initscripts will never get migrated 
and their daemon be fixed either if applicable ) and beside the 
limitation that timer units suffer from, cron generators can create 
quite the surprise for administrators, especially on batch servers.


That said out of necessity ( It's easier to write a generator rather 
then go through the leg work and bureaucracy of dealing with 
distribution processes )  there has already been written by Dwayne Bent, 
Konstantin Stepanov, Daniel Schaal and Alexandre Detiste an 
"systemd-crontab" which includes crontab generator which can be found 
here [1]


But I urge distribution integrators to go the extra mile and rather 
migrate existing cron jobs for components that already depend on systemd 
and or are part of the core/base OS and might thus benefit from that 
migration.


I would have migrating all the relevant cron jobs in Fedora but I had 
enough due to certain corporate attitude towards the project, certain 
part of their employees and their behaviour and as a result of that in 
the end things turned out differently than I had planned or anticipated.


That work would have most likely covered everything that should have 
been migrated in Mageia,OpenSuse and Arch ( Debian is of a different 
Scale ) but you know shit happens and things go unfixed as an result of 
that.


JBG

1. https://github.com/kstep/systemd-crontab-generator
2. https://github.com/systemd-cron/systemd-cron
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH v7] run: introduce timer support option

2014-12-10 Thread Lennart Poettering
On Wed, 10.12.14 16:01, WaLyong Cho (walyong@samsung.com) wrote:

> On 12/10/2014 02:25 AM, Lennart Poettering wrote:
> > On Tue, 09.12.14 16:07, WaLyong Cho (walyong@samsung.com) wrote:
> > 
> >> Support timer options --on-active=, --on-boot=, --on-startup=,
> >> --on-unit-active=, --on-unit-inactive=, --on-calendar=. Each options
> >> corresponding with OnActiveSec=, OnBootSec=, OnStartupSec=,
> >> OnUnitActiveSec=, OnUnitInactiveSec=, OnCalendar= of timer
> >> respectively. And OnCalendar= and WakeSystem= supported by
> >> --timer-property= option like --property= of systemd-run.
> > 
> > Looks good! Applied!
> > 
> > Thanks!
> 
> Do you have plan to crontab-generator?

No. At least on Fedora we only have a limited number of system cron
jobs, and I'd rather see those converted natively, rather than
maintaining a compatibility generator for a longer time

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] [PATCH v7] run: introduce timer support option

2014-12-09 Thread WaLyong Cho
On 12/10/2014 02:25 AM, Lennart Poettering wrote:
> On Tue, 09.12.14 16:07, WaLyong Cho (walyong@samsung.com) wrote:
> 
>> Support timer options --on-active=, --on-boot=, --on-startup=,
>> --on-unit-active=, --on-unit-inactive=, --on-calendar=. Each options
>> corresponding with OnActiveSec=, OnBootSec=, OnStartupSec=,
>> OnUnitActiveSec=, OnUnitInactiveSec=, OnCalendar= of timer
>> respectively. And OnCalendar= and WakeSystem= supported by
>> --timer-property= option like --property= of systemd-run.
> 
> Looks good! Applied!
> 
> Thanks!

Do you have plan to crontab-generator?

WaLyong
> 
> Lennart
> 
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH v7] run: introduce timer support option

2014-12-09 Thread Lennart Poettering
On Tue, 09.12.14 16:07, WaLyong Cho (walyong@samsung.com) wrote:

> Support timer options --on-active=, --on-boot=, --on-startup=,
> --on-unit-active=, --on-unit-inactive=, --on-calendar=. Each options
> corresponding with OnActiveSec=, OnBootSec=, OnStartupSec=,
> OnUnitActiveSec=, OnUnitInactiveSec=, OnCalendar= of timer
> respectively. And OnCalendar= and WakeSystem= supported by
> --timer-property= option like --property= of systemd-run.

Looks good! Applied!

Thanks!

> 
> And if --unit= option and timer options are specified the command can
> be omitted. In this case, systemd-run assumes the target service is
> already loaded. And just try to generate transient timer unit only.
> ---
>  man/systemd-run.xml  |  94 +-
>  src/core/dbus-manager.c  |   8 +-
>  src/libsystemd/sd-bus/bus-util.c |  14 +-
>  src/run/run.c| 628 
> ++-
>  4 files changed, 596 insertions(+), 148 deletions(-)
> 
> diff --git a/man/systemd-run.xml b/man/systemd-run.xml
> index 28a9878..b9cec91 100644
> --- a/man/systemd-run.xml
> +++ b/man/systemd-run.xml
> @@ -45,7 +45,7 @@ along with systemd; If not, see 
> .
>  
>
>  systemd-run
> -Run programs in transient scope or service units
> +Run programs in transient scope or service or timer 
> units
>
>  
>
> @@ -56,15 +56,23 @@ along with systemd; If not, see 
> .
>ARGS
>
>  
> +
> +  systemd-run
> +  OPTIONS
> +  TIMER OPTIONS
> +  COMMAND
> +  ARGS
> +
>
>  
>
>  Description
>  
> -systemd-run may be used to create and start
> -a transient .service or a
> -.scope unit and run the specified
> -COMMAND in it.
> +systemd-run may be used to create and
> +start a transient .service or a transient
> +.timer or a .scope unit
> +and run the specified COMMAND in
> +it.
>  
>  If a command is run as transient service unit, it will be
>  started and managed by the service manager like any other service,
> @@ -74,6 +82,18 @@ along with systemd; If not, see 
> .
>  will start the service asynchronously in the background and
>  immediately return.
>  
> +If a command is run with timer options, transient timer unit
> +also be created with transient service unit. But the transient
> +timer unit is only started immediately. The transient service unit
> +will be started when the transient timer is elapsed. If
> +--unit= is specified with timer options, the
> +COMMAND can be omitted. In this case,
> +systemd-run assumes service unit is already
> +loaded and creates transient timer unit only. To successfully
> +create timer unit, already loaded service unit should be specified
> +with --unit=. This transient timer unit can
> +activate the existing service unit like any other timer.
> +
>  If a command is run as transient scope unit, it will be
>  started directly by systemd-run and thus
>  inherit the execution environment of the caller. It is however
> @@ -210,6 +230,54 @@ along with systemd; If not, see 
> .
>
>
>  
> +  
> +--on-active=
> +--on-boot=
> +--on-startup=
> +--on-unit-active=
> +--on-unit-inactive=
> +
> +Defines monotonic timers relative to different
> +starting points. Also see OnActiveSec=,
> +OnBootSec=,
> +OnStartupSec=,
> +OnUnitActiveSec= and
> +OnUnitInactiveSec= in
> +
> systemd.timer5.
>  This
> +options have no effect in conjunction with
> +--scope.
> +
> +  
> +
> +  
> +--on-calendar=
> +
> +Defines realtime (i.e. wallclock) timers with
> +calendar event expressions. Also see
> +OnCalendar= in
> +
> systemd.timer5.
>  This
> +option has no effect in conjunction with
> +--scope.
> +
> +  
> +
> +  
> +--timer-property=
> +
> +Sets a timer unit property for the timer unit
> +that is created. It is similar with
> +--property but only for created timer
> +unit. This option only has effect in conjunction with
> +--on-active=, --on-boot=,
> +--on-startup=,
> +--on-unit-active=,
> +--on-unit-inactive=,
> +--on-calendar=. This takes an assignment in
> +the same format as
> +
> systemctl1's
> +set-property command. 
> +  
> +
>
>
>  
> @@ -250,6 +318,21 @@ Sep 08 07:37:21 bupkis env[19948]: 
> BOOT_IMAGE=/vmlinuz-3.11.0-0.rc5.git6.2.fc20.
>  property.
>  
>  # systemd-run -p BlockIOWeight=10 
> updatedb
> +
> +The following command will touch a file after 30 seconds.
> +
> +# date; systemd-run --on-active=30 
> --timer-property=AccuracyS