How to totally get rid of systemd-hostnamed?

Hi.
I have disabled (or to be more precise: masked) systemd-hostnamed and all is fine, execept for the fact that the in the journal log I often see these warnings:

feb 20 14:55:31 hal9000 NetworkManager[289]: <info>  [1613829331.9855] hostname: hostname: hostnamed not used as proxy creation failed with: Error calling StartServiceByName for org.freedesktop.hostname1: Unit dbus-org.freedesktop.hostname1.service is masked.
feb 20 14:56:53 hal9000 NetworkManager[267]: <info>  [1613829413.7662] hostname: hostname: hostnamed not used as proxy creation failed with: Error calling StartServiceByName for org.freedesktop.hostname1: Unit dbus-org.freedesktop.hostname1.service is masked.

Is similar to what I have encountered when disabling systemd-homed:

Systemd-homed annoyance (when disabled, the journal log is literally spammed) - #2 by xabbu

In such case an user, @xabbu , indicated me to rename /etc/pam.d/pam_systemd_home.so to /etc/pam.d/pam_systemd_home.so.bak for avoid the continuos warning message in the journal log; there is a way for doing the same for systemd-hostnamed?

I see that the warning come from NetworkManager; so maybe I have to make something in /etc/NetworkManager/conf.d/ directory? Eg here I have made a conf file /etc/NetworkManager/conf.d/no-systemd-resolved.conf since I also got rid of systemd-resolved.

If I do a search, there are no results for systemd-hostnamed=false.

Please unmask systemd-hostnamed.service.
Nothing to do with homed.service AFAIK

Obviously has nothing to do with systemd-homed; I was asking how to avoid journal logs warning about systemd-hostnamed.
The system works fine with hostnamed masked; is just a “costmetic” thing of the journal log.

You probably can’t. It looks like it’s NetworkManager that looks for it, fails to find it, and tells you it fails to find it.

What is the difference when unmasking “systemd-hostnamed.service”
(its unmasked in my gnome-system)

Is an unit which I don’t need; when is unmasked (is a static unit, so the masking is the way for disabling it) no warning about this in the log, but futhermore, it increase the startup time.
On my system I have disabled everything that I don’t need and haven’t bork anything.

Details of dependency with networkmanager - so :

Unit-File of "systemd-hostname.service"
# SPDX-License-Identifier: LGPL-2.1-or-later

#

# 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.

[Unit]

Description=Hostname Service

Documentation=man:systemd-hostnamed.service(8)

Documentation=man:hostname(5)

Documentation=man:machine-info(5)

Documentation=man:org.freedesktop.resolve1(5)

[Service]

BusName=org.freedesktop.hostname1

CapabilityBoundingSet=CAP_SYS_ADMIN

ExecStart=/usr/lib/systemd/systemd-hostnamed

IPAddressDeny=any

LockPersonality=yes

MemoryDenyWriteExecute=yes

NoNewPrivileges=yes

PrivateDevices=yes

PrivateNetwork=yes

PrivateTmp=yes

ProtectProc=invisible

ProtectControlGroups=yes

ProtectHome=yes

ProtectKernelLogs=yes

ProtectKernelModules=yes

ProtectKernelTunables=yes

ProtectSystem=strict

ReadWritePaths=/etc

RestrictAddressFamilies=AF_UNIX

RestrictNamespaces=yes

RestrictRealtime=yes

RestrictSUIDSGID=yes

SystemCallArchitectures=native

SystemCallErrorNumber=EPERM

SystemCallFilter=@system-service sethostname

WatchdogSec=3min

Dieser Text wird ausgeblendet

Hihi, and what the system needs is irrelevant?

My journald says: systemd[1]: systemd-hostnamed.service: Succeeded.
One entry. no more.
Probably you have killed parts of important dependencies??
Even egoists are NOT alone :innocent:

systemd-hostnamed.service

systemd-hostnamed.service is a system service that may be used to change the system’s hostname

My hostname is already set from /etc/hostname; in facts if I do an ARP scan on my LAN, I can however see the hostname.

With systemd-hostnamed I cannot change the hostname using hostnamectl; if I want change the hostname I just change it in /etc/hostname.

Because is not masked; if you read more accurately my first post, you’ll figure out that the warning occurs when is masked, and is a warning that only occurs once, on startup.

You must decide: warning or no warning?!

My journald:

dbus-daemon[665]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.109' (uid=1000 pid=4742 comm="qjournalctl 
```
dbus-daemon[665]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.3' (uid=0 pid=666 comm="/usr/bin/NetworkManager --no-daemon ")

In facts I was asking if there could be a way to avoid the warning with the masked unit. Is clearly stated in my post.

Answer is: NO
EDIT:
What do you not understand about NO
(Coffe-machine does not work without water - although you only want to drink coffee)
((or, question: how to get fried snowballs)

Did you see this in the dependencies
“ExecStart=/usr/lib/systemd/systemd-hostnamed” how about hashing that out?

1 Like

Firstly is not the right method directly edit a systemd unit in /usr/lib/systemd; there are proper and better ways:

https://wiki.archlinux.org/index.php/systemd#Editing_provided_units

However I tried (by replicating such unit as suggested in the Arch Wiki) but doesn’t help: I still get the warning message about such unit with an error about starting timeout.

Also dbus-daemon looks for it; this also occurs when I launch catfish files search:

feb 22 10:11:25 hal9000 dbus-daemon[266]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.682' (uid=1000 pid=650048 comm="/usr/bin/python /usr/bin/catfish ")
feb 22 10:11:25 hal9000 dbus-daemon[266]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.hostname1.service': Unit dbus-org.freedesktop.hostname1.service is masked.