/var/log not working in containers

jampy

Member
Jun 26, 2015
39
0
6
In my Debian 8 (Jessie) containers the /var/log socket doesn't seem to work.

Code:
$ModLoad imuxsock
is enabled in rsyslog.conf

I can also see that the daemon is listening on that socket:
Code:
lsof /dev/log
COMMAND   PID USER   FD   TYPE             DEVICE SIZE/OFF   NODE NAME
rsyslogd 1953 root    3u  unix 0xffff88107209c500      0t0 678611 /dev/log

However, in the /var/log/* files I just see the start/stop messages of rsyslog itself, nothing else.

Apparently something is preventing access to /dev/log:
Code:
# strace logger hello
...
socket(PF_LOCAL, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 3
connect(3, {sa_family=AF_LOCAL, sun_path="/dev/log"}, 110) = -1 ECONNREFUSED (Connection refused)
close(3)                                = 0
close(1)                                = 0
close(2)                                = 0
exit_group(0)                           = ?
+++ exited with 0 +++


In VMs (still Debian Jessie) everything is working fine.

What could be the problem!?

(Proxmox VE 3.4)
 
Ok, I understand now that the problem is that the container uses a NFS shared storage.

/dev is a normal directory and thus also on the NFS (host-)mount.

rsyslog apparently can't create a UNIX socket on that (and so falls back to a named pipe..)

Code:
# ls -al /dev/log
prw-rw-rw- 1 root root 0 Jul  9 09:21 /dev/log

Does this mean I can't use UNIX sockets in containers?

Note this is a HA-managed container so shared storage is a must..
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!