Re: .service and .socket

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Am 02.01.19 um 11:05 schrieb Lennart Poettering:
> On Di, 01.01.19 13:46, Olaf van der Spek (ml@xxxxxxxxxx) wrote:
>> AFAIK socket units require a separate file, which seems more complex
>> then it has to be.
> 
> The main reason why socket and service units are separate is that this
> way they may be separately scheduled. i.e. a socket can be established
> early and only when it is triggered the matching service is pulled in
> with all its dependencies which might delay its activation. The socket
> hence can have entirely different dependencies, properties, timings,
> lifecycles than the activated services, and that's a *good* thing

agreed, but why can't have socket simply optional a [Service] section to
save the "demo@.service" in cases like below?

[root@client:/etc/systemd/system]$ cat demo.socket
[Unit]
Description=Demo Server - Activation Socket

[Socket]
Accept=yes
ListenStream=0.0.0.0:7
ListenStream=0.0.0.0:19
ListenStream=0.0.0.0:21

[Service]
Type=oneshot
ExecStart=/usr/bin/echo "DEMO-SERVICE"
StandardOutput=socket
StandardInput=socket

[Install]
WantedBy=sockets.target
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux