Problem with my stubborn users
Posted in 2000
Topics: Installation, Setup & Upgrades, Connectivity: ESQL/C, 4GL & Embedded SQL, Networking & sqlhosts Configuration
Hi guys, Do me a favour , would you ? The problem is about my users , almost all of them did not want to logout after using the terminal ( we use TCP/IP instead of RS/232) so many users is on the server (we can monitor with command 'who -u' and the time they are in the server could be 3 -4 hours doing nothing). The impact is as follows : - Can't compile C program (error message : "failed to initialize policy manager IFOR_PM_FATAL ) - File transfer with FTP is not working ( error message : can't create bad socket) - etc. By the way my OS is SCO UNIX 5.0.5 with OnLine 5 and I4GL. My question is : How can I create UNIX shell script that automatically check all users and if found any users with more than certain time doing nothing the script kill the users by itself. By the way my OS is SCO UNIX 5.0.5 with OnLine 5 and I4GL. Thanks and regards. ---------------------- Forwarded by Sadikin Halim/SRG/APP on 12/14/2000 05:11 PM --------------------------- "Badri N. Subramaniyan" <badris@sco.COM> on 12/08/2000 06:32:11 PM To: Sadikin_Halim@app.co.id cc: deepakdg@bit.net.id, maheshr@sco.COM, eras@sco.COM Subject: Re: **REF: 406803** Problem to create 2 partitions in Dell Server Dear SCO User, Any H/w hdd can have only one active partition. Why are you trying two and how are you achieving it. What is the problem that you face., Thanx and Regds, Badri At 05:06 PM 03/12/2000 +0500, R N Raja wrote: >for your follow-up. > > >X-Sender: claref@thames.london.sco.com > >Date: Tue, 28 Nov 2000 10:54:58 +0000 > >To: deepakdg,daniely > >From: Clare Faulkner <claref@sco.com> > >Subject: **REF: 406803** Problem to create 2 partitions in Dell Server > >Cc: infodesk > > > >For action. > > > >Thanks, Clare > > > >>Importance: Normal > >>Subject: Problem to create 2 partitions in Dell Server > >>To: info@sco.COM > >>Bcc: > >>X-Mailer: Lotus Notes Release 5.0 (Intl) 30 March 1999 > >>From: Sadikin_Halim@app.co.id > >>Date: Thu, 9 Nov 2000 11:54:18 +0700 > >>X-MIMETrack: Serialize by Router on SRP_HUB1/SVR/APP(Release 5.0.3 > >(Intl)|21 March 2000) at > >> 09/11/2000 11:56:23 AM > >> > >>Dear Sir, > >> > >>We are now having problem to create 2 partition using SCO Unix 5.0.5. in > >>Dell 6300 Server in our company PT Indah Kiat Pulp & Paper Corp. Serang > >>Mill, Indonesia.. > >>We already tried to configure 2 active Unix partition the first time we > >>install SCO but after the installation process finished the installed > >>system can not boot up with message : no boot disk . We would like to have > >>your help and please send the guide to us at my email : > >>sadikin_halim@app.co.id. Thank you . > >> > >> > >
Sadikin_Halim@app.co.id wrote: > Hi guys, > Do me a favour, would you? > The problem is about my users , almost all of them did not want to logout > after using the terminal ( we use TCP/IP instead of RS/232) so many users > is on the server (we can monitor with command 'who -u' and the time they > are in the server could be 3 -4 hours doing nothing). > The impact is as follows : > - Can't compile C program (error message : "failed to initialize policy > manager IFOR_PM_FATAL ) > - File transfer with FTP is not working ( error message : can't create bad > socket) > - etc. These sound like pure o/s problems, nothing specifically to do with Informix. Why not run a cron job every hour that runs 'who -u' and catches those terminals that have been idle for more than say 2 hours and sends appropriate signals to them (SIGHUP, or 1, for instance) so that they die and release the resources. > By the way my OS is SCO UNIX 5.0.5 with OnLine 5 and I4GL. On the face of it, this is the only connection with Informix, and it isn't diectly an Informix issue. > My question is : > How can I create UNIX shell script that automatically check all users and > if found any users with more than certain time doing nothing the script > kill the users by itself. How many different ways do you want? I'd be tempted to use Perl to run 'who -u' and parse the output. You could certainly do it with a shell script and sed command (perhaps with xargs lurking in there). Depending on how fussy you want to be and the output of 'who -u' on your system, you will have an easier or harder time with the sed script. > By the way my OS is SCO UNIX 5.0.5 with OnLine 5 and I4GL. > Thanks and regards. > > ---------------------- Forwarded by Sadikin Halim/SRG/APP on 12/14/2000 > 05:11 PM --------------------------- > > "Badri N. Subramaniyan" <badris@sco.COM> on 12/08/2000 06:32:11 PM > To: Sadikin_Halim@app.co.id > cc: deepakdg@bit.net.id, maheshr@sco.COM, eras@sco.COM > Subject: Re: **REF: 406803** Problem to create 2 partitions in Dell Server > > Dear SCO User, > > Any H/w hdd can have only one active partition. Why are you trying two and > how are you achieving it. What is the problem that you face., >[...snip apparently irrelevant problem description...] -- Yours, Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN "I don't suffer from insanity; I enjoy every minute of it!"
Here's some ugliness that may serve as an example for what you want.
(If you don't read perl, for God's sake don't start with this mess.)
It was written when our app vendor wanted to charge us for more
licenses than were being used. It currently only logs user sessions
that appear to be idle.
[No guarantees. Caveat emptor. It worked in October 1999.]
email me if you want to discuss it. Don't forget to remove the S...P...A...M
#!/usr/local/bin/perl -w
#---> ONLY LOGGING TO /tmp/idle_kill.log DURING TESTING
#
# Purpose: onmode -z Informix sessions unchanged since previous
# run of this script (determined via cron interval.)
#
# Usage: dbaccess sysmaster@rel bufinfo.sql 2>/dev/null | \\
# grep -v "sid username" | sort -u | tail +2l | killem.pl
# [Note: STDERR redirect to /dev/null ]
#
# 0,30 7-17 * * * su - informix -c $INFORMIXDIR/bin/killem.sh
#
# [bufinfo.sql: select syssessions.sid, username, hostname,\\# bufreads, bufwrites from syssessions, syssesprof where\\
# syssessions.sid = syssesprof.sid]
#
# FYI: rm DBM file to reset counts
# "#:" shows sample output of print and query commands
#
#[a] pipe query (via dbaccess) into @testline
#[b] if dbm array index (sid) exists:
#[c] if bufreads and bufwrites are same as stored values:
#[d] run onstat -z on sesid, log it, and delete index.
#[e] else update changes to bufreads and bufwrites.
#[f] else add index and values to dbm file.
#[g] log kill count.
#
# To do:
# -add no-kill list
# -add absolute path for onmode command in variable
# $INFORMIXDIR/bin/onmode (dbaccess too)
# -do the dbaccess within this script (aviod the pipe script: killem.sh)
# -do the input file cleanup within this script
# (ugly: 2>/dev/null | grep -v "sid username" | sort -u | tail +2l)
# -fix the split that creates an extra field separator (:) at the beginning
# -create bufinfo.sql on the fly
use POSIX qw(strftime); # POSIX time module
$KILL_TIME = strftime "%a %b %e %H:%M:%S %Y", localtime;
### $KILL_LOG = "/tmp/idle_kill.log"; #? The open pukes with this var!
open(KILLLOG, '>>/tmp/idle_kill.log') || die "Cannot open
/tmp/idle_kill.log\\n";
print KILLLOG "Idle checker running: $KILL_TIME.\\n"; # log run time/date
here
#: Idle checker running: Thu Sep 30 12:00:12 1999.
$DBM_FILE = "/tmp/tempdb"; # DBM file name
dbmopen(%TEMPDB, "$DBM_FILE", 0644) || die "Cannot open $DBM_FILE\\n";
$sid = 1; # offset one: whitespace split creates extra field
# $username = 2; $hostname = 3; # never used, just field position info
$bufreads = 4; $bufwrites = 5; # field postions
$body_count = 0;
$active_count = 0;
while (<>) { #[a] (piped to this command ($O) for now; exec it later)
chomp; # Is this necessary?
@testline = split(/\\s+/); # split on whitespace
$sid = $testline[1]; # used as index and kill id
if (defined $TEMPDB{$sid}) { #[b]
@dbmline = split(/:/, $TEMPDB{$sid}); # fill eval array from dbm
#[c] compare $TEMPDB{$sid} with current line...
if (( $dbmline[$bufreads] == $testline[$bufreads] ) &&
( $dbmline[$bufwrites] == $testline[$bufwrites] )) {
#[d] kill 'em while they sleep...
print KILLLOG "$TEMPDB{$sid}\\n"; # log kills here
#: :450700:newera3:overseer:169260:0
#: :450833:ddesoto:sot:848:12
#---> system("onmode -z $sid"); # mode of termination
delete $TEMPDB{$sid}; # remove the record
$body_count++; # count the idle minds
} else { #[e] update record
$TEMPDB{$sid} = join(":", @testline);
$active_count++;
} ###-> compare
} else { #[f] add the record
$TEMPDB{$sid} = join(":", @testline);
$active_count++;
} ##-> if exists
} #-> while <>
$KILL_TIME = strftime "%a %b %e %H:%M:%S %Y", localtime;
# $active_count + $body_count = $INFORMIXDIR/active ("active" count)
print KILLLOG ("$KILL_TIME: $active_count active, $body_count idle, ",
$active_count+$body_count, " total\\n");
#: Fri Oct 1 10:30:14 1999: 805 active, 291 idle, 1096 total
Sadikin_Halim@app.co.id wrote:
> Hi guys,
> Do me a favour , would you ?
> The problem is about my users , almost all of them did not want to logout
> after using the terminal ( we use TCP/IP instead of RS/232) so many users
> is on the server (we can monitor with command 'who -u' and the time they
> are in the server could be 3 -4 hours doing nothing).
> The impact is as follows :
> - Can't compile C program (error message : "failed to initialize policy
> manager IFOR_PM_FATAL )
> - File transfer with FTP is not working ( error message : can't create bad
> socket)
> - etc.
>
> By the way my OS is SCO UNIX 5.0.5 with OnLine 5 and I4GL.
>
> My question is :
> How can I create UNIX shell script that automatically check all users and
> if found any users with more than certain time doing nothing the script
> kill the users by itself.
>
> By the way my OS is SCO UNIX 5.0.5 with OnLine 5 and I4GL.
> Thanks and regards.
>
> ---------------------- Forwarded by Sadikin Halim/SRG/APP on 12/14/2000
> 05:11 PM ---------------------------
>
> "Badri N. Subramaniyan" <badris@sco.COM> on 12/08/2000 06:32:11 PM
>
> To: Sadikin_Halim@app.co.id
> cc: deepakdg@bit.net.id, maheshr@sco.COM, eras@sco.COM
>
> Subject: Re: **REF: 406803** Problem to create 2 partitions in Dell Server
>
> Dear SCO User,
>
> Any H/w hdd can have only one active partition. Why are you trying two and
> how are you achieving it. What is the problem that you face.,
>
> Thanx and Regds,
>
> Badri
> At 05:06 PM 03/12/2000 +0500, R N Raja wrote:
> >for your follow-up.
> >
> > >X-Sender: claref@thames.london.sco.com
> > >Date: Tue, 28 Nov 2000 10:54:58 +0000
> > >To: deepakdg,daniely
> > >From: Clare Faulkner <claref@sco.com>
> > >Subject: **REF: 406803** Problem to create 2 partitions in Dell Server
> > >Cc: infodesk
> > >
> > >For action.
> > >
> > >Thanks, Clare
> > >
> > >>Importance: Normal
> > >>Subject: Problem to create 2 partitions in Dell Server
> > >>To: info@sco.COM
> > >>Bcc:
> > >>X-Mailer: Lotus Notes Release 5.0 (Intl) 30 March 1999
> > >>From: Sadikin_Halim@app.co.id
> > >>Date: Thu, 9 Nov 2000 11:54:18 +0700
> > >>X-MIMETrack: Serialize by Router on SRP_HUB1/SVR/APP(Release 5.0.3
> > >(Intl)|21 March 2000) at
> > >> 09/11/2000 11:56:23 AM
> > >>
> > >>Dear Sir,
> > >>
> > >>We are now having problem to create 2 partition using SCO Unix 5.0.5.
> in
> > >>Dell 6300 Server in our company PT Indah Kiat Pulp & Paper Corp. Serang
> > >>Mill, Indonesia..
> > >>We already tried to configure 2 active Unix partition the first time we
> > >>install SCO but after the installation process finished the installed
> > >>system can not boot up with message : no boot disk . We would like to
> have
> > >>yo
Related threads
- IDS not writing to online.log
- Help!!! syntax error
- installclientsdk bug?
- RamDisk tempdbs boot script for Linux