Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
systemd and sockets
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 3784

PostPosted: Fri Sep 27, 2013 2:28 pm    Post subject: systemd and sockets Reply with quote

As I understood, one of the main ideas of systemd is that "normally" you should not enable services like openssh or cups but instead only the corresponding socket service so that the corrseponding service is started once e.g. somebody connects to the ssh or cups port.

However, I realized that e.g. the first attempt to connect via ssh from outside always fails - only later works.
Similarly, the first print job seems to send rubbish (often the printer hangs afterwards).

I conjecture that the first byte (or packet or whatever) which is sent to the socket gets "eaten" by systemd. I would have expected that systemd is wired hard enough with the kernel to be able to read and "put back" the data.

Do others here experience the same problem or am I missing some kernel feature for this? (The only recommended feature which I do not have activated in the kernel is IPv6, but I doubt that this is related. Of course, e.g. I let cups.socket listen only to the ip4 local port.)
Back to top
View user's profile Send private message
mbar
Veteran
Veteran


Joined: 19 Jan 2005
Posts: 1952
Location: Poland

PostPosted: Sun Sep 29, 2013 5:12 am    Post subject: Reply with quote

sshd socket works OK for me (it allows me to connect from outside), but not for cups -- maybe because I have to use hplip to print on my network printer.
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 3784

PostPosted: Sun Sep 29, 2013 10:26 am    Post subject: Reply with quote

mbar wrote:
sshd socket works OK for me (it allows me to connect from outside)

Thanks. So just to emphasize once more: After I attempted to connect once, it also works for me (which is not surprising since then the sshd daemon is running). Only the very first attempt to connect after boot (from outside or from inside) fails with "Connection reset by peer". Of course for sshd this is not a big issue, but apparently it is a big issue for cups.

BTW, unfortunately, I also have a printer which would require hplip, but in my case foo2zjs is sufficient.

However, in no case socket activation should be a problem since the idea in systemd is probably not that the first packet is lost or modified.

So I guess you are actually also suffering from the same bug. Probably this is yet another case where systemd does not hold what Poettering promised...
Back to top
View user's profile Send private message
mbar
Veteran
Veteran


Joined: 19 Jan 2005
Posts: 1952
Location: Poland

PostPosted: Sun Sep 29, 2013 1:50 pm    Post subject: Reply with quote

I just did a second test for cups socket and it worked :)

I removed cups.service (disabled it) and enabled only cups socket and voila, printing works. So for me, sshd and cups work good configured as sockets.

I'm on ~amd64.
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 3784

PostPosted: Sun Sep 29, 2013 8:23 pm    Post subject: Reply with quote

mbar wrote:
I removed cups.service (disabled it) and enabled only cups socket and voila, printing works. So for me, sshd and cups work good configured as sockets.

Thanks. So something must be missing in my configuration...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum