Replacement for shell becomes an orphan
I have written a replacement for shell standard shell. So when a user logs in they are presented with my custom shell app.
My problem is remote logins (i.e. a user that logs in via SSH). If they log in remotely and are using the custom shell, but the SSH process suddenly dies (for whatever reason) the custom shell app. doesn't end, it becomes an orphan (i.e. the init process becomes the parent).
Now, when I use a standard shell and the SSH process dies suddenly, the shell dies right away.
Can anybody explain this? I'd like the custom shell to die when it's parent process (usually SSH) dies. I'd prefer to do this without threads.
Thoughts?
Thanks.
|