1
0
Fork 0
mirror of https://github.com/myned/watcher.git synced 2024-11-01 12:22:38 +00:00

Fix relative path in systemd service file

This commit is contained in:
Myned 2023-03-13 02:58:40 -05:00
parent 77adfee746
commit 5d5899b3d8
No known key found for this signature in database
GPG key ID: 28056631D2CF6B1B
2 changed files with 8 additions and 4 deletions

View file

@ -57,15 +57,19 @@ cd Watcher
``` ```
cp watcher.service ~/.config/systemd/user cp watcher.service ~/.config/systemd/user
``` ```
3. Reload user daemon 3. Replace `user` in `WorkingDirectory` with current user
```
sed -i "s|\(WorkingDirectory=/home/\)user|\1$(whoami)|" ~/.config/systemd/user/watcher.service
```
4. Reload user daemon
``` ```
systemctl --user daemon-reload systemctl --user daemon-reload
``` ```
4. Start and enable service on login 5. Start and enable service on login
``` ```
systemctl --user enable --now watcher systemctl --user enable --now watcher
``` ```
5. Enable lingering to start user services on boot 6. Enable lingering to start user services on boot
``` ```
sudo loginctl enable-linger username sudo loginctl enable-linger username
``` ```

View file

@ -4,7 +4,7 @@ Requires=default.target
After=default.target After=default.target
[Service] [Service]
WorkingDirectory=~/.git/Watcher WorkingDirectory=/home/user/.git/Watcher
ExecStart=poetry run python -OO run.py >&2 ExecStart=poetry run python -OO run.py >&2
[Install] [Install]