Skip to content

Commit

Permalink
Pull request: 6717-freebsd-daemon
Browse files Browse the repository at this point in the history
Updates #6717.

Squashed commit of the following:

commit ae80a77
Merge: 73bd061 f85d048
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Tue Apr 23 13:26:05 2024 +0200

    Merge remote-tracking branch 'origin/master' into 6717-freebsd-daemon

commit 73bd061
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Sun Apr 14 10:23:14 2024 +0200

    home: imp freebsd daemon
  • Loading branch information
Mizzick committed Apr 23, 2024
1 parent f85d048 commit 60f48e2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions internal/home/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,11 +649,6 @@ status() {

// freeBSDScript is the source of the daemon script for FreeBSD. Keep as close
// as possible to the https://github.com/kardianos/service/blob/18c957a3dc1120a2efe77beb401d476bade9e577/service_freebsd.go#L204.
//
// TODO(a.garipov): Don't use .WorkingDirectory here. There are currently no
// guarantees that it will actually be the required directory.
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/2614.
const freeBSDScript = `#!/bin/sh
# PROVIDE: {{.Name}}
# REQUIRE: networking
Expand All @@ -667,7 +662,9 @@ name="{{.Name}}"
pidfile_child="/var/run/${name}.pid"
pidfile="/var/run/${name}_daemon.pid"
command="/usr/sbin/daemon"
command_args="-P ${pidfile} -p ${pidfile_child} -T ${name} -r {{.WorkingDirectory}}/{{.Name}}"
daemon_args="-P ${pidfile} -p ${pidfile_child} -r -t ${name}"
command_args="${daemon_args} {{.Path}}{{range .Arguments}} {{.}}{{end}}"
run_rc_command "$1"
`

Expand Down

0 comments on commit 60f48e2

Please sign in to comment.