1753717 Members
4505 Online
108799 Solutions
New Discussion юеВ

Re: Kill Users process

 
Karthick K S
Frequent Advisor

Re: Kill Users process

Pls anyone help me out this
RAC_1
Honored Contributor

Re: Kill Users process

Karthick,

You are not reading the replies carefully.
As such there is no magic wand to kill processes based on their state. (because they change very fast. and very fast means almost not catchable and noticable)

If you open a telnet session and just start vi and do nothing further, it is still a active session for system. But in fact it is inactive session because nothing is happening in vi. Said that, you need to way to decide (from apps/program side) to say that it is inactive.
There is no substitute to HARDWORK
Tom Schroll
Frequent Advisor

Re: Kill Users process


This type of request seems to come up over and over -- unfortunately, I only know of one public tool that does a pretty good job of actively controlling user sessions.

http://www.darkwing.com/idled/

I haven't used it much myself, and it may need some tweaking to compile on HP-UX. But give it a shot.

I wish I could help you with your script, but there really isn't any safe and easy way to script everthing that you want to do...at least not one that I would feel comfortable with. :-) If you still want suggestions on how to parse output from ps, that's fine, we can help. Otherwise, I suggest a long look at idled (or perhaps write a similar program like it).

-- Tom
If it ain't broke, it needs optimized.
Howard Marshall
Regular Advisor

Re: Kill Users process

I don't really have any more of an answer for you than anyone else has but perhaps I can explain why they have given you the answers they have.

You use the term "inactive session". You seem to be defining an inactive session as any processes or logins that are running but that no human is currently using. The system doesn't and can't know if there is a person sitting there or not.

Inactive in this case is your term, not the systems, so, there are no switches in the ps command that can identify if a "session" is "inactive" or not

You will have to decide what the criteria are that makes a session active or inactive. Once you decide what the criteria are you can find a way to identify them perhaps by tty or something and go from there.

It may also help if you gave us a little more detail about what a "session" is. Do the users login with a terminal, a terminal session from a pc, to they access the system through some x terminal program or are processes spawned for them from a client server type application that doesn't require them to login to the server through the usual login process?

Its not that we don't want to help you,

Based solely on the information you have given you may have to write a script that goes through each user for processes and use the start time of the process and eliminate all but the most recent. The problem with that is, a user may create a session, move to another location, create another session, go somewhere else and create a third, then come back to the second. The system has no way of knowing that, it├в s the chance you have to take unless you can use tmout to kick them off based on idle time

I know that doesn't help much but├в ┬ж├в ┬ж

Howard
Jeff Schussele
Honored Contributor

Re: Kill Users process

Well said Howard.
But you know sometimes some people just want a fish & could care less when you're trying to taech them the finer points of casting....

Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Karthick K S
Frequent Advisor

Re: Kill Users process

Thanks to all for such good reply.
I got it clearly.
Howard Marshall
Regular Advisor

Re: Kill Users process

Just so everyone knows,

The characters after that last sentence were not typed as displayed. What I typed was a series of periods but I guess because I write stuff in word for the spelling correction it translated it wrong, in this case it seems a little vulgar and I apologize for that.

H