If you're trying to trigger simple actions like the start/stop/reload configuration as you've described, the most common method is to use signals.
From your shell script you can use the kill
command to send a specific signal to a specific process.
Within your process you would implement one or more signal handlers. The signal handler(s) are registered to receive one or more signals by using the signal()
function, or the sigaction()
function.
Conventionally SIGHUP
is used to trigger a reload of configuration. SIGSTOP
and SIGCONT
may be appropriate for pausing and resuming.
man 7 signal
will show you a complete list of available signals to choose from.
If you need to trigger more complex actions you can create a named pipe. Have your process create the pipe and, from your shell script, just echo
commands to it.