GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Shutting down Interactive sessions to run data...
Operating System - HP-UX
1848765
Members
7629
Online
104036
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
back
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
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
08-22-2001 04:38 AM
08-22-2001 04:38 AM
I am looking for a way to stop all the user terminal processes so that they cannot lock up files, in order to run some unattended nightly processing. I am running AVANTE on a Unidata database. We run a nightly MRP process. Often files will be locked and the nightly process blows up. If I could come up with some way of shutting down all the interactive user sessions prior to running the nightly process, I could prevent this from happening. I could shut down unidata, but then nothing will run (even the nightly process). Is there something I could do with the "ps" or "kill" to stop only the user screens ? I do have a method of shelling out to running unix commands from the AVANTE System. I just don't know what command to run. Any ideas welcome Thanks.
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2001 04:49 AM
08-22-2001 04:49 AM
Solution
Hi
To kill all the user terminal you can do something like
PIDS=`who -T | grep -v root | awk '{ print $8 }'`
for eachProc in $PIDS;do
kill -15 $eachProc
done
if you want not to kill someother users include them with grep -v options
like
who -T | grep -v root | grep -v otheruser
...BPK...
To kill all the user terminal you can do something like
PIDS=`who -T | grep -v root | awk '{ print $8 }'`
for eachProc in $PIDS;do
kill -15 $eachProc
done
if you want not to kill someother users include them with grep -v options
like
who -T | grep -v root | grep -v otheruser
...BPK...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2001 05:13 AM
08-22-2001 05:13 AM
Re: Shutting down Interactive sessions to run database process
Hi Brett
This is somthing I do on a regular basis.
Create a stripped down passwd, mine is called passlock and contains only root and system entries.
Also create a user clear up script:-
who -u | grep | awk '{print $7}' | xargs kill
As my users are in groups I can pick them off by this method.
To Zap them all then:-
who -u | awk '{print $7}' | xargs kill
At routine start time :-
cp /etc/passwd /etc/passback
cp /etc/passlock /etc/passwd
The users now cannot log in.
Run your clear users commands (as above).
Run your process clear commands:-
ps -ef |grep | awk '{print $2}' | xargs kill
Then carry out your MRP process.
When finished :-
cp /etc/passback /etc/passwd
(lets the users in)
and restart processes.
HTH
Paula
This is somthing I do on a regular basis.
Create a stripped down passwd, mine is called passlock and contains only root and system entries.
Also create a user clear up script:-
who -u | grep
As my users are in groups I can pick them off by this method.
To Zap them all then:-
who -u | awk '{print $7}' | xargs kill
At routine start time :-
cp /etc/passwd /etc/passback
cp /etc/passlock /etc/passwd
The users now cannot log in.
Run your clear users commands (as above).
Run your process clear commands:-
ps -ef |grep
Then carry out your MRP process.
When finished :-
cp /etc/passback /etc/passwd
(lets the users in)
and restart processes.
HTH
Paula
If you can spell SysAdmin then you is one - anon
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP