Operating System - HP-UX
1834518 Members
2179 Online
110068 Solutions
New Discussion

Re: Can I remotely lock the console keyboard or tell is it's busy?

 
SOLVED
Go to solution
Renda Skandier
Frequent Advisor

Can I remotely lock the console keyboard or tell is it's busy?

Hi,
I have a daemon process (written in C)that echos to the main console whenever a program aborts or needs valid input. The programs may have been initiated remotely or thru a scheduling package. The problem is, an operator might be typing something on the console at the time my message arrives. If they continue typeing and hit enter , everything is fine. If they backspace to delete, everything is fine. Trouble is, they just want to hit Enter in the middle.
Is there anyway to auto backspace them back,or even better... tell when the console is busy, so that I wait before sending my message.
thanks
8 REPLIES 8
Ken Penland_1
Trusted Contributor

Re: Can I remotely lock the console keyboard or tell is it's busy?

wow, thats a good question...I am sure someone will have an in-depth answer for ya, but what I would do to get around this is look at the time stamp of /dev/console.

if a person is typing on it, the timestamp updates....so if the timestamp is older than a minute, you know no one is typing on it at that point in time...anything more exact than that, possibly one of the experts will know :)
'
Paula J Frazer-Campbell
Honored Contributor

Re: Can I remotely lock the console keyboard or tell is it's busy?

Renda

Not an answer to your question but :-

The console is the last resort in controlling a server and should not be used for day to day operations.

Paula
If you can spell SysAdmin then you is one - anon
Michael Tully
Honored Contributor

Re: Can I remotely lock the console keyboard or tell is it's busy?

Why have you got an operator on your system console?
Get them off and onto a standard terminal/telnet session. Besides a security hazard, the system console should only be used for special messages, and even those should where possible be written to the syslog (/var/adm/syslog/syslog.log)
Anyone for a Mutiny ?
Renda Skandier
Frequent Advisor

Re: Can I remotely lock the console keyboard or tell is it's busy?

we are in the middle of a migration from an old Bull box to HP. The goal is to keep everything the same (I know!). Anyway, it was recommended by someone at HP to have this daemon in order to display to the console.
Ken Penland_1
Trusted Contributor

Re: Can I remotely lock the console keyboard or tell is it's busy?

an additional comment on my above suggestion, I went back and tested it on one of our systems after I posted...I knew it worked for /dev/pts/?? stuff because that is how I used to track how idle people were while on the system (a cron job ran every minute and kept track of how often their port timestamp updated, indicating how many minutes of activity opposed to inactivity)....when I checked /dev/console it seemed every time I did an ll on it, it had the current time stamp, and I know that no one is on the console right now, (since there isnt one even hooked up) so, I am not sure if this is a viable solution to your problem when dealing with the console.
'
Ken Penland_1
Trusted Contributor

Re: Can I remotely lock the console keyboard or tell is it's busy?

in talking with one of my co-workers, the only way he could think of to see if someone is "active" on the console is to simply do a "finger" and look for console under the TTY column...if they have an idletime, they are not typing... this is a stumper...thanks for giving me something to ponder today ;)
'
Paula J Frazer-Campbell
Honored Contributor
Solution

Re: Can I remotely lock the console keyboard or tell is it's busy?

Hi

who -u | grep console should show what you want.


Paula
If you can spell SysAdmin then you is one - anon
Renda Skandier
Frequent Advisor

Re: Can I remotely lock the console keyboard or tell is it's busy?

thanks....
who -u is almost exactly what I need.
It saves me comparing the currect time to /dev/console.
Ken, on my system the timestamp remains constant thru inactivity.