I'm working on a password manager application, and for security reasons I want to launch an unkillable process.
And besides I don't want this program to be a daemon since I need to read from standard input and write to it.
Is there a way to do this?
Best Answer
Make the password manager run under a separate user and handle/ignore/block terminal-generated signals (
SIGINT
,SIGQUIT
,SIGHUP
,SIGTSTP
,SIGTTIN
, andSIGTTOU
).You can't send signals to (=kill) processes run under a different user (user whose both real uid and saved-set uid is different from your effective uid) unless your effective id is 0 (root).
All processes will still be killable by root.
For closer details, see kill(2).