Rhel 6.7 rc.local script issues
Hello,
I'm having a basic issue with the /etc/rc.local script. I recently migrated to a Lenovo T450, and found that I really dislike the large touchpad as it interferes with my typing. There's a command that I can run to disable the thinkpad: input set-prop `xinput | grep "Synaptics" | awk -F\= '{print $2}'| awk '{print $1}' ` "Device Enabled" 0 This command works fine, but doesn't seem to execute (at least properly) when I throw it in the rc.local init script. Here is the init script in its entirety: #!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. #Disables touchpad xinput set-prop `xinput | grep "Synaptics" | awk -F\= '{print $2}'| awk '{print $1}' ` "Device Enabled" 0 touch /var/lock/subsys/local The file is owned by root, and permissions are set at the default 755. I can't think of what would be causing the script to fail, so any help would be greatly appreciated! I've modified the BIOS settings to disable the touchpad, but this doesn't work either. |
Normally for doing rc or cron type work I find it is best to give the full path to all commands.
I would add that there is definitely no reason to use grep and multiple awks when a single awk can do the job. (not using xinput I would need to see the output to improve the script). I also assume you have this script in the correct directory and set to the appropriate level. |
Quote:
⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ TPPS/2 IBM TrackPoint id=13 [slave pointer (2)] ⎜ ↳ Macintosh mouse button emulation id=14 [slave pointer (2)] ⎜ ↳ SynPS/2 Synaptics TouchPad id=15 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ ThinkPad Extra Buttons id=6 [slave keyboard (3)] ↳ Lid Switch id=7 [slave keyboard (3)] ↳ AT Translated Set 2 keyboard id=8 [slave keyboard (3)] ↳ Sleep Button id=10 [slave keyboard (3)] ↳ Video Bus id=11 [slave keyboard (3)] ↳ Power Button id=12 [slave keyboard (3)] ↳ Integrated Camera id=9 [slave keyboard (3)] The process I am interested in scripting to kill at launch is the Sypatics Touchpad. The scripts written above will kill the process, but when thrown into the rc.local it doesn't seem to execute. |
So I would change the below as shown:
Code:
xinput set-prop `xinput | grep "Synaptics" | awk -F\= '{print $2}'| awk '{print $1}' ` "Device Enabled" 0 |
Quote:
Code:
|
/Synaptics/ - Find lines with this word one them
print gensub(/[^0-9].*/,"",1,$2) - If above is true, remove everything from first non-digit onwards and return to print |
Thanks much for your help, it is appreciated.
|
All times are GMT -5. The time now is 10:42 PM. |