[systemd-devel] Antw: Re: Antw: Re: Service fails to start with no log messages

Reindl Harald h.reindl at thelounge.net
Mon Jan 13 13:49:36 UTC 2020



Am 13.01.20 um 13:20 schrieb Ulrich Windl:
>>>> Reindl Harald <h.reindl at thelounge.net> schrieb am 13.01.2020 um 11:50 in
> Nachricht <efdc18c8-7396-02fc-1780-9e089e203601 at thelounge.net>:
> 
>>
>> Am 13.01.20 um 11:45 schrieb Ulrich Windl:
>>>>>> Lennart Poettering <lennart at poettering.net> schrieb am 07.01.2020 um
> 14:27
>>>> Such a concept does not exist. I mean your service is a system
>>>> service itself, so what is that even supposed to mean that the service
>>>> shall start 5s after it already started? But even if you mean to say
>>>> "5s after all other services", then think how that falls apart if you
>>>> have multiple services declaring that.
>>>
>>> Maybe explain when systemd considers a service as started, pointing out 
>> wrong
>>> implementations.
>>
>> https://www.freedesktop.org/software/systemd/man/systemd.service.html 
>>
>> CTRL+F Type=
>>
>> for network it strongly depends on *how* your network is setup
>> (NetworkManager, systemd‑networkd, legacy /etc/nint.d/network or even a
>> own implementation)
>>
>> with the implementation below you can relieable oder anything after
>> "network‑up.service" or "network‑online.target"
> 
> But isn't it simply because none of the ExecStarts is executing in background?
> The interesting part is DHCP which can complete quickly or not at all (e.g.
> configuration error)...

surely, but also dhcp client is no problem

-----------------------

the simple network-up.service in complexer setups has dhcp-client as own
unit startet with systemctl which can take up to 15 seconds with my
cable ISP and when you use "dhclient" with "Type=forking" it behaves as
expected

ExecStart=-/usr/bin/systemctl start network-wan-dhcp.service

-----------------------

[root at srv-rhsoft:~]$ cat /etc/systemd/system/network-wan-dhcp.service
[Unit]
Description=Internet DHCP-Client

[Service]
ExecStart=/usr/sbin/dhclient -4 -q --no-pid --request-options
subnet-mask,routers br-wan

Type=forking
PermissionsStartOnly=yes

Restart=always
RestartSec=5

ProtectSystem=strict
ProtectHome=yes
ReadWritePaths=-/var/lib/dhclient

PrivateTmp=yes
NoNewPrivileges=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectControlGroups=yes
MemoryDenyWriteExecute=yes
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
CAP_NET_BROADCAST CAP_NET_RAW



More information about the systemd-devel mailing list