Internal documentation only
This page has been marked as draft.
How to avoid Netprobe exit caused by signal (1)
“I’m running my netprobe through the Ansible tower playbook, It can be started successfully, however when the job finishes the netprobe exits as well”
Problem(s)
Netprobe exits after start and netprobe log file indicates that it received a SIGHUP interrupt (signal 1) as shown below.
- INFO: ExitHandler ExitHandler triggered with signal (1)
- INFO: ExitHandler Netprobe Exiting
Solution(s)
A SIGHUP is received when the controlling process exits. This will normally be seen when a terminal window is closed and a child process was still running in that terminal.
When a Netprobe is run, it needs to be started in a way that prohibits it from receiving a SIGHUP.
This is achieved by:
- running the netprobe as a background process (using the &)
- preventing it from receiving a HUP signal. (using nohup)
Additionally, output produced by nohup can be discarded by file redirection, as shown below. (The default destination would be the file nohup.out).
Simple example netprobe startup script.
export LOG_FILENAME=/path/to/netprobe.log
nohup netprobe.linux_64 -options </dev/null >/dev/null 2>&1 &
Reference
- LOG_FILENAME is documented here
- BASH_BUILTINS(1) disown is an alternative to nohup for detaching a process from its controlling shell/terminal