0

I am trying to use a custom path for syslogd socket by using -p option as below

syslogd -p /tmp/my_path

Even though I see the socket file is getting created correctly, the logging is not happening to syslog storage (even with explicit rules in /etc/syslog.conf)

Do I need any extra changes in syslog.conf to send logs to alternative socket /tmp/my_path which is used instead of /dev/log ?

9
  • my first intuition is that your syslogd is not actually used for syslog logging, because journald already does that (at least that's what's happening on most modern linuxes). Can you verify your system isn't actually using journald? What linux distro (in which version) is this? Jun 23 at 7:46
  • My system is still using the legacy syslogd which creates a socket file and does not use systemd implementation that creates a softlink to journal.
    – tss
    Jun 23 at 9:01
  • yeah but that's the point: No other program will use your socket if you don't link /dev/lock to it! But if you modified your software to do that, then you'd be fine. Jun 23 at 10:11
  • Sure..any other option other than creating the custom location as softlink to /dev/log? Can I set/pass some data to syslog() call or edit syslog.conf to use this new path?
    – tss
    Jun 23 at 11:50
  • you can't, libc / syslog uses /dev/log. syslog.conf is a syslogd thing, not something the clients worry about. Jun 23 at 11:52

1 Answer 1

1

What you're doing is totally nonsensical.

Daemons usually log by calling the syslog(3) function from the C library, which works by sending a message to the hardwired /dev/log unix domain socket. Forcing syslogd to use some random path for that socket is just like not running syslogd at all.

Note: this is also true of systemd. Systemd wants to force everybody to stop using syslog(3), and log error messages by just writing to the stderr (which was redirected in advance by systemd), but it still implements /dev/log for compatibility.

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.