Bug 920548

Summary: systemd fills my logfiles with spam messages
Product: [openSUSE] openSUSE 13.1 Reporter: Mathias Homann <Mathias.Homann>
Component: BasesystemAssignee: E-mail List <bnc-team-screening>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: chcao, fstrba, Mathias.Homann, support, systemd-maintainers, thomas.blume
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 13.1   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Mathias Homann 2015-03-04 09:13:42 UTC
After the last systemd updates I have been getting litterally hundreds of the same message in /var/log/messages:

2015-03-03T14:48:01.259653+01:00 akari systemd[29487]: Failed to open private bus connection: Failed to connect to socket /run/user/0/dbus/user_bus_socket: No such file or directory

Where do I turn that off, and why is that suppose to tell me?
Comment 1 Dr. Werner Fink 2015-03-04 09:40:04 UTC
/run/user/0/dbus/ nore /run/user/0/dbus/user_bus_socket does not belong to systemd, the systemd socket is /run/user/0/systemd/private.  Even if systemd journald collects and forward the log messages
Comment 2 Mathias Homann 2015-03-04 09:52:54 UTC
So why is systemd (or whoever) trying to open that socket if it doesn't exist?
Comment 3 Mathias Homann 2015-03-04 09:59:10 UTC
that being said, there is no private dbus socket for root anyways:

akari:~ # find /run/user -! -type d
/run/user/10002/systemd/private
/run/user/490/systemd/private
/run/user/1000/systemd/private
akari:~ #
Comment 4 Dr. Werner Fink 2015-03-04 10:15:28 UTC
 linux:~ #  find /run/user -! -type d
 /run/user/0/systemd/private
 linux:~ # fuser /run/user/0/systemd/private
 /run/user/0/systemd/private: 31461
 linux:~ # ps 31461
   PID TTY      STAT   TIME COMMAND
 31461 ?        Ss     0:00 /usr/lib/systemd/systemd --user

Beside this

 linux:~ # grep -rs ListenStream= /usr/lib/systemd
 /usr/lib/systemd/system/rpcbind.socket:ListenStream=/run/rpcbind.sock
 /usr/lib/systemd/system/rpcbind.socket:ListenStream=0.0.0.0:111
 /usr/lib/systemd/system/rpcbind.socket:ListenStream=[::]:111
 /usr/lib/systemd/system/lvm2-lvmetad.socket:ListenStream=/run/lvm/lvmetad.socket
 /usr/lib/systemd/system/systemd-journal-gatewayd.socket:ListenStream=19531
 /usr/lib/systemd/system/pcscd.socket:ListenStream=/var/run/pcscd/pcscd.comm
 /usr/lib/systemd/system/cups.socket:ListenStream=/var/run/cups/cups.sock
 /usr/lib/systemd/system/cups.socket:ListenStream=631
 /usr/lib/systemd/system/avahi-daemon.socket:ListenStream=/run/avahi-daemon/socket
 /usr/lib/systemd/system/dbus.socket:ListenStream=/run/dbus/system_bus_socket
 /usr/lib/systemd/system/systemd-journald.socket:ListenStream=/run/systemd/journal/stdout

shows that socket for dbus is /run/dbus/system_bus_socket .... I've no idea which application triy to connect to /run/user/0/dbus/user_bus_socket.  Maybe this is a third party tool using dbus and was compiled against an other dbus package:

  https://bugs.freedesktop.org/show_bug.cgi?id=61301
  https://bugs.freedesktop.org/show_bug.cgi?id=61303
Comment 5 Mathias Homann 2015-03-04 10:46:45 UTC
I don't have a /run/user/0 folder structure, and I don't have the matching systemd --user process either... possibly because my server is running in textmode (multi-user.target is the default), and root is not logged in locally either.
Comment 6 Mathias Homann 2015-03-04 10:50:21 UTC
here's some additional info from another server:

v22014011974116376:~ # journalctl _PID=11900
-- Logs begin at Sat 2015-02-28 08:45:01 CET, end at Wed 2015-03-04 11:48:17 CET. --
Mar 01 13:10:01 v22014011974116376 /usr/sbin/cron[11900]: pam_unix(crond:session): session opened for user root by (uid=0)
Mar 01 13:10:02 v22014011974116376 /USR/SBIN/CRON[11900]: pam_unix(crond:session): session closed for user root
Mar 03 20:45:01 v22014011974116376 systemd[11900]: pam_unix(systemd-user:session): session opened for user wwwrun by (uid=0)
Mar 03 20:45:01 v22014011974116376 systemd[11900]: Failed to open private bus connection: Failed to connect to socket /run/user/30/dbus/user_bus_socket: No su
Mar 03 20:45:01 v22014011974116376 systemd[11900]: Starting Default.
Mar 03 20:45:01 v22014011974116376 systemd[11900]: Reached target Default.
Mar 03 20:45:01 v22014011974116376 systemd[11900]: Startup finished in 76ms.
Mar 03 20:45:07 v22014011974116376 systemd[11900]: Stopping Default.
Mar 03 20:45:07 v22014011974116376 systemd[11900]: Stopped target Default.
Mar 03 20:45:07 v22014011974116376 systemd[11900]: Starting Shutdown.
Mar 03 20:45:07 v22014011974116376 systemd[11900]: Reached target Shutdown.
Mar 03 20:45:07 v22014011974116376 systemd[11900]: Starting Exit the Session...
Mar 03 20:45:07 v22014011974116376 systemd[11900]: Started Exit the Session.
Mar 03 20:45:07 v22014011974116376 systemd[11900]: Starting Exit the Session.
Mar 03 20:45:07 v22014011974116376 systemd[11900]: Reached target Exit the Session.
v22014011974116376:~ # crontab -u wwwrun -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.J7MBWc installed on Tue Feb 10 12:45:02 2015)
# (Cronie version 4.2)
*/15 * * * * /usr/bin/php -f /srv/www/htdocs/owncloud/cron.php
Comment 7 Dr. Werner Fink 2015-03-04 11:07:09 UTC
That is a tmpfs, aka a memory based file system:

 linux:~ # df /run
 Filesystem     1K-blocks  Used Available Use% Mounted on
 tmpfs            1027248  1896   1025352   1% /run

