You are not logged in.

#1 2025-11-19 21:52:26

gabx
Member
From: Geneva, Switzerland
Registered: 2011-11-20
Posts: 237
Website

[SOLVED]systemctl user environment

I found an issue in the environment variables read by systemd.

% systemctl --user show-environment | grep HOME
2:HOME=/
7:SYSTEMD_HOME=1
8:SYSTEMD_HOME_SUSPEND=0

which is obviously not good. Now I run:

$ systemctl --user import-environment HOME
% systemctl --user show-environment | grep HOME
2:HOME=/home/gabx

which is correct. Now, it has gone after a reboot and can't find a proper way to set it permanently. I edited a ~/.config/environment.d/10-envars.conf as suggested in the systemd/user Archwiki.
My file contains: HOME=/home/gabx, but it is not taken into account by systemd.

What is the proper way to fix across reboot the systemd HOME environment variable?

Last edited by gabx (2025-11-20 12:10:01)

Offline

#2 2025-11-19 22:31:13

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,538

Re: [SOLVED]systemctl user environment

Possibly long-term outfall from https://bbs.archlinux.org/viewtopic.php?id=305817 ?
https://man.archlinux.org/man/pam_syste … NVIRONMENT

pacman -Qikk pam pambase
grep gab /etc/passwd

Offline

#3 2025-11-19 22:45:30

gabx
Member
From: Geneva, Switzerland
Registered: 2011-11-20
Posts: 237
Website

Re: [SOLVED]systemctl user environment

gabx@magnolia ➤➤ ~ % pacman -Qikk pam pambase
Name            : pam
Version         : 1.7.1-1
Description     : PAM (Pluggable Authentication Modules) library
Architecture    : x86_64
URL             : http://linux-pam.org
Licenses        : GPL-2.0-only
Groups          : None
Provides        : libpam.so=0-64  libpamc.so=0-64  libpam_misc.so=0-64
Depends On      : audit  glibc  libaudit.so=1-64  libcrypt.so=2-64  libnsl  libtirpc  libxcrypt  pambase  systemd-libs
Optional Deps   : None
Required By     : apparmor  cifs-utils  cosmic-greeter  cups  freerdp  gdm  gnome-keyring  greetd  kbd  libcap  libpwquality  malcontent  openssh  polkit  qemu-img  qemu-pr-helper  qemu-system-aarch64  qemu-system-alpha
                  qemu-system-arm  qemu-system-avr  qemu-system-hppa  qemu-system-loongarch64  qemu-system-m68k  qemu-system-microblaze  qemu-system-mips  qemu-system-or1k  qemu-system-ppc  qemu-system-riscv  qemu-system-rx
                  qemu-system-s390x  qemu-system-sh4  qemu-system-sparc  qemu-system-tricore  qemu-system-x86  qemu-system-xtensa  qemu-vmsr-helper  shadow  sudo  systemd  util-linux
Optional For    : snapper
Conflicts With  : None
Replaces        : None
Installed Size  : 2.91 MiB
Packager        : Tobias Powalowski <tpowa@archlinux.org>
Build Date      : Thu 19 Jun 2025 10:48:05 AM CEST
Install Date    : Mon 21 Jul 2025 06:56:21 PM CEST
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature

pam: 602 total files, 0 altered files
Name            : pambase
Version         : 20250719-1
Description     : Base PAM configuration for services
Architecture    : any
URL             : https://www.archlinux.org
Licenses        : GPL-3.0-or-later
Groups          : None
Provides        : None
Depends On      : None
Optional Deps   : None
Required By     : pam
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 2.73 KiB
Packager        : David Runge <dvzrv@archlinux.org>
Build Date      : Sat 19 Jul 2025 01:20:35 PM CEST
Install Date    : Fri 15 Aug 2025 02:49:05 PM CEST
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature

pambase: 8 total files, 0 altered files

---
gabx@magnolia ➤➤ ~ % grep gabx /etc/passwd
gabx@magnolia ➤➤ ~ % grep gab /etc/passwd

I see your point of view, and yes it maybe due to my issues with homectl. But how can I fix it?

Last edited by gabx (2025-11-19 22:57:29)

Offline

#4 2025-11-20 08:37:54

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,538

Re: [SOLVED]systemctl user environment

gabx@magnolia ➤➤ ~ % grep gabx /etc/passwd
gabx@magnolia ➤➤ ~ % grep gab /etc/passwd

