Mailinglist Archive: yast-devel (53 mails)

< Previous Next >
Re: [yast-devel] What means calling Service.[Start|Stop|Enable|Disable]("foo")?

On 02/20/2014 03:13 PM, Johannes Meixner wrote:


when there is one service foo with two systemd unit files
foo.service and foo.socket and a YaST module calls
what is each call meant to result in the system?

Service.Enable("foo") is equivalent to `systemctl enable foo.service`

Does calling Service.[Start|Stop|Enable|Disable]("foo") mean
both foo.service and foo.socket get started/stopped/enabled/disabled


does calling Service.[Start|Stop|Enable|Disable]("foo") mean
only foo.service gets started/stopped/enabled/disabled?


I would expect that calling Service.[Start|Stop|Enable|Disable]("foo")
means "the whole 'foo' thing" (both foo.service and foo.socket)
while calling Service.[Start|Stop|Enable|Disable]("foo.service")
means only foo.service (but not foo.socket).

The systemd API calls are going to change. There is a proposal for
socket unit manipulation currently in review [1] (feel free to comment
there), other units will follow. The proposed API will look like this:

foo = SystemdSocket.find 'foo'
foo.stop # if we have a socket-activated service, it will stop now

[not yet implemented]
bar = SystemdService.find 'bar'

I'm not sure about the API call for "the whole thing" as you mentioned
above, it might be confusing and unpredictable. There is no plan to
design it like that. If there are some dependencies among systemd units,
they should be expressed inside the unit files.

See in particular
that reads [it was YCP at that time (openSUSE 12.3)]
... the YCP call Service::Stop("foo")
should completely stop those service in all ways
how those service can be active or semi-active via systemd.

This way Service::Stop("foo") would work for systemd
in compliance how it worked all the time for SysVinit
and all YaST modules that use Service::Stop("foo")
would work the same for systemd and SysVinit.

In contrast if Service::Stop("foo") only stops foo.service
but not foo.socket, foo.path (and all other possible ways
which may exist in systemd), then Service::Stop("foo")
would be basically useless functionality for systemd
because if e.g. foo.socket is still active, any normal user
can activate the service by triggering systemd via the socket

The proposed new Yast systemd API is not going to be compatible with




To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: yast-devel+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups