-
Notifications
You must be signed in to change notification settings - Fork 0
Process
GradedJestRisk edited this page Aug 22, 2025
·
8 revisions
Log process calls
Background/Foreground:
- start process in background
<COMMAND> & - bring process in foreground
fg <PROCESS_ID>
nohup $COMMAND . &>/dev/null &- make a process ignore SIGHUP signal
nohup <COMMAND> - make a process ignore SIGHUP signal, and allow logout (redirect input to NULL, output and error to separate files)
nohup <COMMAND> > <OUTPUT_FILE> 2> <ERROR_FILE> < /dev/null - make a process ignore SIGHUP signal, and allow logout (redirect input, output, error to NULL)
nohup <COMMAND> >/dev/null 2>&1
$PROGRAM </dev/null &>/dev/null &List:
- force, using process ID
kill -9 <PID - using process name:
pkill '<PROCESS_NAME' - interactive mode (fabulous kill):
fkillinstall
A signal is an asynchronous notification sent to a process or to a specific thread within the same process to notify it of an event. If the process has previously registered a signal handler, that routine is executed. Otherwise, the default signal handler is executed. Signals are similar to interrupts, the difference being that
- interrupts are mediated by the processor and handled by the kernel
- signals are mediated by the kernel (possibly via system calls) and handled by processes
List:
- Triggered by / Name / Code
- a user wishes to interrupt the process (Ctrl-C) / INTerruption / SIGINT
- ? wishes to terminate the process (Ctrl-C) / TERmination / SIGTERM (SIGINT is nearly identical to SIGTERM)
- terminate immediately / KILL the process / SIGKILL (cannot be caught or ignored)
- Run parallel
Wait for all processes to finish
sleep 5 & sleep 1 & wait