[systemd-devel] Creating units using D-Bus

Stephen Gallagher sgallagh at redhat.com
Tue Jun 9 11:47:30 PDT 2015


On Tue, 2015-06-09 at 19:33 +0200, Jakub Skořepa wrote:
> Hello,
> My name is Jakub Skořepa and I'm working on Cockpit UI for Systemd
> Timers.
> 
> For that I need to create and modify systemd unit files. Cockpit uses 
> D
> -Bus for everything so I need D-Bus API for that. I think that it 
> would
> be beneficial if systemd was able to create unit files on-the-fly 
> using
> through D-Bus method call.
> 
> I plan creating simple server for doing this task but long-term it 
> woul
> d be better if systemd was capable of doing this.
> 
> I propose methods with following signatures:
> 
> # CreateUnit:
> 
>  Creates specified unit
> 
>             sa{sa{ss}}
>             |  |  ||
>           Name |  |Value
>      Section name |
>                  Key
> 
> # ModifyUnit: (same signature)
> 
>  If section/key is not then section/key is left intact.
>  If Value="" then key is erased.
> 
> # CreateUnits:
> 
>  Creates multiple units. Same as CreateUnit called for each top-level 
> 
>  array element.
> 
>             a{sa{sa{ss}}}
>               |  |  ||
>             Name |  |Value
>        Section name |
>                    Key
> 
> # ModifyUnits: (same signature as CreateUnits)
> 
>  Modifies multiple units. Same as ModifyUnit called for each top
> -level
>  array element.
> 


In order for ModifyUnit() to work, there also needs to be a way to
retrieve the current definition of the unit on the system. (And,
ideally, a way to retrieve this for any unit currently loaded into
systemd).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150609/be612aaa/attachment.sig>


More information about the systemd-devel mailing list