Add compatibility for non-Linux OS
Closed this issue · 2 comments
xaprb commented
The only Linux-specific thing in godaemon is reading /proc/self/exe
to determine the program's true executable file. This can probably be gotten through os.Args[0]
and some combination of path canonicalization, which I think there are helper functions for in the Go core libraries. Making this agnostic to Unix variant would be a good thing.
juphoff commented
After discussion with @xaprb and @gkristic, godaemon will be refactored so that only the Linux-specific determination of the executable file path (the aforementioned /proc/self/exe
check) is in an OS-specific source file. The remainder of godaemon's functionality will be moved to a non-OS-specific source file.