I have several systemd services which I want to run as a user (i.e.
not root) but I do want them to run at start-up whenever the system is rebooted.
I have the service files in ~/.config/systemd/user, one of them is as follows:-
I have several systemd services which I want to run as a user (i.e.
not root) but I do want them to run at start-up whenever the system is rebooted.
Hi,
On Fri, Feb 27, 2026 at 10:26:08AM +0000, Chris Green wrote:
I have several systemd services which I want to run as a user (i.e.
not root) but I do want them to run at start-up whenever the system is rebooted.
User services normally only start when the user logs in for the first
time, and are terminated when the last login session of the user ends.
If you would like fore there to always be a session of that user
existing (so all of that user's services start at boot and remain
running), you can enable "linger":
$ loginctl enable-linger
If the service in question is not strictly user-based then I would
probably run it as a system service with User=. e.g. a daemon that you
expect there to only be one of on the system, that runs under a specific
user for that daemon, would make more sense as a system service, whereas something that runs on behalf of a specific real user (and there might
be other instances of per-user) does make sense as a user service.
The systemd services in question are of two types:-
1 - A collection of outgoing ssh connections which set up reverse
tunnels so that I can log in to the system using ssh from home. (The
system on the boat is behind a CGNAT mobile connection).
2 - Some python programs that run the displays on the boat.
Neither of the above need root access but I do want them to run
whenever the system is on, not just when I'm logged in.
Chris Green <cl@isbd.net> writes:
The systemd services in question are of two types:-
1 - A collection of outgoing ssh connections which set up reverse
tunnels so that I can log in to the system using ssh from home. (The
system on the boat is behind a CGNAT mobile connection).
2 - Some python programs that run the displays on the boat.
Neither of the above need root access but I do want them to run
whenever the system is on, not just when I'm logged in.
I would recommend that you create a dedicated user for the services
instead of utilizing your personal account, or consider using the DynamicUser setting of systemd.
1 - A collection of outgoing ssh connections which set up reverse
tunnels so that I can log in to the system using ssh from home. (The
system on the boat is behind a CGNAT mobile connection).
2 - Some python programs that run the displays on the boat.
Chris Green (HE12026-02-28):
1 - A collection of outgoing ssh connections which set up reverse
tunnels so that I can log in to the system using ssh from home. (The
system on the boat is behind a CGNAT mobile connection).
The service that provides network connectivity to your SSH daemon, a
system service, should run as a system service.
As a side note, you should consider complementing these tunnels with a
VPN (or several): VPN software is designed for that, keeping the
connections alive will be easier and more robust.
2 - Some python programs that run the displays on the boat.
For that, I would recommend to set the user running the display on
auto-login in a lightweight display manager.
^^^^^^^^^^^^^^^^^^^^2 - Some python programs that run the displays on the boat.
For that, I would recommend to set the user running the display on auto-login in a lightweight display manager.It's a headless system so there's no display manager.
Chris Green (HE12026-03-01):
^^^^^^^^^^^^^^^^^^^^2 - Some python programs that run the displays on the boat.
For that, I would recommend to set the user running the display on auto-login in a lightweight display manager.It's a headless system so there's no display manager.
I am confused. Can you explain how a headless system has displays?
:-) The displays are LCD character displays on the boat's instrument
panel. They are driven via an I2C bus.
| Sysop: | Jacob Catayoc |
|---|---|
| Location: | Pasay City, Metro Manila, Philippines |
| Users: | 5 |
| Nodes: | 4 (0 / 4) |
| Uptime: | 119:49:17 |
| Calls: | 125 |
| Calls today: | 125 |
| Files: | 489 |
| D/L today: |
859 files (365M bytes) |
| Messages: | 76,568 |
| Posted today: | 26 |