On 23.10.2012 20:51, Michael Biebl wrote:
> retitle 690892 incomplete support for LSB system facilities
> thanks
> 
> I've looked into this a bit. The LSB [1] defines the following system
> facilities: $local_fs, $network, $named, $portmap, $remote_fs, $syslog,
> $time
> 
> In addition, in Debian the following system facilities are in use:
> $x-display-manager, $mail-transport-agent, $x-font-server
> 
> A SysV init script in Debian is not allowed to provide a system
> facility. If that is a limitation of insserv or the LSB spec I don't know.
> insserv defines the system facilities in /etc/insserv.conf and
> /etc/insserv.conf.d/* instead.
> 
> systemd maps those system facilities to the following targets/services.
> See also man systemd.special:
> 
> $local_fs →             local-fs.target
> $network →              network.target
> $named →                nss-lookup.target
> $portmap →              rpcbind.target
> $remote_fs →            remote-fs.target
> $syslog →               syslog.target
> $time →                 time-sync.target
> $x-display-manager →    display-manager.service
> $mail-transport-agent →       mail-transfer-agent.target
> $x-font-server →        currently not handled
> 
> We can probably ignore the $x-font-server facility as font servers are
> pretty much obsolete nowadays.
> 
> As for $x-display-manager I'm wondering why this is mapped to a service
> instead of a target? In Debian multiple display managers are allowed to
> be installed at the same time. So letting one service provide the
> display-manager.service symlink/alias won't work afaics.
> 
> If a SysV service has a Requires: $system-facility, systemd translates
> that into a dependency/ordering (After) on the corresponding target/service.
> 
> E.g. the cups LSB header
> # Required-Start:    $syslog $remote_fs
> # Required-Stop:     $syslog $remote_fs
> # Should-Start:      $network avahi
> # Should-Stop:       $network
> 
> is translated into
> 
> After=syslog.target remote-fs.target network.target avahi.service
> systemd-journald.socket basic.target
> 
> 
> Attached is a fist stab at a patch to read the system facilities defined
> by insserv.
> 
> After applying this patch and reloading systemd, I e.g. get for
> nss-lookup.target:
> 
> Requires=dnsmasq.service network.target
> Wants=dnsmasq.service lwresd.service bind9.service unbound.service
> Conflicts=shutdown.target
> Before=mongodb.service exim4.service apache2.service dnsmasq.service
> lwresd.service bind9.service unbound.service network.target
> After=network.target
> 

[..]

> The reason for that is that insserv.conf defines
> "$named +named +dnsmasq +lwresd +bind9 +unbound $network"

[..]

> The patch is based on what's been defined for openSUSE.


Looking at the resulting dependencies, I noticed that network.target is
both in After and Before. That won't work obviously.

Which makes me think, why the original patch for openSUSE uses the
Before ordering in
r = unit_add_two_dependencies_by_name(u, UNIT_BEFORE, e, dep, NULL, true);

Shouldn't that rather be UNIT_AFTER?

Frederic, maybe you can shed some light on this.

Cheers,
Michael



-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to