-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop --foreground #234
Drop --foreground #234
Conversation
Always run in foreground by default. Service manager and supervisors expect services to run in foreground, so they can track the lifetime of the child process. For users running `usbmuxd` manually, running in background by default provides a confusing experience, since it gives the impression of exiting immediately. Anyone needing to run `usbmuxd` in background can use a shell's & operator or something like nohop.
your change doesn't make sense. while it would make sense that default mode is foreground, instead of background, your code should provide option to start it optionally as background service, because that is intended purpose. therefore your proposed change should also implement optional parameter to run it as background, eg. "switch logic" and instead --foreground implement --background parameter |
That might be a good idea and be a bit more flexible. I can try and switch to a --background.
Do you have any example scenario where this would be used though? I don’t know of any service manager or supervisor which requires that daemons double-fork themselves.
|
you don't always use service manager, but start directly service, for example samba, inetd, syslogd and others are started directly, same for usbmuxd, it can be started by systemd, udev, or you run it as service directly, depends on which system you use. |
What do you mean by "started directly"? You run them interactively via a terminal? I didn't really account for that sort of use case, I expected that most people would use something like systemd, openrc, init scripts, etc. I've opened #235 which flips the switch to |
not from commandline, but from script in init system. there are distribution that uses sysvinit or some alternative to it, instead of superservice like systemd. those expect started binary to deamonize itself. |
Closing in favour of #235 |
Always run in foreground by default. Service manager and supervisors expect services to run in foreground, so they can track the lifetime of the child process. Those that don't implement their own logic to fork daemons anyway.
For users running
usbmuxd
manually, running in background by default provides a confusing experience, since it gives the impression of exiting immediately.Anyone needing to run
usbmuxd
in background can use a shell's & operator or something like nohop.