<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic script for logging off users who are idle in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583786#M104098</link>
    <description>For security and license limitation reasons,We are trying to figure out a script to log off users who are idle.   But we are having trouble figuring out "pid t".   Is anyone there familiar with this or other function calls that might be needed to complete this?  Or better yet if someone has already written a similar script already?&lt;BR /&gt;Thanks again for any help&lt;BR /&gt;&lt;BR /&gt;John</description>
    <pubDate>Fri, 15 Jul 2005 14:16:10 GMT</pubDate>
    <dc:creator>John Jimenez</dc:creator>
    <dc:date>2005-07-15T14:16:10Z</dc:date>
    <item>
      <title>script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583786#M104098</link>
      <description>For security and license limitation reasons,We are trying to figure out a script to log off users who are idle.   But we are having trouble figuring out "pid t".   Is anyone there familiar with this or other function calls that might be needed to complete this?  Or better yet if someone has already written a similar script already?&lt;BR /&gt;Thanks again for any help&lt;BR /&gt;&lt;BR /&gt;John</description>
      <pubDate>Fri, 15 Jul 2005 14:16:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583786#M104098</guid>
      <dc:creator>John Jimenez</dc:creator>
      <dc:date>2005-07-15T14:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583787#M104099</link>
      <description>Assuming you mean "pid_t" which is a signed integer variable, then here is a brief summary of it.&lt;BR /&gt;&lt;BR /&gt;The pid_t data type represents process IDs. You can get the process ID of a process by calling getpid. The function getppid returns the process ID of the parent of the current process (this is also known as the parent process ID or PPID).&lt;BR /&gt;&lt;BR /&gt;Your program should include the header files `unistd.h' and `sys/types.h' to use these functions.&lt;BR /&gt;&lt;BR /&gt;cheers!</description>
      <pubDate>Fri, 15 Jul 2005 14:34:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583787#M104099</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2005-07-15T14:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583788#M104100</link>
      <description>&lt;BR /&gt;Are you trying to do this with a script or with a "C" program?&lt;BR /&gt;&lt;BR /&gt;Some shells have an autologout feature as well.&lt;BR /&gt;&lt;BR /&gt;-- Tom</description>
      <pubDate>Mon, 18 Jul 2005 07:54:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583788#M104100</guid>
      <dc:creator>Tom Schroll</dc:creator>
      <dc:date>2005-07-18T07:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583789#M104101</link>
      <description>Has the TMOUT variable been looked at.&lt;BR /&gt;This value can be set to do just that.&lt;BR /&gt;&lt;BR /&gt;Can be in the /etc/default/security file as well.</description>
      <pubDate>Mon, 18 Jul 2005 08:11:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583789#M104101</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-07-18T08:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583790#M104102</link>
      <description>Tom,&lt;BR /&gt;  Either way a script or "C".   &lt;BR /&gt;&lt;BR /&gt;Rick,&lt;BR /&gt;  I will take a look at the TMOUT variable.  &lt;BR /&gt;Thanks again I will be assining points later.  Any other info or tips are greatly appreciated.&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Jul 2005 08:45:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583790#M104102</guid>
      <dc:creator>John Jimenez</dc:creator>
      <dc:date>2005-07-18T08:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583791#M104103</link>
      <description>Rick,&lt;BR /&gt;TMOUT = 0&lt;BR /&gt;Let me find out what this means</description>
      <pubDate>Mon, 18 Jul 2005 08:46:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583791#M104103</guid>
      <dc:creator>John Jimenez</dc:creator>
      <dc:date>2005-07-18T08:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583792#M104104</link>
      <description>&lt;BR /&gt;TMOUT variable (which i believe specific to BASH shell) if set to above zero in an interactive shell, the  value  is interpreted  as  the  number  of seconds to wait for input after issuing the primary prompt.  Bash terminates after  waiting  for that number of seconds if input does not arrive.&lt;BR /&gt;&lt;BR /&gt;but if your user is in some other program invoked in shell (like vi) then TMOUT will never occur. in that case you have to use some script to achieve this. check the output of w command, it gives IDLE time of a shell. it may be useful for u&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Gopi</description>
      <pubDate>Mon, 18 Jul 2005 09:18:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583792#M104104</guid>
      <dc:creator>Gopi Sekar</dc:creator>
      <dc:date>2005-07-18T09:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583793#M104105</link>
      <description>Thank you Gopi.  Unfortunately all my users are in a application 99% and rarely in a unix prompt.   When they are they are in a posix shell. I changed the the TMOUT on my account from 0 to 10.   and left it sitting on a menu of our application.  So far nothing has happened.   &lt;BR /&gt; The w command is interesting.  If I am on a prompt it records.  But if I am in the menu screen of my application,  it does not.   But I notice a few logins are actually logging in "IDLE" time.   I logged into a menu screen on my application for 10 minutes and my login is still showing "null" in this field.</description>
      <pubDate>Mon, 18 Jul 2005 10:31:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583793#M104105</guid>
      <dc:creator>John Jimenez</dc:creator>
      <dc:date>2005-07-18T10:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583794#M104106</link>
      <description>A lot of these idle timeouts within the application are configured within the application. Some applications you may not be able to configure.&lt;BR /&gt;&lt;BR /&gt;Example, the TMOUT variable will work on idle shell sessions. If I am sitting at a $ prompt for 60 minutes, then kill me.&lt;BR /&gt;Now if I invoke a vi session, I can sit there for 60 minutes and I will not be TMOUT. &lt;BR /&gt;&lt;BR /&gt;If users are not in a shell session, then investigate the app for these idle sessions. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Jul 2005 11:55:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583794#M104106</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-07-18T11:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583795#M104107</link>
      <description>In my previous job, I had a similar situation to this.  We had a limited number of licenses and users were leaving themselves idle in the application.  I wrote a shell script that found who was running the application, then coorelated that to the out put of 'who -Hu' and sent email to the users (I wanted to just kill their session, but was overruled by management).&lt;BR /&gt;&lt;BR /&gt;If you'd like to see the script, let me know.  It was written for AIX and the ksh shell so should be easily adapted to hp-ux.</description>
      <pubDate>Mon, 18 Jul 2005 12:32:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583795#M104107</guid>
      <dc:creator>Pat Lieberg</dc:creator>
      <dc:date>2005-07-18T12:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583796#M104108</link>
      <description>Pat,&lt;BR /&gt;  Yes if you would not mind, could you e-mail it to jimenez-j@iehp.org?</description>
      <pubDate>Mon, 18 Jul 2005 12:55:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583796#M104108</guid>
      <dc:creator>John Jimenez</dc:creator>
      <dc:date>2005-07-18T12:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583797#M104109</link>
      <description>Hi John,&lt;BR /&gt;&lt;BR /&gt;I don't know scripts to logout users who are idle.&lt;BR /&gt;Anyway a possible solution is keepalive parameters.&lt;BR /&gt;&lt;BR /&gt;ndd -h | grep -i keepalive&lt;BR /&gt;&lt;BR /&gt;You will see more details by&lt;BR /&gt;&lt;BR /&gt;ndd -h &lt;PARAMETER&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps you.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Fabio&lt;BR /&gt;&lt;/PARAMETER&gt;</description>
      <pubDate>Mon, 18 Jul 2005 12:56:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583797#M104109</guid>
      <dc:creator>Fabio Ettore</dc:creator>
      <dc:date>2005-07-18T12:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583798#M104110</link>
      <description>Thanks for the help,   But I will have to find another way.  The sessions sitting in the app never go into an idle state even though they are not doing anything.</description>
      <pubDate>Tue, 19 Jul 2005 14:30:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583798#M104110</guid>
      <dc:creator>John Jimenez</dc:creator>
      <dc:date>2005-07-19T14:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583799#M104111</link>
      <description>I do not know the nature of your application but when they run, i.e., not sit idle on the screen, if they accumulate CPU time for the shell they are running under, you can collect this information by the help of ps and awk commands and decide who is idle and who is depending on the accumulated cpu time per process. Just a wild idea.</description>
      <pubDate>Tue, 19 Jul 2005 14:50:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583799#M104111</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2005-07-19T14:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583800#M104112</link>
      <description>Well, if you are NOT at a shell prompt (which eliminates the ability to use autologout in tcsh for example), then I suggest a C program that runs as a background system process (daemon), reads the utmp file to get the tty for each user logged into the system, and then do a stat() on the device file to get the last timestamp (indicating activity on the tty).  I think this is how the "idle" output of the "w" command is determined.  I already have a program written in "C" to "watch" users who log in and out.  With some work, it could be adapted to look for idle users, and then kill the session.  It has not been tested on HP-UX greater than 11.0 though.  Let me know if you are interested.  The project spans more than one "C" file though...so I can't really post it here.  I could possibly make these additions in my spare time, but I can't guarantee how long it would take for me to finish.  :-)  I hope that you or someone else can use the info that I provided above to write your own version.  &lt;BR /&gt;:-)  Good luck!&lt;BR /&gt;&lt;BR /&gt;-- Tom&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Jul 2005 15:07:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583800#M104112</guid>
      <dc:creator>Tom Schroll</dc:creator>
      <dc:date>2005-07-19T15:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583801#M104113</link>
      <description>Tom,&lt;BR /&gt;&lt;BR /&gt;   I am the Admin here.  Max, who is the programmer, is not here today.  Would it be to much to ask you to send me what you have already.  I am sure that he can modify it accordingly.  If so my email adress is Jimenez-J@iehp.org&lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;John</description>
      <pubDate>Tue, 19 Jul 2005 15:39:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583801#M104113</guid>
      <dc:creator>John Jimenez</dc:creator>
      <dc:date>2005-07-19T15:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583802#M104114</link>
      <description>Hi John try "idled", it is a freeware with C source, your programer can modify and compile it according to your company needs.&lt;BR /&gt;&lt;A href="http://www.darkwing.com/idled/" target="_blank"&gt;http://www.darkwing.com/idled/&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Jul 2005 06:48:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583802#M104114</guid>
      <dc:creator>Juan M Leon</dc:creator>
      <dc:date>2005-07-20T06:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583803#M104115</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;I took a quick look at "idled" and it actually seems to do exactly what you need.  So take a look.  If you have trouble getting it to work or still need me to send you the code that I have (which would need modification to do what you need), let me know.  Take care.&lt;BR /&gt;&lt;BR /&gt;-- Tom</description>
      <pubDate>Wed, 20 Jul 2005 12:34:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583803#M104115</guid>
      <dc:creator>Tom Schroll</dc:creator>
      <dc:date>2005-07-20T12:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583804#M104116</link>
      <description>Something to Add to Tom Schroll, If I am correct, after you download the source code the default make file is set to be used on SUN OS, you will need to comment that section and uncomment the HP section. after that you can compile and install the software.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Juan</description>
      <pubDate>Thu, 21 Jul 2005 08:26:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583804#M104116</guid>
      <dc:creator>Juan M Leon</dc:creator>
      <dc:date>2005-07-21T08:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: script for logging off users who are idle</title>
      <link>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583805#M104117</link>
      <description>Try this:&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;who -u | cut -c 1-10,38-50 | egrep "[12][0-9]:|old" &amp;gt; /var/tmp/current&lt;BR /&gt;for IDLE_USR in `cat /var/tmp/current | awk '{print $3}'`&lt;BR /&gt;do&lt;BR /&gt;#     kill -9 $IDLE_USR&lt;BR /&gt;     echo $IDLE_USR&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This will kill any login shell where the user has not typed anything for 10 hours or more.&lt;BR /&gt;When you've tried it out and are happy that it is choosing the right processes to kill, remove the comment from the kill line and delete the echo line.&lt;BR /&gt;&lt;BR /&gt;Share And Enjoy</description>
      <pubDate>Fri, 12 Aug 2005 09:24:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/script-for-logging-off-users-who-are-idle/m-p/3583805#M104117</guid>
      <dc:creator>Gordon  Morrison</dc:creator>
      <dc:date>2005-08-12T09:24:11Z</dc:date>
    </item>
  </channel>
</rss>

