How to convert my program into a service?
Ralf Mardorf
kde.lists at yahoo.com
Tue Mar 30 08:58:05 UTC 2021
On Tue, 30 Mar 2021 10:02:15 +0200, Bo Berglund wrote:
>Is there a authoritative howto document which describes how this
>should be done including where to put which files?
>
>I want the service to be run under a specific user account so that the
>data files it produces will be accessible by regular users belonging
>to the same group as the service user.
The documentation/manual is downright ridiculous:
https://www.freedesktop.org/wiki/Software/systemd/
It contains elaborated statements related to myths,
https://www.freedesktop.org/software/systemd/man/systemd.unit.html ,
but undidactic crap how systemd works. What you need is a unit. You
probably wont read
https://www.freedesktop.org/software/systemd/man/systemd.unit.html .
A unit is needed to start your program. You don't need to edit/convert
your program. You don't need to run it by a specific user account to
grant access only to users who belong to a dedicated group.
I rarely write unit files. If I do so I cheat my way through it,
something obviously done by even experts, too. At least not
everything always is ok after startup, e.g. real-time priorities off
real-time usage computers are not always set.
In a nutshell (you probably want to read this):
https://wiki.archlinux.org/index.php/systemd#Using_units
https://wiki.archlinux.org/index.php/systemd#Writing_unit_files
Disclaimer: I didn't read the current links myself. However, related to
systemd, there are only minor differences between Arch Linux and
Ubuntu, if any at all.
More information about the ubuntu-users
mailing list