Skip to content
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

Consider removing Signum.SIGHUP from the signals to terminate list #220

Closed
janabimustafa opened this issue May 16, 2016 · 4 comments
Closed
Assignees

Comments

@janabimustafa
Copy link

If this is a bug report please make sure you have filled the following in:
(If it's not a bug and a feature request then just remove the below)

Plex Requests.Net Version:

Master branch.

Operating System:

FreeBSD-FreeNAS 9.10 STABLE

Mono Version:

4.2.2

Reproduction Steps:

Start the PlexRequests.exe on FreeBSD using

mono PlexRequests.exe &

notice how the application shuts down as soon as it starts. This is important because of the way FreeBSD's init scripts work and how they cannot allow foreground blocking services.
Removing

new UnixSignal(Signum.SIGHUP) 

from

UnixSignal.WaitAny( new[] { new UnixSignal(Signum.SIGINT), new UnixSignal(Signum.SIGTERM), new UnixSignal(Signum.SIGQUIT), new UnixSignal(Signum.SIGHUP) });

fixes the issue. I think.

@tidusjar
Copy link
Member

Why have you closed this?

@janabimustafa
Copy link
Author

janabimustafa commented May 16, 2016

Because I realized that SIGHUP is responsible for proper notification and shutdown when the kill {pid} is used. So my solution won't really be a proper fix and instead it will just cause more issues for other users.
Edit: Nvm, I am wrong and my original solution does work. I just had a couple of other things changed as well that broke the proper shutdown with kill. I will reopen this now.

@janabimustafa janabimustafa reopened this May 16, 2016
@tidusjar
Copy link
Member

Please excuse my lack of knowledge of Linux systems, but wouldn't removing SIGHUP not correctly shutdown the application when you kill the process?

@janabimustafa
Copy link
Author

It depends on how you attempt to kill it. By default, if you are using the kill {pid} command, the SIGTERM signal is sent.
This is the definition of SIGHUP from Wikipedia:

The SIGHUP signal is sent to a process when its controlling terminal is closed. It was originally designed to notify the process of a serial line drop (a hangup). In modern systems, this signal usually means that the controlling pseudo or virtual terminal has been closed.[3] Many daemons will reload their configuration files and reopen their logfiles instead of exiting when receiving this signal.[4] nohup is a command to make a command ignore the signal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants