Skip to content

The template to put a systemd service under user control

License

Notifications You must be signed in to change notification settings

PexMor/user-systemd-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

user-systemd-template

The template to put a systemd service under user control

systemd as user

Run the systemd as user.

Enable particular user to use systemd services sudo loginctl enable-linger $USER.

User units are stored in ~/.config/systemd/user (or alternatives see below).

file: backend.service

[Unit]
Description=API backend service

[Service]
ExecStart=%h/mkt/backend.sh
WorkingDirectory=%h/mkt

[Install]
WantedBy=default.target
# quick start

mkdir -p ~/.config/systemd/user

sudo loginctl enable-linger $USER

mcedit ~/.config/systemd/user/backend.service

# systemctl --user ...

systemctl --user daemon-reload

systemctl --user start backend.service

systemctl --user enable backend.service

systemctl --user status backend.service

About

The template to put a systemd service under user control

Topics

Resources

License

Stars

Watchers

Forks

Languages