Skip to content

Commit

Permalink
home: imp code
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Feb 28, 2022
1 parent 86c311a commit 682c3c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to

### Added

- Default service log output on FreeBSD and OpenBSD ([#4213]).
- `windows/arm64` support ([#3057]).

### Changed
Expand Down Expand Up @@ -87,6 +88,7 @@ In this release, the schema version has changed from 12 to 13.
[#3367]: https://github.com/AdguardTeam/AdGuardHome/issues/3367
[#3381]: https://github.com/AdguardTeam/AdGuardHome/issues/3381
[#3503]: https://github.com/AdguardTeam/AdGuardHome/issues/3503
[#4213]: https://github.com/AdguardTeam/AdGuardHome/issues/4213
[#4216]: https://github.com/AdguardTeam/AdGuardHome/issues/4216
[#4221]: https://github.com/AdguardTeam/AdGuardHome/issues/4221
[#4238]: https://github.com/AdguardTeam/AdGuardHome/issues/4238
Expand Down
12 changes: 5 additions & 7 deletions internal/home/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ func svcAction(s service.Service, action string) (err error) {
log.Info("warning: service must be started from within the /Applications directory")
}
}
if runtime.GOOS == "darwin" &&
action == "start" &&
!strings.HasPrefix(Context.workDir, "/Applications/") {
log.Info("warning: service must be started from within the /Applications directory")
}

err = service.Control(s, action)
if err != nil && service.Platform() == "unix-systemv" &&
Expand Down Expand Up @@ -590,6 +585,9 @@ 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.
//
Expand All @@ -602,8 +600,8 @@ const freeBSDScript = `#!/bin/sh
. /etc/rc.subr
name="{{.Name}}"
eval ${name}_env="IS_DAEMON=1"
eval ${name}_user="root"
{{.Name}}_env="IS_DAEMON=1"
{{.Name}}_user="root"
pidfile_child="/var/run/${name}.pid"
pidfile="/var/run/${name}_daemon.pid"
command="/usr/sbin/daemon"
Expand Down

0 comments on commit 682c3c9

Please sign in to comment.