diff options
| author | xengineering <me@xengineering.eu> | 2025-12-20 14:59:15 +0100 |
|---|---|---|
| committer | xengineering <me@xengineering.eu> | 2025-12-20 14:59:15 +0100 |
| commit | b1bd87926098e03ffd983666d0746055122854fd (patch) | |
| tree | 7fa825d503cfb5410db7b8bbd402e51c9d8debb1 /systemd | |
| parent | 5f3cd750b2867854a1e05f66312062426024f676 (diff) | |
| download | sia-server-b1bd87926098e03ffd983666d0746055122854fd.tar sia-server-b1bd87926098e03ffd983666d0746055122854fd.tar.zst sia-server-b1bd87926098e03ffd983666d0746055122854fd.zip | |
systemd: Add service and sysusers configuration files
This makes it possible to run the Sia server executable on systemd-based
Linux distributions with systemd making system administration easier.
Maintaining these files in the source instead of packaging repository
was decided since systemd is the dominant init system across Linux
distributions and thus not every distribution-specific packaging repo
needs to re-invent the wheel.
Diffstat (limited to 'systemd')
| -rw-r--r-- | systemd/meson.build | 4 | ||||
| -rw-r--r-- | systemd/sia-server-sysuser.conf | 1 | ||||
| -rw-r--r-- | systemd/sia-server.service | 12 |
3 files changed, 17 insertions, 0 deletions
diff --git a/systemd/meson.build b/systemd/meson.build new file mode 100644 index 0000000..5296400 --- /dev/null +++ b/systemd/meson.build @@ -0,0 +1,4 @@ +fs = import('fs') + +systemd_service = fs.copyfile(meson.current_source_dir() / 'sia-server.service') +sysuser_config = fs.copyfile(meson.current_source_dir() / 'sia-server-sysuser.conf') diff --git a/systemd/sia-server-sysuser.conf b/systemd/sia-server-sysuser.conf new file mode 100644 index 0000000..14fc0ec --- /dev/null +++ b/systemd/sia-server-sysuser.conf @@ -0,0 +1 @@ +u sia-server - "Sia server system user" - diff --git a/systemd/sia-server.service b/systemd/sia-server.service new file mode 100644 index 0000000..3738d9a --- /dev/null +++ b/systemd/sia-server.service @@ -0,0 +1,12 @@ +[Unit] +Description=Sia IoT server +After=network.target mosquitto.service +Wants=network.target mosquitto.service + +[Service] +User=sia-server +Group=sia-server +ExecStart=/usr/bin/sia-server -config /etc/sia-server/config.json + +[Install] +WantedBy=multi-user.target |