Your using not having entries in /etc/passwd is a major problem - what does that file look like (despite the name there's no passwords in there since 3 decades or so)
You're probably still somehow™ relying on homed??

id
cat /etc/passwd

Offline

#5 2025-11-20 11:12:02

gabx
Member
From: Geneva, Switzerland
Registered: 2011-11-20
Posts: 237
Website

Re: [SOLVED]systemctl user environment

gabx@magnolia ➤➤ ~ % id
uid=1000(gabx) gid=1000(gabx) groups=1000(gabx),954(adbusers),998(wheel)
gabx@magnolia ➤➤ ~ % cat /etc/passwd
root:x:0:0::/root:/usr/bin/bash
bin:x:1:1::/:/usr/bin/nologin
daemon:x:2:2::/:/usr/bin/nologin
mail:x:8:12::/var/spool/mail:/usr/bin/nologin
ftp:x:14:11::/srv/ftp:/usr/bin/nologin
rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/usr/bin/nologin
http:x:33:33::/srv/http:/usr/bin/nologin
named:x:40:40:BIND DNS Server:/:/usr/bin/nologin
uuidd:x:68:68::/:/usr/bin/nologin
dbus:x:81:81:System Message Bus:/:/usr/bin/nologin
polkitd:x:102:102:User for polkitd:/:/usr/bin/nologin
gdm:x:120:120:Gnome Display Manager:/var/lib/gdm:/usr/bin/nologin
rtkit:x:133:133:RealtimeKit:/proc:/usr/bin/nologin
usbmux:x:140:140:usbmux user:/:/usr/bin/nologin
cups:x:209:209:cups helper user:/:/usr/bin/nologin
pcscd:x:948:948:PC/SC Smart Card Daemon:/:/usr/bin/nologin
open-webui:x:951:951::/opt/open-webui:/bin/false
ollama:x:952:952:ollama user:/var/lib/ollama:/usr/bin/nologin
gluster:x:953:953:GlusterFS daemons:/var/run/gluster:/usr/bin/nologin
alpm:x:955:955:Arch Linux Package Management:/:/usr/bin/nologin
greeter:x:956:956:greetd greeter user:/:/bin/bash
cosmic-greeter:x:957:957:Cosmic Greeter Account:/var/lib/cosmic-greeter:/usr/bin/nologin
passim:x:959:959:Local Caching Server:/usr/share/empty:/usr/bin/nologin
fwupd:x:960:960:Firmware update daemon:/var/lib/fwupd:/usr/bin/nologin
saned:x:961:961:SANE daemon user:/:/usr/bin/nologin
qemu:x:962:962:QEMU user:/:/usr/bin/nologin
libvirt-qemu:x:963:963:Libvirt QEMU user:/:/usr/bin/nologin
gnome-remote-desktop:x:964:964:GNOME Remote Desktop:/var/lib/gnome-remote-desktop:/usr/bin/nologin
geoclue:x:965:965:Geoinformation service:/var/lib/geoclue:/usr/bin/nologin
flatpak:x:966:966:Flatpak system helper:/:/usr/bin/nologin
colord:x:967:967:Color management daemon:/var/lib/colord:/usr/bin/nologin
brltty:x:968:968:Braille Device Daemon:/var/lib/brltty:/usr/bin/nologin
avahi:x:969:969:Avahi mDNS/DNS-SD daemon:/:/usr/bin/nologin
git:x:972:972:git daemon user:/:/usr/bin/git-shell
dhcpcd:x:973:973:dhcpcd privilege separation:/:/usr/bin/nologin
tss:x:974:974:tss user for tpm2:/:/usr/bin/nologin
systemd-timesync:x:975:975:systemd Time Synchronization:/:/usr/bin/nologin
systemd-resolve:x:976:976:systemd Resolver:/:/usr/bin/nologin
systemd-journal-remote:x:977:977:systemd Journal Remote:/:/usr/bin/nologin
systemd-oom:x:978:978:systemd Userspace OOM Killer:/:/usr/bin/nologin
systemd-network:x:979:979:systemd Network Management:/:/usr/bin/nologin
systemd-coredump:x:980:980:systemd Core Dumper:/:/usr/bin/nologin
nobody:x:65534:65534:Kernel Overflow User:/:/usr/bin/nologin
testo:x:1001:1001::/home/testo:/usr/bin/zsh

yes I manage my user home with systemd-homed

gabx@magnolia ➤➤ ~ % homectl inspect gabx
   User name: gabx
       State: active
 Disposition: regular
 Last Change: Thu 2025-11-13 02:40:19 CET
 Last Passw.: Mon 2025-06-16 22:35:25 CEST
    Login OK: yes
 Password OK: yes
         UID: 1000
         GID: 1000 (gabx)
 Aux. Groups: wheel
              adbusers
              gabx
              wheel
              gabx
   Real Name: Arno Gaboury
   Directory: /home/gabx
   Blob Dir.: /var/cache/systemd/home/gabx
              └─ login-background (5af954f1f89918fc5abe47cc3404a7fc1d87b39efb129cda00281ecda3e423e9)
     Storage: subvolume (no encryption)
  Image Path: /home/gabx.homedir
   Removable: no
       Shell: /usr/bin/zsh
       Email: arnaud.gaboury@gmail.com
 Mount Flags: nosuid nodev exec
   Disk Size: 930.5G
   Disk Free: 525.1G (= 56.4%)
  Disk Floor: 5M
Disk Ceiling: 5T
  Good Auth.: 812
   Last Good: Thu 2025-11-20 11:38:20 CET
   Bad Auth.: 846
    Last Bad: Thu 2025-11-20 00:32:56 CET
    Next Try: anytime
 Auth. Limit: 30 attempts per 1min
   Passwords: 1
  Local Sig.: yes
     Service: io.systemd.Home

Offline

#6 2025-11-20 12:09:39

gabx
Member
From: Geneva, Switzerland
Registered: 2011-11-20
Posts: 237
Website

Re: [SOLVED]systemctl user environment

Not sure what did unlock my issue (my ~/.config/environment.d/10-envars.conf ?), but after log out/log in:

gabx@magnolia ➤➤ ~ % systemctl --user show-environment | grep HOME
2:HOME=/home/gabx
7:SYSTEMD_HOME=1
8:SYSTEMD_HOME_SUSPEND=0

Offline

#7 2025-11-20 13:57:57

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 71,538

Re: [SOLVED]systemctl user environment

With

Directory: /home/gabx

I'm not even sure what would be the problem itfp, homed probably should™ set a proper $HOME…

Offline

Board footer

Powered by FluxBB