[systemd-devel] [RFC] runtime configurable timer

Lennart Poettering lennart at poettering.net
Wed Oct 22 08:28:28 PDT 2014


On Thu, 11.09.14 17:45, WaLyong Cho (walyong.cho at samsung.com) wrote:

> (I will happy there is already similar method already exist.)
> 
> systemd already has similar functionality "systemd-run" but that is only
> for scope or service unit. I think that is useful run a service without
> unit file on permanent storage.
> 
> As a similar method, is it possible to generate or configure timer unit
> on runtime?

Currently not, but this would be certainly useful.

> Honestly, now, I need a runtime configurable timer interface. If systemd
> has this then I can reduce one of daemon.

Currently pid1's StartTransientUnit() bus call already takes four arguments
arguments: 

  1. a name for the unit to create and start
  2. a mode how to start it
  3. an array with properties for the unit
  4. an array conisting of unit names plus a property array each,
     which is supposed to contain additional unit definitions which can
     be referenced by the main unit you are creating.

Now, while the method takes that fourth argument it is actually just
ignored. The plan was (and still is) to beef this up and make it
useful for installing both a transient service and a timer unit at
once. More specifically: to implement something that would work like
"at" a client would invoke StartTransientUnit(), create the timer unit
as primary unit, and then include the service definition for the
service to eventually start in the second array.

I would love to see this getting fully implemented now, it would be
great if systemd-run would get an --on-calendar= switch or so, which
makes use of this behaviour.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list