Skip to content

Commit

Permalink
fix(qbittorrentd): retry if mount point not ready
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAegis committed Jun 1, 2024
1 parent cc5b577 commit 6294695
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
6 changes: 5 additions & 1 deletion modules/qbittorrent/resources/qbittorrentd.service
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
[Unit]
Description=qBittorrent Daemon Service
After=network.target
ConditionPathIsMountPoint=/var/media
Requires=var-media.mount
StartLimitBurst=5
StartLimitIntervalSec=300

[Service]
User=torrent
Group=media
ExecStart=/usr/bin/qbittorrent-nox
ExecStop=/usr/bin/killall -w qbittorrent-nox
RestartSec=5
Restart=on-failure

[Install]
WantedBy=multi-user.target
24 changes: 17 additions & 7 deletions modules/systemd/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ sudo systemd-analyze verify every service

## Expectations

If any user service changes, reload the daemon. [Partially possible]
If any user service changes, reload the daemon. \[Partially possible]

If any file that a service depends on changes, reload the service. [Handled
If any file that a service depends on changes, reload the service. \[Handled
by the module]

## Auto daemon reload
Expand Down Expand Up @@ -65,6 +65,16 @@ live.
Path watchers watch inode changes, so changing the target of a symlink won't
trigger it. However systemd follows sysmlinks if they are directly specified.

### Generated services

There are a number of services that are automatically provided by `systemd`
for example ones that provide a requirable target for mount points to be
present.

```sh
systemctl list-units --type=mount
```

#### Example

This will trigger the path entry when you `touch` the target of `a-symlink.sh`
Expand Down Expand Up @@ -101,26 +111,26 @@ Wants=notify-restart@%N.service

Examples:

- `%h`
* `%h`

`$HOME` of the user. For root services it's always `/root`

- `%E`
* `%E`

`$XDG_CONFIG_HOME` or `$HOME/.config` if not set. You can set it in
`/etc/environment` for everyone or in a `*.conf` file inside
`$HOME/.config/environment.d/` for a specific user.

- `%s`
* `%s`

Shell of the user. Just use `/bin/sh` if you have a fast shell there.

- `%n` (`%N`, no suffix)
* `%n` (`%N`, no suffix)

Full unit name. In case of `[email protected]`, it's
`some-service`.

- `%i` (`%I`, unescaped)
* `%i` (`%I`, unescaped)

Instance name. In case of `[email protected]`, it's
`example`.

0 comments on commit 6294695

Please sign in to comment.