[lxc-users] systemd and logging in containers

Michael H. Warfield mhw at WittsEnd.com
Tue Jun 10 19:43:12 UTC 2014


On Tue, 2014-06-10 at 21:19 +0200, István Király wrote:
> Hi list, ..

> Fedora 20 host and containers.

> Some programms are logging normal, apache, mariadb, .. 

> But some others have no log at all, for example maillog is 0 in all my
> containers, but they have postfix / dovecot running.

> I experimented a little today, with a custom script echoing messages
> to standard output, and created a systemd unit file for it. ..

> When I run this script as service on the host, I get the messages from
> systemctl status test.service.

> When I run this script from a container, the messages are not in
> systemctl status, and I can't find them.

> Checked if maybe packages are missing, but all seems to be okay, ..

> .. anyone have any ideas?

Yes.

Several revs back on systemd, the systemd-journald.service was horribly
broken and, at random, eating CPU time for lunch, particularly in
containers.  That turned out to be a bug involving (iirc) logging
objects and object id's and user logs with conflicting ids.

During this period of time, I coded the Fedora template to disable and
mask systemd-journald.service.  They have since fixed this bug and I've
reenabled it in the template, but containers built prior to this will
have the systemd-journal service disabled and masked.

In the container...

systemctl unmask systemd-journald.service
systemctl start systemd-journald.service

That should start journaling.  You may also have to restart your various
services or restart the container.  I've had varying success.  Quite
frankly, syslog (rsyslog) made so much more sense.

You should not need to "enable" systemd-journald.service as it's a
"socket started" service.

> Thank you.

Regards,
Mike

> 
> -- 
> Király István
> +36 209 753 758
> LaKing at D250.hu
> 
> 
> 
> -- 
> This message has been scanned for viruses and 
> dangerous content by MailScanner, and is 
> believed to be clean. 
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users

-- 
Michael H. Warfield (AI4NB) | (770) 978-7061 |  mhw at WittsEnd.com
   /\/\|=mhw=|\/\/          | (678) 463-0932 |  http://www.wittsend.com/mhw/
   NIC whois: MHW9          | An optimist believes we live in the best of all
 PGP Key: 0x674627FF        | possible worlds.  A pessimist is sure of it!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140610/204a1544/attachment.sig>


More information about the lxc-users mailing list