Running an archlinux container on an archlinux host, both using rsyslog with the same configuration file:

$ cat /etc/rsyslog.conf 
# Minimal config

$ModLoad imuxsock # provides support for local system logging
$ModLoad imklog   # provides kernel logging support
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$FileOwner root
$FileGroup root
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022
$WorkDirectory /var/spool/rsyslog
$IncludeConfig /etc/rsyslog.d/*.conf

auth,authpriv.*         /var/log/auth.log
*.*;auth,authpriv.none      -/var/log/syslog
#cron.*             /var/log/cron.log
daemon.*            -/var/log/daemon.log
kern.*              -/var/log/kern.log
lpr.*               -/var/log/lpr.log
mail.*              -/var/log/mail.log
user.*              -/var/log/user.log

mail.info           -/var/log/mail.info
mail.warn           -/var/log/mail.warn
mail.err            /var/log/mail.err

news.crit           /var/log/news/news.crit
news.err            /var/log/news/news.err
news.notice         -/var/log/news/news.notice

    news.none;mail.none -/var/log/debug
    mail,news.none      -/var/log/messages

*.emerg             :omusrmsg:*

When I send a message to syslog on the host:

$ echo hello|logger -p kern.info 
$ sudo tail -1  /var/log/syslog
Jun  3 13:14:14 mothership user: hello

But with the exact same command in the container, nothing is appended to /var/log/syslog (or any other log file).

- rsyslog is the only syslogger installed on the host and in the container
- all services seem to log properly through rsyslog in the container
- configuration of the container:

$ sudo cat /var/lib/lxc/cont/config
[sudo] password for user: 
# Template used to create this container: /usr/share/lxc/templates/lxc-archlinux
# Parameters passed to the template:
# For additional config options, please look at lxc.container.conf(5)

lxc.rootfs = /var/lib/lxc/cont/rootfs
lxc.utsname = cont
lxc.arch = i686
lxc.include = /usr/share/lxc/config/archlinux.common.conf

# tun & ttyUSB0
lxc.cgroup.devices.allow = c 10:200 rwm
lxc.cgroup.devices.allow = c 188:0 rwm
lxc.autodev = 1
lxc.pts = 1024
lxc.kmsg = 0

# network
lxc.network.type = veth
lxc.network.link = br0
lxc.network.flags = up
lxc.network.ipv4 =
lxc.network.ipv4.gateway =
lxc.network.name = eth0

# shares
lxc.mount.entry = /mnt/share mnt/share none bind 0 0
lxc.mount.entry = /var/cache/pacman/pkg var/cache/pacman/pkg none bind 0 0

Your Answer

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

Browse other questions tagged or ask your own question.