From 60f48e2d002b5c3114d38b2dc5bd72c2e2f6b202 Mon Sep 17 00:00:00 2001 From: Dimitry Kolyshev Date: Tue, 23 Apr 2024 15:51:48 +0300 Subject: [PATCH] Pull request: 6717-freebsd-daemon Updates #6717. Squashed commit of the following: commit ae80a774e6d1863e2bc635cede30427d27457560 Merge: 73bd06124 f85d04831 Author: Dimitry Kolyshev Date: Tue Apr 23 13:26:05 2024 +0200 Merge remote-tracking branch 'origin/master' into 6717-freebsd-daemon commit 73bd06124bd4ec1f8c304e1e3ff3564a52d4500c Author: Dimitry Kolyshev Date: Sun Apr 14 10:23:14 2024 +0200 home: imp freebsd daemon --- internal/home/service.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/internal/home/service.go b/internal/home/service.go index cb8f9b8b..eff2e393 100644 --- a/internal/home/service.go +++ b/internal/home/service.go @@ -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 @@ -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" `