Quote:
Originally Posted by kaplan71
What would the correct syntax be in order to accomplish this? One idea that I had was the following:
Code:
# su - <user>
# logout
If this works, how could I go about in checking for all logged in users, and repeating the above process? Thanks.
|
That won't work. At best, it will just create a new login shell for the given user and just log out of that shell.
If you have text-mode users, I would first ask the users to log out, then wait for a length of time:
Code:
echo "Please log out to unmount all NIS accounts" | wall
sleep 60
You then need to kill any login shells that persist:
The column labelled PID contains the process IDs of any login shells, which can be used to kill the shell process. Rather than killing the script outright, you want to tell these shells to log out so that their logout scripts run: