Is there a way to make a whole Debian (Jessie) installation use a different syslog socket than /dev/log (like, for example, /tmp/my-other-log) ?

Reason: I'm running Debian Jessie in a chroot environment within a Android 4 environment. /dev/log in Android is a directory, so I can bind-mount that path to a different file. To make rsyslogd work with all debian programs, I need /dev/log to be a custom socket, or make all programs use a different path.

  • Can I override the path using some environment variable perhaps?
  • Since I prepare the Debian installation using debootstrap, is there something I can do at build time? Maybe patch the libc (or where ever syslog code is hidden)?

Patching the libc binary seems to work:

sed -i --binary -e 's/\/dev\/log/\/SLG\/log/' /lib/*/libc-*.so

This causes programs to send syslog messages to /SLG/log instead of /dev/log (note the same length of the strings).

However, I consider this a dirty hack and I really hope someone comes up with a better solution...

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.