[systemd-devel] journal: how to query journal to see ALL output of given unit?

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Tue Jan 7 13:35:23 PST 2014


On Tue, Jan 07, 2014 at 11:21:41PM +0200, Mantas Mikulėnas wrote:
> On Tue, Jan 7, 2014 at 11:19 PM, Warpme <warpme at o2.pl> wrote:
> > On 06/01/14 21:52, Zbigniew Jędrzejewski-Szmek wrote:
> >>
> >> journalctl -o verbose for mysqld-check.sh
> >
> > Zbyszku,
> >
> > Here is output for 'journalctl SYSLOG_IDENTIFIER=mysqld-check.sh -o verbose'
> >
> > Sat 2014-01-04 23:32:07.364159 CET
> > [s=bd641dc956b04278a26115fa814b910a;i=4365;b=1fad31caaf1e48348c9d4403b7d68ff6;m=2689289;t=4ef2c98c3163f;x=dc153004a
> >     _TRANSPORT=stdout
> >     PRIORITY=6
> >     SYSLOG_FACILITY=3
> >     _UID=0
> >     _GID=0
> >     _MACHINE_ID=beb0f0a1c2c303b17213bb8d4a87a3a6
> >     _HOSTNAME=mythtv
> >     _CAP_EFFECTIVE=1fffffffff
> >     _BOOT_ID=1fad31caaf1e48348c9d4403b7d68ff6
> >     SYSLOG_IDENTIFIER=mysqld-check.sh
> >     MESSAGE=--> mysqld: No need to check MythTV DB. Stop was clean...
> >     _PID=807
> >     _COMM=mysqld-check.sh
> >
> > And here is exemplary output for mysqld:
> >
> > Mon 2014-01-06 16:24:36.037183 CET
> > [s=6d5ef6e5ef9e413fbcb7fca114dd8465;i=43cb;b=5bbb0bb34be64b14886ed38600badb66;m=41e23ff;t=4ef4edb81a63f;x=b9e5fbfb9
> >     _TRANSPORT=stdout
> >     PRIORITY=6
> >     SYSLOG_FACILITY=3
> >     _UID=0
> >     _GID=0
> >     _SYSTEMD_SLICE=system.slice
> >     _MACHINE_ID=beb0f0a1c2c303b17213bb8d4a87a3a6
> >     _HOSTNAME=mythtv
> >     _CAP_EFFECTIVE=1fffffffff
> >     SYSLOG_IDENTIFIER=su
> >     _COMM=su
> >     _EXE=/bin/su
> >     _CMDLINE=/bin/su mysql -c /usr/bin/mysqld
> > --defaults-file=/etc/mysql/my.cnf --datadir=/var/lib/mysql
> > --socket=/var/run/mysqld/mysqld.sock
> >     _SYSTEMD_CGROUP=/system.slice/mysqld.service
> >     _SYSTEMD_UNIT=mysqld.service
> >     _BOOT_ID=5bbb0bb34be64b14886ed38600badb66
> >     _PID=1478
> >     MESSAGE=Version: '5.5.24'  socket: '/var/run/mysqld/mysqld.sock'  port:
> > 3306  Source distribution
> 
> It could be that the script exits before journald has a chance to read
> its cgroup information.
That's what I'd guess too. Does is get "fixed" if you insert 'sleep 1' in
mysql-check.sh before it exits?

This seems likely because the output suggests that the script is short-lived.
> >     SYSLOG_IDENTIFIER=mysqld-check.sh
> >     MESSAGE=--> mysqld: No need to check MythTV DB. Stop was clean...

> – it's a known limitation which AFAIK needs
> minor kernel changes (or maybe kdbus?)
The addition of additional information in the style of SO_CREDENTIALS
for normal sockets was rejected by Eric Biederman with "I don't like you"
as an explanation. So going through kdbus is the next option.

Zbyszek


More information about the systemd-devel mailing list