1

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

*.=debug;\
    auth,authpriv.none;\
    news.none;mail.none -/var/log/debug
*.=info;*.=notice;*.=warn;\
    auth,authpriv.none;\
    cron,daemon.none;\
    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).

Precisions:
- 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
lxc.hook.autodev=/var/lib/lxc/cont/autodev

# network
lxc.network.type = veth
lxc.network.link = br0
lxc.network.flags = up
lxc.network.ipv4 = 10.8.10.11/24
lxc.network.ipv4.gateway = 10.8.10.10
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.