Skip to content

Commit bee794b

Browse files
committed
Add another useful value
1 parent dfb0607 commit bee794b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

content/debian/services.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ nano ~/.config/systemd/user/SERVICE_NAME.service
4040
- You can find a list of targets [here](https://www.freedesktop.org/software/systemd/man/latest/systemd.special.html).
4141
- You can also set the **user** to run as for system wide services (see [here](https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#User=)).
4242
- You can set **environment variables** using `Environment=` (see [here](https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#Environment) for more).
43+
- You can set **working directory** using `WorkingDirectory=` (see [here](https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#WorkingDirectory=) for more).
4344

4445
```
4546
[Unit]
@@ -49,6 +50,7 @@ After=network.target
4950
[Service]
5051
ExecStart=/bin/bash -c '/usr/bin/my_awesome_program >> /home/user/out.txt 2>&1'
5152
User=[Only allowed when running as root to set the user to use instead of root (see note above)]
53+
WorkingDirectory=[relative to another option root but absolute paths work]
5254
Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6"
5355
Type=simple
5456
Restart=always

0 commit comments

Comments
 (0)