Last active
December 9, 2020 15:35
-
-
Save mmguero/5c41ccaf6abbc2af18ab5560e53e2a70 to your computer and use it in GitHub Desktop.
systemctl user process howto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p ~/.config/systemd/user/ | |
sudo loginctl enable-linger $USER | |
--------------------------------------- | |
~/.config/systemd/user/foobar.service | |
--------------------------------------- | |
[Unit] | |
AssertPathExists=/home/johndoe/foo | |
[Service] | |
WorkingDirectory=/home/johndoe/foo | |
ExecStart=/home/johndoe/foo/bar | |
Restart=always | |
PrivateTmp=true | |
NoNewPrivileges=true | |
[Install] | |
WantedBy=default.target | |
--------------------------------------- | |
systemctl --user enable foobar | |
systemctl --user start foobar | |
systemctl --user restart foobar | |
systemctl --user status foobar | |
systemctl --user stop foobar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment