09-22-2018
Hi,
I think there are two main questions here: firstly, when you say that it "is not quite working", what is going wrong ? Are you getting an error, or do you find that the idle message is never displayed ? If you can give some detail on what precisely is gong wrong and how you're determining that it's gone wrong, that will be helpful.
Secondly: what is it you're intending to do once the idle threshold is reached ? I ask because it may well be that other utilities already exist to detect and perform your idle task without you having to re-invent the wheel. For example, if you simply wish to lock your X session, then things like xscreensaver or xlock (or its various successors) may well do the job without you having to worry any more about it. So if you can explain why you need to detect the system being idle and what you plan on doing when it is, there may be other solutions here aside from writing something yourself.
10 More Discussions You Might Find Interesting
1. Slackware
:confused:
I am using Linux for a while and now changed to slackware for my study and it is not as good as redhat everytime when you add this or that it needs either configure modules or recompile kernel
Now I changed from PS/2 mouse to USB trouble starts it refuse to work I know I can... (3 Replies)
Discussion started by: slackware
3 Replies
2. UNIX for Dummies Questions & Answers
i have activated mysql, and apache on my redhat 9 box, i went to mr BASH and wrote a php script, and it wouldn't execute.
any help?????????????????????????????????????
is there something that i need to activate???????
i have RUBY on there too,does it matter or no???
... (2 Replies)
Discussion started by: mbabeli
2 Replies
3. UNIX for Dummies Questions & Answers
I am trying to run a script that I made when my computer is idle. How do I go about doing this.
Thanks :) (4 Replies)
Discussion started by: rehansaeed
4 Replies
4. UNIX for Advanced & Expert Users
hi all
by using gethostbyname, i can know whether the net is available or not.
it is working fine when i activate or deactivate in neat.
the problem is when i remove cable(netcable) it is not working proparly,
i would like to know it.
am using fedora5, AMD
can u please help me .
thank... (3 Replies)
Discussion started by: munna_dude
3 Replies
5. IP Networking
What are the steps between "ifconfig eth0 UP" and "net_device->open"?
ifconfig eth0 UP =>
ioctl(skfd, SIOCSIFFLAGS, &ifr) (ifr.ifr_flags = IFF_UP | IFF_RUNNING) =>
????? => what are these steps?
net_device->open
Thanks! (1 Reply)
Discussion started by: samuncle
1 Replies
6. Red Hat
Hello all,
I´m trying to configure the ftp service (port 21) in a Red Hat Enterprise 4 from xinetd.
Anybody have done this?
Thank you in advance. (3 Replies)
Discussion started by: mig28mx
3 Replies
7. Solaris
My admin has set password policy to de-activate user account if there is not login for 90 days. How can i re-activate user account w/o deleting, or changing user password.
Thanks in advance
Deeps (6 Replies)
Discussion started by: admin@solaris
6 Replies
8. Shell Programming and Scripting
Hi there,
I wrote a script that scans a folder for new files.
I don't want to run it at specific times but only when the computer is NOT busy.
I tried to use nice but it doesn't really work. I mean, even if my process has less priority, it still slows down the other processes. I did a test... (3 Replies)
Discussion started by: chebarbudo
3 Replies
9. Shell Programming and Scripting
I am using Ubuntu 9.04. I want to write a shell script to get the information about cpu idle from top command at the real time when i call it, compare cpu idle with 20 (20%), if cpu idle > 20 exit 1, vice versa exit 0. Anybody can help me to resolve it ?
Thanks alot. (7 Replies)
Discussion started by: huyquocnguyen
7 Replies
10. UNIX for Beginners Questions & Answers
Hi Team ,
I have one process named as cec_analysiseool that is running on unix box machine now i want to kill this process so please advise what will be the ideal command to kill this , what i have tried is :confused:
kill -9 `ps -ef | grep cec_analysiseool | grep -v grep | awk '{print $2}'` (2 Replies)
Discussion started by: unclesamm
2 Replies
LEARN ABOUT PHP
pg_transaction_status
PG_TRANSACTION_STATUS(3) PG_TRANSACTION_STATUS(3)
pg_transaction_status - Returns the current in-transaction status of the server.
SYNOPSIS
int pg_transaction_status (resource $connection)
DESCRIPTION
Returns the current in-transaction status of the server.
Caution
pg_transaction_status(3) will give incorrect results when using a PostgreSQL 7.3 server that has the parameter autocommit set to
off. The server-side autocommit feature has been deprecated and does not exist in later server versions.
PARAMETERS
o $connection
- PostgreSQL database connection resource.
RETURN VALUES
The status can be PGSQL_TRANSACTION_IDLE (currently idle), PGSQL_TRANSACTION_ACTIVE (a command is in progress), PGSQL_TRANSACTION_INTRANS
(idle, in a valid transaction block), or PGSQL_TRANSACTION_INERROR (idle, in a failed transaction block). PGSQL_TRANSACTION_UNKNOWN is
reported if the connection is bad. PGSQL_TRANSACTION_ACTIVE is reported only when a query has been sent to the server and not yet com-
pleted.
EXAMPLES
Example #1
pg_transaction_status(3) example
<?php
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
$stat = pg_transaction_status($dbconn);
if ($stat === PGSQL_TRANSACTION_UNKNOWN) {
echo 'Connection is bad';
} else if ($stat === PGSQL_TRANSACTION_IDLE) {
echo 'Connection is currently idle';
} else {
echo 'Connection is in a transaction state';
}
?>
PHP Documentation Group PG_TRANSACTION_STATUS(3)