trojan icon indicating copy to clipboard operation
trojan copied to clipboard

Add -d option to fork into background as a daemon

Open fnorkfnork opened this issue 3 years ago • 4 comments

This is useful on systems like OpenBSD which don't have a service manager like systemd. The daemon() call is available on Linux and OpenBSD, not sure about other systems.

fnorkfnork avatar May 08 '21 03:05 fnorkfnork

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 08 '21 03:05 CLAassistant

For portability, please avoid using daemon() if possible. Go through a standard SysV daemon creation process is recommended. Or at least include unistd.h properly when necessary.

Chigusa0w0 avatar May 08 '21 06:05 Chigusa0w0

For portability, please avoid using daemon() if possible. Go through a standard SysV daemon creation process is recommended.

Portability to what though? I guess it's only proprietary Unixes that don't have daemon() but do have all the other POSIX APIs.

Or at least include unistd.h properly when necessary.

Yes OK. It's in stdlib.h on Mac/BSD but unistd.h on Linux.

fnorkfnork avatar May 08 '21 07:05 fnorkfnork

To be honest, I like this feature.

superbetacat avatar May 29 '22 06:05 superbetacat