Devananda rightly pointed out that SIGHUP is not the right to for the job.
The way I see it there are two main options:
1. A trigger that causes the process to shutdown without deregistering itself.
2. A trigger that causes the process to avoid deregistering itself when it is shutdown.
I favour the second approach, as it avoids giving a new purpose to an existing signal.
The mechanism for the trigger could be:
- A signal e.g. SIGUSR1/2.
- The existence of a file, possibly with some particular contents or name to ensure it is intended for that process.
- An API call.
The simplest option is the first, and I think think has some merit. It's main drawback is the lack of available signals, which might be reissued for other purposes in future.
Devananda rightly pointed out that SIGHUP is not the right to for the job.
The way I see it there are two main options:
1. A trigger that causes the process to shutdown without deregistering itself.
2. A trigger that causes the process to avoid deregistering itself when it is shutdown.
I favour the second approach, as it avoids giving a new purpose to an existing signal.
The mechanism for the trigger could be:
- A signal e.g. SIGUSR1/2.
- The existence of a file, possibly with some particular contents or name to ensure it is intended for that process.
- An API call.
The simplest option is the first, and I think think has some merit. It's main drawback is the lack of available signals, which might be reissued for other purposes in future.