log in as root and do

 linux:~ # echo $XDG_RUNTIME_DIR 
 /run/user/0

that is if root requires to have a /run/user/0 it will be created by the session managment.

Beside this you may run

  grep -irs user_bus_socket /srv/www/

and see if something is found ;)
Comment 8 Mathias Homann 2015-03-04 12:05:52 UTC
ok, so /run/user/0 does in fact exist, but that doesn't explain why a cronjob triggers an access to a dbus socket that does not exist...
Comment 9 Dr. Werner Fink 2015-03-04 12:54:12 UTC
(In reply to Mathias Homann from comment #8)

The cronjob is third party AFAICS from your comment #6
Comment 10 Dr. Werner Fink 2015-03-04 13:22:21 UTC
As root you may run

 : ${PRUNEFS="nfs NFS nfs4 afs proc smbfs devtmpfs iso9660 ncpfs coda devpts ftpfs devfs mfs sysfs shfs cifs"}
 prunefs_exp=$(echo $PRUNEFS |sed -re 's/([^ ][^ ]*)/-fstype \1 -o/g')
 find / -type d \( $prunefs_exp -fstype autofs \) -prune -o -print | xargs grep -s user_bus_socket

but be aware that this does scan every local file on your system for the string user_bus_socket.
Usage at your own risk
Comment 12 Mathias Homann 2015-03-06 09:20:44 UTC
(In reply to Werner Fink from comment #9)
> (In reply to Mathias Homann from comment #8)
> 
> The cronjob is third party AFAICS from your comment #6

the cron job is part of the owncloud packages that are provided on OBS.
Comment 13 Mathias Homann 2015-03-06 09:26:46 UTC
found this:

akari:~ # find / -type d \( $prunefs_exp -fstype autofs \) -prune -o -print | xargs grep -s user_bus_socket
/usr/lib/systemd/system/user@.service:Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%I/dbus/user_bus_socket

which is part of systemd-208-32 from the last updates.
Comment 14 Dr. Werner Fink 2015-03-06 09:54:11 UTC
(In reply to Mathias Homann from comment #13)

You may consider an update to openSUSE 13.2 with systemd-210 or systemd-210 from Base:System:Legacy, see http://download.opensuse.org/repositories/Base:/System:/Legacy/openSUSE_13.1/

For systemd-208 there will be no update as this had caused a lot of trouble in past :(
Comment 15 Thomas Blume 2015-03-06 11:12:07 UTC
(In reply to Werner Fink from comment #14)
> (In reply to Mathias Homann from comment #13)
> 
> You may consider an update to openSUSE 13.2 with systemd-210 or systemd-210
> from Base:System:Legacy, see
> http://download.opensuse.org/repositories/Base:/System:/Legacy/openSUSE_13.1/
> 
> For systemd-208 there will be no update as this had caused a lot of trouble
> in past :(

systemd-208 is simply too old for upstream patches.
Backports get too complex and can cause severe side effects.
Mathias, you were in cc in bug 918226 and know what can happen.
If you want to stay with you current systemd version, you should consider using one of the workarounds mentioned in bug 918226.
Comment 16 Mathias Homann 2015-03-06 13:28:26 UTC
"WONTFIX"? I didn't know 13.1 was already end-of-life... anyway I believe that if the underlying problem in systemd can't be easily fixed in 13.1 then at least the various workarounds that minimize the effects of the problem should be rolled out as a package.
Comment 17 Mathias Homann 2015-03-06 13:29:24 UTC
which info did you actually need?
Comment 18 Thomas Blume 2015-03-06 14:00:07 UTC
(In reply to Mathias Homann from comment #16)
> "WONTFIX"? I didn't know 13.1 was already end-of-life... 

WONTFIX, because a fix is too risky and complex and there is a bunch of alternatives available.

> anyway I believe
> that if the underlying problem in systemd can't be easily fixed in 13.1 then
> at least the various workarounds that minimize the effects of the problem
> should be rolled out as a package.

Considering the alternatives, I don't see the need for this.
However, this is a community project, you are welcome to provide such a package. 
But much simpler is if you just update to OpenSUSE 13.2.
This is shipping systemd version 210 with a huge amount of code enhancements.
Still, if you experience the same problem with 13.2, please open a new bug.
For 13.2, we can do a fix if necessary.

(In reply to Mathias Homann from comment #17)
> which info did you actually need?

Werner was asking to test systemd version 210, that is available for 13.1 at:

http://download.opensuse.org/repositories/Base:/System:/Legacy/openSUSE_13.1/
Comment 19 Don Hughes 2015-04-08 21:28:56 UTC
Since I recently applied the recommended security patches to my 13.1 systems, I am also seeing a huge amount of these messages and an occasional segfault.

Is the only fix to either downgrade systemd or upgrade to 210?
Comment 20 Thomas Blume 2015-04-09 06:40:06 UTC
(In reply to Don Hughes from comment #19)
> Since I recently applied the recommended security patches to my 13.1
> systems, I am also seeing a huge amount of these messages and an occasional
> segfault.
> 
> Is the only fix to either downgrade systemd or upgrade to 210?

Please try the testpackages provided in Bug 922536.
They also addresses the superfluous log messages.

*** This bug has been marked as a duplicate of bug 922536 ***