[systemd-devel] How to stop socket-actived inetd-like service?
Mantas Mikulėnas
grawity at gmail.com
Fri Dec 21 10:40:09 PST 2012
On Fri, Dec 21, 2012 at 4:11 PM, Colin Guthrie <gmane at colin.guthr.ie> wrote:
> 'Twas brillig, and Petr Pisar at 20/12/12 13:01 did gyre and gimble:
>> Hello,
>>
>> having cvs.socket:
>>
>> [Unit]
>> Description=CVS Server Activation Socket
>> [Socket]
>> ListenStream=2401
>> Accept=true
>> [Install]
>> WantedBy=sockets.target
>>
>> and cvs at .service:
>>
>> [Unit]
>> Description=CVS Server
>> After=local-fs.target
>> [Service]
>> Environment=HOME=/var/cvs
>> ExecStart=-/usr/bin/cvs -f --allow-root=/var/cvs pserver
>> StandardInput=socket
>>
>> How can I stop all running instances?
>
> You probably want to put:
>
> PartOf=cvs.target
>
> Into your cvs at .service file (assuming you have a semi-recent systemd
> version).
>
> That way you can do "systemctl stop cvs.target" and it will kill all
> instances.
>
> You will also have to ship a simple .target file too.
It would be nice if `systemctl stop` understood "cvs@*.service" to
mean "all instances".
--
Mantas Mikulėnas
More information about the systemd-devel
mailing list