Skip to content

Commit

Permalink
adguardhome: Update init files
Browse files Browse the repository at this point in the history
Move working directory from `/var/adguardhome` to
`/var/lib/adguardhome`, according to Linux FHS.
Add option to store PID file, defaulting to `/run/adguardhome.pid`.

Signed-off-by: Ryan Keane <[email protected]>
  • Loading branch information
Ra2-IFV committed Dec 22, 2024
1 parent 1df4ac8 commit ea9420a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions net/adguardhome/files/adguardhome.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
config adguardhome config
# Where to store persistent data by AdGuard Home
option workdir /var/adguardhome
option config /etc/adguardhome.yaml
# Where to store persistent data by AdGuard Home
option workdir /var/lib/adguardhome
option pidfile /run/adguardhome.pid
5 changes: 3 additions & 2 deletions net/adguardhome/files/adguardhome.init
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ start_service() {
fi

config_load adguardhome
config_get WORK_DIR config workdir
config_get CONFIG_FILE config config "/etc/adguardhome.yaml"
config_get PID_FILE config pidfile "/run/adguardhome.pid"
config_get WORK_DIR config workdir "/var/lib/adguardhome"

[ -d "$WORK_DIR" ] || mkdir -m 0755 -p "$WORK_DIR"

procd_open_instance
procd_set_param command "$PROG" -c "$CONFIG_FILE" -w "$WORK_DIR" --no-check-update
procd_set_param command "$PROG" -c "$CONFIG_FILE" -w "$WORK_DIR" --pidfile "$PID_FILE" --no-check-update
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
Expand Down

0 comments on commit ea9420a

Please sign in to comment.