- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Logging out a user account within a script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-13-2009 04:09 PM
тАО03-13-2009 04:09 PM
Logging out a user account within a script
I am writing a shell script that will do a snapshot of a local hard drive, but there is a need for all users to be logged off when the script is run. This is due to the user accounts being NIS, and the home directories in question are NFS mounts which are supposed to be unmounted prior to the snapshot being made.
What would the correct syntax be in order to accomplish this? One idea that I had was the following:
# su -
# logout
If this works, how could I go about in checking for all logged in users, and repeating the above process? If this is not the correct method, what commands could I use to accomplish this task? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-13-2009 04:55 PM
тАО03-13-2009 04:55 PM
Re: Logging out a user account within a script
No fear.
# su -
This starts a new process as
# logout
This stops the process you just started. I
assume that you wish to stop existing user
processes, not new ones which you create.
How many systems are there?
On which system is the file system local?
On which system are the users logged in?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-13-2009 07:41 PM
тАО03-13-2009 07:41 PM
Re: Logging out a user account within a script
Thanks for your reply. The answers to your questions, in the order that you proposed, are the following:
There are two systems involved in this scenario: The workstation, NIS client, and the server, NIS master, with NFS mounts exported to the workstation.
The filesystems that need to be unmounted are local to the NIS Master.
The users are logged into the workstation which is the NIS client.
If you have any other questions, please let me know, and thanks for the help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-13-2009 10:21 PM
тАО03-13-2009 10:21 PM
Re: Logging out a user account within a script
Pls. see attached link. It may help you.It is having script which will logout all users.
http://forums13.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1237011532645+28353475&threadId=926394
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2009 04:50 AM
тАО03-15-2009 04:50 AM
Re: Logging out a user account within a script
Unix operates with beer.