Page MenuHomeDevCentral

systemd-hostnamed service can't be launched - SELinux blocks it
Open, NormalPublic

Description

Fun issue with SELinux when spawning a shell with starship requiring the hostname through system-hostnamed service:

Dwellers
$ journalctl -f
[…]
May 18 08:53:20 dwellers.nasqueron.org systemd[1]: Starting systemd-hostnamed.service - Hostname Service...
May 18 08:53:21 dwellers.nasqueron.org audit[3059878]: AVC avc:  denied  { create } for  pid=3059878 comm="systemd-hostnam" name="io.systemd.Hostname" scontext=system_u:system_r:systemd_hostnamed_t:s0 tcontext=system_u:object_r:init_var_run_t:s0 tclass=sock_file permissive=0
May 18 08:53:21 dwellers.nasqueron.org audit[3059878]: SYSCALL arch=c000003e syscall=49 success=no exit=-13 a0=8 a1=7ffe68d1cf90 a2=23 a3=561c08c0e010 items=0 ppid=1 pid=3059878 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="systemd-hostnam" exe="/usr/lib/systemd/systemd-hostnamed" subj=system_u:system_r:systemd_hostnamed_t:s0 key=(null)
May 18 08:53:21 dwellers.nasqueron.org audit: PROCTITLE proctitle="/usr/lib/systemd/systemd-hostnamed"
May 18 08:53:21 dwellers.nasqueron.org systemd-hostnamed[3059878]: Failed to bind to Varlink socket: Permission denied
May 18 08:53:21 dwellers.nasqueron.org systemd[1]: systemd-hostnamed.service: Main process exited, code=exited, status=1/FAILURE
May 18 08:53:21 dwellers.nasqueron.org systemd[1]: systemd-hostnamed.service: Failed with result 'exit-code'.
May 18 08:53:21 dwellers.nasqueron.org systemd[1]: Failed to start systemd-hostnamed.service - Hostname Service.
[…]

Event Timeline

dereckson triaged this task as Normal priority.Sun, May 18, 08:55
dereckson created this task.