Results 1 to 6 of 6

Thread: Locking the keyboard during a script command

  1. #1
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631

    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?

  2. #2
    Senior Member registered user
    Join Date
    Dec 2009
    Posts
    423
    Quote Originally Posted by utu View Post
    .
    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.

  3. #3
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    @ 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.

  4. #4
    Senior Member registered user
    Join Date
    Dec 2009
    Posts
    423
    Quote Originally Posted by utu View Post
    @ 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.

  5. #5
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    @ 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.

  6. #6
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    @ 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
  •  


IBM System X3850-X5 Server w/4x Intel  Xeon E7-4870 CPU , 512 GB DDR3 RAM,NO HDD picture

IBM System X3850-X5 Server w/4x Intel Xeon E7-4870 CPU , 512 GB DDR3 RAM,NO HDD

$1599.99



IBM QRadar xx29 2x Xeon E5-2650v4 2x 900W PSU M5120 12x 3.5

IBM QRadar xx29 2x Xeon E5-2650v4 2x 900W PSU M5120 12x 3.5" Bay Server No RAM

$179.99



IBM X3650 M4 Server System Board 00MX553 00AM209 00Y8499 00Y8457 00D2888 00W2671 picture

IBM X3650 M4 Server System Board 00MX553 00AM209 00Y8499 00Y8457 00D2888 00W2671

$230.00



IBM ADP Server Type 7870 AC1 NO HDD | 128GB RAM PC3L | 2 x Xeon  E5620 picture

IBM ADP Server Type 7870 AC1 NO HDD | 128GB RAM PC3L | 2 x Xeon E5620

$199.99



IBM X3650 M5 5462-AC1,2 X E5-2640V3 2.6GHZ 8C, 16 GB, DUAL 750W, 2 X 1TB SERVER picture

IBM X3650 M5 5462-AC1,2 X E5-2640V3 2.6GHZ 8C, 16 GB, DUAL 750W, 2 X 1TB SERVER

$349.99



IBM SYSTEM X3500 M3 SERVER 7380AC1 TOWER Server XEON E5620 8GB RAID SEE NOTES picture

IBM SYSTEM X3500 M3 SERVER 7380AC1 TOWER Server XEON E5620 8GB RAID SEE NOTES

$111.70



IBM System x3550 M3 1U Server 2x Xeon E5645, 192GB RAM, 2x 300GB HDD (7944-AC1) picture

IBM System x3550 M3 1U Server 2x Xeon E5645, 192GB RAM, 2x 300GB HDD (7944-AC1)

$150.00



IBM Power 720 8202-E4B Server - POWER7 4-Core 3GHz, 8GB, 2x 146GB HDD, 1725W PSU picture

IBM Power 720 8202-E4B Server - POWER7 4-Core 3GHz, 8GB, 2x 146GB HDD, 1725W PSU

$450.00



DELL POWEREDGE HP IBM SERVER XEON GOLD 5315Y 8 CORE PROCESSOR 3.2 GHZ SRKXR picture

DELL POWEREDGE HP IBM SERVER XEON GOLD 5315Y 8 CORE PROCESSOR 3.2 GHZ SRKXR

$1100.00



IBM 7915 AC1 M4 E27R704 Server Intel 2650V2 32GB RAM NO HDD w/ 2x 750w PSU picture

IBM 7915 AC1 M4 E27R704 Server Intel 2650V2 32GB RAM NO HDD w/ 2x 750w PSU

$225.00