From d3eac3979c98318d335d19fc11f6bbcb109da5ea Mon Sep 17 00:00:00 2001 From: Myned Date: Mon, 13 Mar 2023 02:53:22 -0500 Subject: [PATCH] Fix relative path in systemd service file --- README.md | 10 +++++++--- modufur.service | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fd74909..bd8b1ef 100644 --- a/README.md +++ b/README.md @@ -56,15 +56,19 @@ cd Modufur ``` cp modufur.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/modufur.service +``` +4. Reload user daemon ``` systemctl --user daemon-reload ``` -4. Start and enable service on login +5. Start and enable service on login ``` systemctl --user enable --now modufur ``` -5. Enable lingering to start user services on boot +6. Enable lingering to start user services on boot ``` sudo loginctl enable-linger username ``` diff --git a/modufur.service b/modufur.service index 80ed6c3..2bed20e 100644 --- a/modufur.service +++ b/modufur.service @@ -4,7 +4,7 @@ Requires=default.target After=default.target [Service] -WorkingDirectory=~/.git/Modufur +WorkingDirectory=/home/user/.git/Modufur ExecStart=poetry run python -OO run.py >&2 [Install]