Commit Graph

25 Commits

Author SHA1 Message Date
Frank Denis 09a6918226 Use os.Geteuid()
Fixes #2224
2022-10-18 14:56:39 +02:00
Frank Denis df3fb0c9f8 Keep lines short
$ golines -w -m 120 --shorten-comments .
2022-03-23 17:48:48 +01:00
Frank Denis 5fedbe4c6e // +build -> //go:build 2021-09-23 19:16:26 +02:00
Frank Denis 55ce158e37 Do we need to duplicate descriptors twice? 2020-06-19 21:42:20 +02:00
Frank Denis 6235c11c77 When forking, relocate descriptors higher up
Channels used by the `services` module may use descriptors, so we don't
want to overwrite them.

Maybe
fixes #1371
2020-06-19 00:04:54 +02:00
Frank Denis b6b7ed3a67 Dropping privileges doesn't work reliably on MacOS 2020-04-20 11:50:27 +02:00
Markus Linnala 0058bc063e feature: service_linux: Support systemd watchdog 2019-10-19 09:36:39 +02:00
Frank Denis 3e10fc917f Of course, things have to be different on Linux 2019-09-07 16:45:11 +02:00
Frank Denis 6e8b7e64ba Use x/sys instead of syscalls, merge privilege_linux and _others 2019-09-07 12:10:31 +02:00
Frank Denis 8076e206e0 Revert "Install the windows service as "NT AUTHORITY\NetworkService""
This reverts commit 17db0a658f.

On Windows, switching to user `NT AUTHORITY\NetworkService` apparently
breaks logging (reported by @Aland_123).
2019-03-14 20:10:53 +01:00
Frank Denis 17db0a658f Install the windows service as "NT AUTHORITY\NetworkService"
Untested

Maybe
Fixes #686
2019-01-10 22:44:58 +01:00
Frank Denis b886585486 Remove unused var 2019-01-02 22:59:16 +01:00
Frank Denis 3ccc989be5 Improve error logging, not only on Linux 2018-12-23 18:11:55 +01:00
Frank Denis e4a1245fb2 user.Current() fails when CGO is disabled and USER/HOME are not defined
So, ignore it if it fails.

This used to happen on Linux; not sure about other systems.

Fixes #607
2018-10-08 17:48:05 +02:00
Frank Denis b81a72cc3e Fix 16f1f8b71d 2018-10-05 01:06:44 +02:00
Frank Denis 9f1be6e079 killChild() is not needed any more; update config example by the way 2018-10-03 16:35:59 +02:00
Frank Denis a74c0fedeb Of course, Linux has to do things differently 2018-10-03 16:33:33 +02:00
Frank Denis 77f5c41b21 Forget about the supervisor, and use syscall.Exec() 2018-10-03 16:05:07 +02:00
Sebastian Schmidt 33bcff7d4a Minor improvements for the user_name option (#559)
* Fix missing pidfile when run with user_name opt.

* Make sure we are root when dropping privilege

This is required on macOS.

* Kill child process on exit. Fixes https://github.com/jedisct1/dnscrypt-proxy/issues/547
2018-08-04 00:57:52 +02:00
Frank Denis c043bd73dd Ping the service manager early
Maybe
fixes #548

(untested)
2018-07-19 19:03:57 +02:00
Frank Denis 6cb43f8e4d Of course, dropping privileges breaks with systemd sockets 2018-07-07 15:21:21 +00:00
Frank Denis 73a43b31b9 Automatically restart after unexpected errors 2018-07-01 23:06:28 +02:00
Frank Denis f9b6994fd2 An easier way to remove args[0] 2018-07-01 22:48:50 +02:00
Frank Denis 34e78a2446 Don't create a new session; it breaks `-service stop`. 2018-06-14 19:13:52 +02:00
Frank Denis 09e39c785a Keep the process running in foreground to avoid a breaking change/allow monitoring
This currently doesn't replace the previous process. Maybe there is a way to achieve
this in Go. Need to look closer at os.exec

Also start-child -> child
2018-06-13 17:24:16 +02:00