Operating System - HP-UX
1833762 Members
2122 Online
110063 Solutions
New Discussion

Fastest Way to Force Log Off Users and Their Processes

 
Alzhy
Honored Contributor

Fastest Way to Force Log Off Users and Their Processes

How?

killall?
init 1
whodo

Por Favori?

Am writing a Poor Man's Failover procedure wherein a currently running server takes on the role of another w/o needing a reboot. All Security settings (tcb, passwd, group) and configs, storage are brought-in/migrated sans a reboot.
Hakuna Matata.
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: Fastest Way to Force Log Off Users and Their Processes

Hi Nelson:

perhaps:

# fuser -ku mountpoint

...or:

# fuser -ku /dev/dsk/cXtYdZ

Regards!

...JRF...
Alzhy
Honored Contributor

Re: Fastest Way to Force Log Off Users and Their Processes

Thanks it's already in my script.

But I'd want something done prior to my looper that kills processes hooked on them mount points and unmounts the filesystems.
Hakuna Matata.
Pete Randall
Outstanding Contributor

Re: Fastest Way to Force Log Off Users and Their Processes

How are they logging in, Nelson? For us, as CDE users, they all have a parent dtlogin session. I believe that if you do "ps -ef |grep dtlogin" and use the output to loop through and kill off all the parent login processes, that would pretty well take care of it.


Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: Fastest Way to Force Log Off Users and Their Processes

Hi (again) Nelson:

If you wanted to compose a list of 'pids' that don't belong to root:

# PIDS=$(UNIX95= ps -e -o uid= -o pid=|awk '$1!~/^0$/ {print $1}')

# kill ${PIDS}

Regards!

...JRF...
Geoff Wild
Honored Contributor

Re: Fastest Way to Force Log Off Users and Their Processes

How about stop the networking?

/sbin/init.d/net stop ; sleep 60 ; /sbin/init.d/net start


Course, how to stop them from logging back on?

cp -p /etc/passwd /etc/passwd.bak
passwd -l $user



Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.