mirror of
https://github.com/nater1983/hostnamed.git
synced 2026-06-25 02:20:42 +02:00
No description
- C 76.9%
- Shell 15.3%
- Meson 7.8%
| data | ||
| man | ||
| po | ||
| slack | ||
| src | ||
| AUTHORS | ||
| BUGS-NEWS | ||
| COPYING | ||
| hostnamed.SlackBuild | ||
| meson.build | ||
| meson_options.txt | ||
| NEWS | ||
| README.md | ||
hostnamed
A lightweight implementation of the org.freedesktop.hostname1 D-Bus service
(hostnamed), following the same daemon pattern as timedated.
Dependencies
| Library | pkg-config name | Minimum version |
|---|---|---|
| GLib / GIO | glib-2.0, gio-2.0, gio-unix-2.0 |
2.56 |
| polkit | polkit-gobject-1 |
0.113 |
| D-Bus | dbus-1 |
any recent |
The daemon is activated by dbus-daemon directly via D-Bus service activation
([D-BUS Service]). There is no systemd dependency.
On Debian/Ubuntu:
apt install libglib2.0-dev libpolkit-gobject-1-dev libdbus-1-dev \
meson ninja-build pkg-config
On Fedora/RHEL:
dnf install glib2-devel polkit-devel dbus-devel \
meson ninja-build pkg-config
Building
meson setup build
ninja -C build
Common configure options:
# Install under /usr instead of /usr/local
meson setup build --prefix=/usr
# Disable polkit (for testing only – not for production)
meson setup build -Dpolkit=disabled
# Override the D-Bus service directory explicitly
meson setup build -Ddbus_system_service_dir=/usr/share/dbus-1/system-services
Installing
ninja -C build install # installs to prefix (default /usr/local)
sudo ninja -C build install # for system-wide install
Project layout
.
├── meson.build # top-level build definition
├── meson_options.txt # user-settable options (-D flags)
├── src/
│ ├── meson.build # compiles the hostnamed binary
│ ├── main.c # GMainLoop, D-Bus name ownership, inotify watches
│ ├── rcl-hostname.h # public interface: types, macros, path constants
│ └── rcl-hostname.c # D-Bus skeleton, property sync, polkit, file I/O
├── data/
│ ├── meson.build # installs D-Bus and polkit data files
│ ├── org.freedesktop.hostname1.service.in # D-Bus activation
│ ├── org.freedesktop.hostname1.conf # D-Bus security policy
│ └── org.freedesktop.hostname1.policy # polkit actions
└── po/
├── meson.build # gettext / i18n integration
├── POTFILES # source files with translatable strings
└── LINGUAS # enabled translation languages
D-Bus interface quick reference
# Read all properties
busctl get-property org.freedesktop.hostname1 \
/org/freedesktop/hostname1 org.freedesktop.hostname1 Hostname
# Set static hostname (triggers polkit prompt)
busctl call org.freedesktop.hostname1 \
/org/freedesktop/hostname1 org.freedesktop.hostname1 \
SetStaticHostname sb myhost true
# Dump everything as JSON
busctl call org.freedesktop.hostname1 \
/org/freedesktop/hostname1 org.freedesktop.hostname1 Describe
Adding a translation
- Add the language code to
po/LINGUAS(one code per line). - Generate an initial
.pofile:ninja -C build hostnamed-pot msginit -l de -o po/de.po -i po/hostnamed.pot - Translate the strings in
po/de.po. - Rebuild – Meson compiles and installs
.mofiles automatically.