systemd user service example
This commit is contained in:
parent
68167ecda8
commit
811dbb2940
1 changed files with 23 additions and 0 deletions
|
@ -13,3 +13,26 @@ user
|
|||
.. info::
|
||||
|
||||
enable-linger prevents daemon to be killed at session exit
|
||||
|
||||
Example:
|
||||
|
||||
* ~/.config/systemd/user/multi-user.target.wants/httpy.service
|
||||
|
||||
.. code:: ini
|
||||
|
||||
[Unit]
|
||||
Description=httpy
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/python3 -m http.server 8080
|
||||
WorkingDirectory=%h/www
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
.. info::
|
||||
|
||||
%h is replaced by the user's home directory
|
||||
|
|
Loading…
Reference in a new issue