<?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 Re: Script Help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2826258#M87686</link>
    <description>Typo. I'm NOT sure of the CSH variant.</description>
    <pubDate>Tue, 15 Oct 2002 16:30:51 GMT</pubDate>
    <dc:creator>Jordan Bean</dc:creator>
    <dc:date>2002-10-15T16:30:51Z</dc:date>
    <item>
      <title>Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2826256#M87684</link>
      <description>I am looking for a script that keep track of the number of users that are currently logged on and will restrict logins to a maximum of 32.&lt;BR /&gt;&lt;BR /&gt;Ie, our application can only have 32 users but we are lacking the tool to restrict this within the application at this time.&lt;BR /&gt;&lt;BR /&gt;Once the 32 user count is hit, then send an email message to the user and also record the login attempt in a log file under /tmp.&lt;BR /&gt;&lt;BR /&gt;Lastly, there will be a two users that should be exempt from this, ie the two sys admins.&lt;BR /&gt;&lt;BR /&gt;Can anyone help me with this?&lt;BR /&gt;&lt;BR /&gt;Thank you,</description>
      <pubDate>Tue, 15 Oct 2002 16:16:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2826256#M87684</guid>
      <dc:creator>Nick D'Angelo</dc:creator>
      <dc:date>2002-10-15T16:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2826257#M87685</link>
      <description>&lt;BR /&gt;Easiest solution:&lt;BR /&gt;Add this to /etc/profile:&lt;BR /&gt;&lt;BR /&gt;if [ $(id -u) -ne 0 -a $(users | sed 's/root//g' | wc -c) -gt 32 ]; then exit 1; fi&lt;BR /&gt;&lt;BR /&gt;I'm sure of the equivalent for CSH in /etc/csh.login, so I'll let others work that out.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Another solution is to reconfigure the kernel by reducing npty.&lt;BR /&gt;&lt;BR /&gt;You should also concider restricting how many times each user may be logged in by defining NUMBER_OF_LOGINS_ALLOWED=5 in /etc/default/security.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Oct 2002 16:28:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2826257#M87685</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2002-10-15T16:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2826258#M87686</link>
      <description>Typo. I'm NOT sure of the CSH variant.</description>
      <pubDate>Tue, 15 Oct 2002 16:30:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2826258#M87686</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2002-10-15T16:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2826259#M87687</link>
      <description>Thanks for the script, however, it limits all logins and it does not check to see if the minimum has been met yet.</description>
      <pubDate>Tue, 15 Oct 2002 16:49:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2826259#M87687</guid>
      <dc:creator>Nick D'Angelo</dc:creator>
      <dc:date>2002-10-15T16:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2826260#M87688</link>
      <description>&lt;BR /&gt;Sorry... I'm working on that part... Having a little trouble with regular expressions in sed...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Oct 2002 16:59:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2826260#M87688</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2002-10-15T16:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2826261#M87689</link>
      <description>&lt;BR /&gt;Okay, sorry about the wait. Try the attached snippet for /etc/profile.&lt;BR /&gt;&lt;BR /&gt;Make sure your admins are part of the group adm (or any other that you specify) so that they are excluded from the user count. Also, root bypasses this check and is excluded from the count as well.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Oct 2002 17:40:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2826261#M87689</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2002-10-15T17:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2826262#M87690</link>
      <description>Hi&lt;BR /&gt;A question.&lt;BR /&gt;Does the users actually log in on this host and start the application with a command or is it some kind of client-server application. In the later case is the user not realy logged in to the host and tracking users logged in will perhaps not work.&lt;BR /&gt;&lt;BR /&gt;Another idea could be to check how many instances of the application is running before starting a new&lt;BR /&gt;if ['ps -ef |grep &lt;APP_PROCESS_NAME&gt; |wc -l' -gt 32 ]&lt;BR /&gt;then&lt;BR /&gt;"do something (logout for example)"&lt;BR /&gt;else&lt;BR /&gt;app_start&lt;BR /&gt;fi&lt;BR /&gt;&lt;/APP_PROCESS_NAME&gt;</description>
      <pubDate>Tue, 15 Oct 2002 17:48:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2826262#M87690</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2002-10-15T17:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2826263#M87691</link>
      <description>Jordan, works very well - thanks again.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;Nickd</description>
      <pubDate>Mon, 21 Oct 2002 11:16:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/2826263#M87691</guid>
      <dc:creator>Nick D'Angelo</dc:creator>
      <dc:date>2002-10-21T11:16:31Z</dc:date>
    </item>
  </channel>
</rss>

