0

My distro is RHEL 8.6. By default, all user's unit files are put in the /home/myuser/.config/systemd/user directory, then systemctl --user daemon-reload make them available. My question is how I change the directory to another one, says /opt/home/myuser/.config/systemd/user.

I found this: Where do I put my systemd unit file? and this: custom location for systemd services, but whatever variables I set, XDG_CONFIG_HOME, XDG_DATA_DIRS.... nothing works. systemctl still doesn't try to load unit file from my custom path.

Please help, thanks a lot.

  • 1
    Symlink that to wherever your actual home directory is. Where is your home directory? – muru Nov 15 '23 at 01:10
  • Because of this issue, all files including symbolic links under the user's home which is on NFS have to be avoided. And by the way, the workaround Redhat gave is not working at all, the modification screw systemd-logind to 100% CPU. – Luke Huang Nov 15 '23 at 01:26
  • I can't see the workaround (no subscription), but I think the suggestions in the bug report should work. – muru Nov 15 '23 at 01:29
  • Unfortunately, there might be another bug, adding RequiresMountsFor=/home/myuser into /etc/systemd/system/user@.service.d/home.conf, the system is screwed, systemd-logind jumped to 100% CPU, anything related to systemd stopped working. – Luke Huang Nov 15 '23 at 01:57
  • Hmm, what if you set the XDG variables in user@.service (assuming that manages the user session, I'll have to check)? – muru Nov 15 '23 at 02:18
  • OK, thanks @muru, will try later. – Luke Huang Nov 16 '23 at 01:12

0 Answers0