0

The concept behind systemd sockets is to provide a "cheap listener service" that will start the "service that would normally bind that socket but we don't want to run it all the time" once data on the socket is detected.

Once started why can the "service that would normally bind that socket but we don't want to run it all the time" now receive data from the socket?


[Background]

I don't want rsyslog to be started when there is data on /run/systemd/journal/syslog. I want to start it when I need it and don't understand why is it a bad practice to bind it directly to the socket and delete syslog.socket altogether.

  • 1
    Have you seen the relevant systemd documentation? – Stephen Kitt Nov 15 '18 at 17:03
  • What do you mean by "I want to start it when I need it"? It's arguably needed when there's log data in the socket for it to consume... Do you mean you want to start it unconditionally and have rsyslog listen on the socket directly, rather than use socket activation for it? – filbranden Nov 15 '18 at 18:43
  • @FilipeBrandenburger Do you mean you want to start it unconditionally and have rsyslog listen on the socket directly, rather than use socket activation for it? Yes. And all the docs imply the socket activation setup. So I'm trying to understand what could go wrong if I bypass systemd sockets. – TheMeaningfulEngineer Nov 15 '18 at 21:45
2

The imuxsock plugin of rsyslog appears to be aware of systemd's socket activation.

Systemd will create the socket and the file descriptor of that listening socket will be passed to the rsyslog.socket service which will use it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.