Bug 9424 - systemd tmpfiles.d warnings (volatile, resolv.conf)
Summary: systemd tmpfiles.d warnings (volatile, resolv.conf)
Status: RESOLVED OBSOLETE
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 2.1
Hardware: x86 Multiple
: Medium minor
Target Milestone: 4.1
Assignee: Pavel Zhukov
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-04-08 08:24 UTC by Patrick Ohly
Modified: 2022-06-09 11:25 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Ohly 2016-04-08 08:24:07 UTC
The systemd configuration in OE-core follows OE-core conventions where /var/tmp and /var/log are symlinks into /var/volatile, which gets mounted via 00-create-volatile.conf.

That works, but there are log messages about the setup in the systemd journal:

# journalctl | grep tmp
Apr 08 08:12:10 192.168.7.2 kernel: devtmpfs: initialized
Apr 08 08:12:10 192.168.7.2 systemd-tmpfiles[696]: [/usr/lib/tmpfiles.d/etc.conf:16] Duplicate line for path "/etc/resolv.conf", ignoring.
Apr 08 08:12:10 192.168.7.2 systemd-tmpfiles[696]: "/var/tmp" already exists and is not a directory.
Apr 08 08:12:10 192.168.7.2 systemd-tmpfiles[696]: "/var/log" already exists and is not a directory.

These messages can be confusing when investigating boot issues: they are harmless, but not everyone knows that.

It would be better to change the systemd configuration files so that these messages are avoided.
Comment 1 Bill Randle 2016-04-15 16:09:45 UTC
Patrick, can you include a copy of your /usr/lib/tmpfiles.d/etc.conf file? The version in master has only 14 lines in it, while yours appears to have 16 lines (at least).
Comment 2 Patrick Ohly 2016-04-15 19:10:25 UTC
Here's what I have:

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

# See tmpfiles.d(5) for details

L /etc/os-release - - - - ../usr/lib/os-release
L /etc/localtime - - - - ../usr/share/zoneinfo/UTC
L+ /etc/mtab - - - - ../proc/self/mounts
t /etc/mtab - - - - security.SMACK64=_
C /etc/nsswitch.conf - - - -
C /etc/pam.d - - - -
L! /etc/resolv.conf - - - - ../run/resolv.conf

Note that we enable pam in Ostro OS. That perhaps explains at least one additional line (/etc/pam.d).

resolv.conf is also conditional, checking PACKAGECONFIG resolved (seen in meta/recipes-core/systemd/systemd_229.bb).
Comment 3 Bill Randle 2016-04-15 20:31:23 UTC
Thanks. I have a fix for the /var/tmp and /var/log directory exists warnings. The duplicate entry for resolv.conf is there because (at least in my config) the connman package installs a systemd config file in /etc/tmpfiles.d which also has a rule for /etc/resolv.conf. There's really no easy way around that particular warning short of adding a conditional in /usr/lib/tmpfiles.d/etc.conf to check if connman is installed. I'm not sure we want to go to that effort.
Comment 4 Bill Randle 2016-04-15 22:34:56 UTC
Patch send to oe-core mailing list to fix the "directory exits" warning messages. As previously mentioned, you will still see the warning for duplicate /etc/resolv.conf entries, but I think this is reasonable.
Comment 5 Joshua Lock 2016-09-15 21:31:02 UTC
Patch was submitted but not merged http://lists.openembedded.org/pipermail/openembedded-core/2016-April/120308.html
Comment 6 Bill Randle 2016-09-17 03:10:15 UTC
Ross rejected the patch with a comment: http://lists.openembedded.org/pipermail/openembedded-core/2016-July/124013.html .

I believe the patch solves this specific bug, but multiple systemd patches have come in since April and perhaps it's not exactly right anymore. The OE files file does specify some specific rules for using /volatile instead of /var and I was trying to work within that framework. There was an ordering problem, for sure, where a subdir creation was attempted before the /volatile directory was created (as I recall) which caused the error messages the bug submitter saw.
Comment 7 Pavel Zhukov 2022-06-09 11:25:34 UTC
This issue has been solved in system already. Not reproducible with kiskstone.