b3631c54b6
We can now just call setctty() without any problems. This means the shell running the shutdown script is now the session leader, just like on startup.