You are not logged in.

#1 2015-04-28 17:50:02

jecxjo
Member
Registered: 2011-02-22
Posts: 8

systemd socket launching service and failing

I'm creating an AUR package for poppassd (POP3 Password Changing Service). The application runs in command line using stdin/stdout but is intended to be run using xinetd and pipe the socket as I/O. The code works fine when I run via command line

$ sudo /usr/bin/poppassd
200 poppassd
QUIT
500 Username required
$

When I start the socket

systemctl start poppassd.socket

the socket opens and when I try to use telnet to connect I get a disconnect right away and journalctl reports the service exited with a status of 1/FAILURE

Any ideas why the following service and socket files are not working?

poppassd.service

[Unit]
Description=POP3 Password Change Service

[Service]
ExecStart=/usr/bin/poppassd
StandardInput=socket
StandardOutput=inherit
StandardError=journal

poppassd.socket

[Socket]
ListenStream=0.0.0.0:106

[Install]
WantedBy=sockets.target

Offline

#2 2015-04-29 03:23:18

branch
Member
Registered: 2014-03-16
Posts: 209

Re: systemd socket launching service and failing

Note: i've never used poppassd and have not tested what i am about to suggest.

Since poppassd is written to be invoked by inetd with the nowait flag, it probably wants to be started with an accepted socket, not a listening socket. To do this in systemd, first add the following to the [Socket] section of poppassd.socket:

Accept=true

Then change the name of poppassd.service to poppassd@.service

Some socket activated template services (ie. sshd@.service) also prepend '-' to the ExecStart value to prevent a single failed instance from throwing the service into a failed state.

Offline

Board footer

Powered by FluxBB