handle signals to remove pid file

Signed-off-by: Sergei Ianovich <ynvich@gmail.com>
remove function visibility

Signed-off-by: Sergei Ianovich <ynvich@gmail.com>