stunnel

How to stop stunnel in linux server(using terminal only), other than killing pid


We have configures our stunnel properly in Ubuntu 16.04 , also it is starting properly we are getting our data in application which comes from stunnel server. Although I cannot find any proper way to stop stunnel. I tried killing the pid of stunnel , but killing pid is not a proper way to stop.

Thanks


Solution

  • Killing the PID sounds pretty bad, but it is the common way to stop processes in linux. "Kill" is just another name for "send signal". If you issue a kill $pid, then a SIGTERM is sent to that process. The process can then handle the signal and perform a clean shutdown. This is also the way many programs implement a configuration reloading functionality, they often use SIGHUP for that (kill -SIGHUP $pid).

    So, as long as you don't use kill -SIGKILL $pid (or in short: kill -9 $pid) the program can handle that signal and gracefully shutdown.

    More about signals on linux: https://en.wikipedia.org/wiki/Signal_(IPC)#List_of_signals