[Lxc-users] Use host syslog socket in container

Serge Hallyn serge.hallyn at ubuntu.com
Thu May 23 19:40:30 UTC 2013


Quoting Vallevand, Mark K (Mark.Vallevand at UNISYS.com):
> Here is how I got syslog to work with a program running in a container.  After creating a container, do something like this:
> 
> echo syslog setup
> cat <<EOF > /etc/rsyslog.d/99-lxc-1.conf
> \$AddUnixListenSocket /var/lib/lxc/container1/rootfs/dev/log
> EOF
> restart rsyslog
> 
> If you are using rsyslog, of course.  The rsyslog daemon only supports 100 unix domain sockets.  So, I guess that means 1 for the host /dev/log and 99 more for containers.
> 
> My program happily uses syslog and they end up in the host syslog.

Not sure, but I suspect you also could add a bind mount entry for
/dev/log dev/log to /var/lib/lxc/container1/fstab.




More information about the lxc-users mailing list