-
Senior Member
registered user
Locking the keyboard during a script command
.
I have a simple script that does some useful housekeeping jobs;
however, it will hang up and require a re-command if any keyboard activity
occurs during the small time it takes to perform the housekeeping jobs.
Are there some simple commands that would allow me to lock-out
the keyboard just before and re-activate the keyboard just after
the script operations are in process?
-
Senior Member
registered user

Originally Posted by
utu
.
I have a simple script that does some useful housekeeping jobs;
however, it will hang up and require a re-command if any keyboard activity
occurs during the small time it takes to perform the housekeeping jobs.
Are there some simple commands that would allow me to lock-out
the keyboard just before and re-activate the keyboard just after
the script operations are in process?
Are you referring to locking the keyboard when you are running the script from a lxterminal ( or any other terminal emulators ) or you want to lock the entire keyboard and mouse for the entire X Window session ? If it is the formal you can consider using nohup and redirect input to null.
$ nohup command arg ..... < /dev/null
If it is the latter, I am not aware of a way to do it. In LXDE, locking is easy but automatically unlock is tough.
-
Senior Member
registered user
@ kl522
I have a small /etc/rc.local script which does things at boot.
Takes about 60 seconds. Any keyboard activity at all prior to
its completion seems to reset the clock for another 60 second wait.
I thought there might be something like 'init x' added before
and 'init y' added after the script would lock out the keyboard
while the script is doing its thing.
This begs the question about what happens if the script itself
hangs up.
Last edited by utu; 05-13-2011 at 02:34 PM.
-
Senior Member
registered user

Originally Posted by
utu
@ kl522
I have a small /etc/rc.local script which does things at boot.
Takes about 60 seconds. Any keyboard activity at all prior to
its completion seems to reset the clock for another 60 second wait.
Try 'nohup', that's what it is meant for, making whatever script/command immune to standard input.
-
Senior Member
registered user
@ kl522
Took a few lines out of /etc/rc.local and made a separate
script called /etc/setup.
Replaced those lines in the original /etc/rc.local with
nohup /etc/setup &.
Keyboard input no longer upsets the process.
Thanks.
-
Senior Member
registered user
@ kl522
Two amendments:
(1) /etc/rc.local doesn't like the '&'; I've deleted it; and
(2) I've added '> /dev/null 2>&1' in its place to do away with
a lot of nohup messages showing up in home.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

Corsair Vengeance 32GB (2x16GB) RAM DDR5 6000MHz CMK32GX5M2B6000Z30
$329.99

Lot Of 3 Micron 32GB DDR5 4800 CL40 2Rx8 UDIMM Desktop RAM MTC16C2085S1UC48BA1
$900.00

16GB (2x8GB) Kingston HyperX blu KHX1600C10D3B1/8G PC3-12800U DDR3 1600
$27.99

G.Skill Trident Z Royal 256GB 8x32GB F4-3200C14Q2-256GTRG CL14-18-18-38 DDR4 RAM
$2700.00

DDR4 Laptop RAM 4GB 8GB 16GB 32GB 2400 2666 3200 Samsung Hynix
$66.00

A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G
$21.68

HyperX FURY 16GB (2x8GB) DDR3-1600 PC3-12800 288-Pin DIMM HX316C10FB/8
$25.00

RAMAXEL Lenovo 32GB LPDDR5X CAMM2 7500MHz Laptop RAM | UNTESTED
$445.00

Crucial DDR3L 16GB 2 x 8GB 1600 MHz PC3L-12800 Laptop RAM Sodimm Memory 1.35V
$41.00

Pair Kingston 32GB (2x16GB) PC3-14900 DDR3-1866MHz Reg Server Memory Ram
$24.90