Re: [systemd-devel] [PATCH v7] run: introduce timer support option
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
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
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 http://www.gnu.org/licenses/. refnamediv refnamesystemd-run/refname -refpurposeRun programs in transient scope or service units/refpurpose +refpurposeRun programs in transient scope or service or timer units/refpurpose /refnamediv refsynopsisdiv @@ -56,15 +56,23 @@ along with systemd; If not, see http://www.gnu.org/licenses/. arg choice=opt rep=repeatARGS/arg /arg /cmdsynopsis +cmdsynopsis + commandsystemd-run/command + arg choice=opt rep=repeatOPTIONS/arg + arg choice=opt rep=repeatTIMER OPTIONS/arg + arg choice=reqreplaceableCOMMAND/replaceable/arg + arg choice=opt rep=repeatARGS/arg +/cmdsynopsis /refsynopsisdiv refsect1 titleDescription/title -paracommandsystemd-run/command may be used to create and start -a transient filename.service/filename or a -filename.scope/filename unit and run the specified -replaceableCOMMAND/replaceable in it./para +paracommandsystemd-run/command may be used to create and +start a transient filename.service/filename or a transient +filename.timer/filename or a filename.scope/filename unit +and run the specified replaceableCOMMAND/replaceable in +it./para paraIf 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 http://www.gnu.org/licenses/. will start the service asynchronously in the background and immediately return./para +paraIf 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 +option--unit=/option is specified with timer options, the +replaceableCOMMAND/replaceable can be omitted. In this case, +commandsystemd-run/command 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 option--unit=/option. This transient timer unit can +activate the existing service unit like any other timer./para + paraIf a command is run as transient scope unit, it will be started directly by commandsystemd-run/command and thus inherit the execution environment of the caller. It is however @@ -210,6 +230,54 @@ along with systemd; If not, see http://www.gnu.org/licenses/. xi:include href=user-system-options.xml xpointer=host / xi:include href=user-system-options.xml xpointer=machine / + varlistentry +termoption--on-active=/option/term +termoption--on-boot=/option/term +termoption--on-startup=/option/term +termoption--on-unit-active=/option/term +termoption--on-unit-inactive=/option/term + +listitemparaDefines monotonic timers relative to different +starting points. Also see varnameOnActiveSec=/varname, +varnameOnBootSec=/varname, +varnameOnStartupSec=/varname, +varnameOnUnitActiveSec=/varname and +varnameOnUnitInactiveSec=/varname in + citerefentryrefentrytitlesystemd.timer/refentrytitlemanvolnum5/manvolnum/citerefentry. This +options have no effect in conjunction with +option--scope/option./para +/listitem + /varlistentry + + varlistentry +termoption--on-calendar=/option/term + +listitemparaDefines realtime (i.e. wallclock) timers with +calendar event expressions. Also see +varnameOnCalendar=/varname in +
Re: [systemd-devel] [PATCH v7] run: introduce timer support option
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
[systemd-devel] [PATCH v7] run: introduce timer support option
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. 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 http://www.gnu.org/licenses/. refnamediv refnamesystemd-run/refname -refpurposeRun programs in transient scope or service units/refpurpose +refpurposeRun programs in transient scope or service or timer units/refpurpose /refnamediv refsynopsisdiv @@ -56,15 +56,23 @@ along with systemd; If not, see http://www.gnu.org/licenses/. arg choice=opt rep=repeatARGS/arg /arg /cmdsynopsis +cmdsynopsis + commandsystemd-run/command + arg choice=opt rep=repeatOPTIONS/arg + arg choice=opt rep=repeatTIMER OPTIONS/arg + arg choice=reqreplaceableCOMMAND/replaceable/arg + arg choice=opt rep=repeatARGS/arg +/cmdsynopsis /refsynopsisdiv refsect1 titleDescription/title -paracommandsystemd-run/command may be used to create and start -a transient filename.service/filename or a -filename.scope/filename unit and run the specified -replaceableCOMMAND/replaceable in it./para +paracommandsystemd-run/command may be used to create and +start a transient filename.service/filename or a transient +filename.timer/filename or a filename.scope/filename unit +and run the specified replaceableCOMMAND/replaceable in +it./para paraIf 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 http://www.gnu.org/licenses/. will start the service asynchronously in the background and immediately return./para +paraIf 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 +option--unit=/option is specified with timer options, the +replaceableCOMMAND/replaceable can be omitted. In this case, +commandsystemd-run/command 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 option--unit=/option. This transient timer unit can +activate the existing service unit like any other timer./para + paraIf a command is run as transient scope unit, it will be started directly by commandsystemd-run/command and thus inherit the execution environment of the caller. It is however @@ -210,6 +230,54 @@ along with systemd; If not, see http://www.gnu.org/licenses/. xi:include href=user-system-options.xml xpointer=host / xi:include href=user-system-options.xml xpointer=machine / + varlistentry +termoption--on-active=/option/term +termoption--on-boot=/option/term +termoption--on-startup=/option/term +termoption--on-unit-active=/option/term +termoption--on-unit-inactive=/option/term + +listitemparaDefines monotonic timers relative to different +starting points. Also see varnameOnActiveSec=/varname, +varnameOnBootSec=/varname, +varnameOnStartupSec=/varname, +varnameOnUnitActiveSec=/varname and +varnameOnUnitInactiveSec=/varname in + citerefentryrefentrytitlesystemd.timer/refentrytitlemanvolnum5/manvolnum/citerefentry. This +options have no effect in conjunction with +option--scope/option./para +/listitem + /varlistentry + + varlistentry +termoption--on-calendar=/option/term + +listitemparaDefines realtime (i.e. wallclock) timers with +calendar event expressions. Also see +varnameOnCalendar=/varname in + citerefentryrefentrytitlesystemd.timer/refentrytitlemanvolnum5/manvolnum/citerefentry. This +option has no effect in conjunction with +option--scope/option./para +/listitem + /varlistentry + + varlistentry +