[systemd-devel] Can't make local user.conf work

Guido D'Arezzo gdarrezzo at gmail.com
Fri Feb 26 03:06:28 UTC 2016


Hello, I’m trying to run user systemd services with DefaultEnvironment set
in a user.conf under $HOME/.config/systemd/ but it isn't being read.
The only .conf files I have seen being read are /etc/systemd/user.conf and
/etc/systemd/user.conf.d/*.conf

It should work, according to this page (under Environment Variables):
https://wiki.archlinux.org/index.php/Systemd/User

and these words (though I can't find many other references to its use):

    "You can use DefaultEnvironment in user.conf, and place that either in
    /etc/systemd/user.conf, or in ~/.config/systemd/user.conf."

        https://lists.freedesktop.org/archives/systemd-devel/2014-March/017514.html


This doesn't mention user.conf but does it mean any .conf files in or under
there should be read?

    "Additionally, --user also adds the home-directory of the user as
    source: ~/.config/systemd/user/"

        https://lists.freedesktop.org/archives/systemd-devel/2014-August/022745.html

but the suggestion later on

    "to create a file in:
      ~/.config/systemd/user/your_service.conf.d/your_drop_in_file.conf"

and in man systemd.unit

        Along with a unit file foo.service, a directory
       foo.service.d/ may exist. All files with the suffix ".conf"
       from this directory will be parsed after the file itself is
       parsed. This is useful to alter or add configuration settings
       to a unit, without having to modify their unit files. Make
       sure that the file that is included has the appropriate
       section headers before any directive.

fails with systemctl complaining about the .conf file heading:
    Unknown section 'Manager'

I'm a bit confused because man systemd.unit talks about "configuration
files" when referring to unit files rather than (or as well as) .conf files.
For the user mode load paths, the man page has
    /etc/systemd/user               | Local configuration
but again, any .conf files in that directory are ignored.

This is systemd 228 on Arch Linux


More information about the systemd-devel mailing list