ubuntu在rc.local中加了代码但无法执行,求助哈~

57 views
Skip to first unread message

Zhizhuo zhi

unread,
May 25, 2011, 6:14:05 AM5/25/11
to hefeilug
//------------------------------------------内容大概是这个样子------------------------------------------------------
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

echo -n 200 > /sys/devices/platform/i8042/serio4/serio5/speed
echo -n 250 > /sys/devices/platform/i8042/serio4/serio5/sensitivity

exit 0
//------------------------------------------------------------------------------------------------

意思就是修改Thinkpad指点杆的速度和灵敏度灵敏度~thinkwiki说可以这样改得,但是一直无法执行啊~只有把这两句单独写个脚本才能在登录后执行
谢谢解答哈~

(ps,尝试过1.修改默认BASH 2.去第一行的 -e参数 3.在语句前加 sudo.... 但都无效~ 终端显示的是一个错误说文件不存在)

dword

unread,
May 25, 2011, 1:06:47 PM5/25/11
to hefe...@googlegroups.com

估计执行rc.local时相关驱动模块还未加载。TP我不熟,所以不多说了。

signature.asc

NULL

unread,
May 25, 2011, 6:50:31 PM5/25/11
to hefe...@googlegroups.com
应该是这两个参数在载入x后重置了,当年我调教指点杆的时候也有这个问题。
我的解决方案是把这个放在登录后执行,比较不优雅,呵呵。

2011/5/25, Zhizhuo zhi <skl...@gmail.com>:

--
从我的移动设备发送

Best Regards,
Hal

Yuanchong Zhu

unread,
May 25, 2011, 7:29:22 PM5/25/11
to hefe...@googlegroups.com
我的thinkpad加入指点杆滚屏功能,就是进了X之后手动起的脚本~
在自己的家目录下建个bin文件夹,加到环境变量PATH里就可以随手调用自己的脚本了~

--
灿烂星空,你就是我的英雄!

Zhizhuo zhi

unread,
May 26, 2011, 6:44:19 AM5/26/11
to hefe...@googlegroups.com
lz来了,现在好悲剧,每次都得开机sh我的脚本...指点杆迟钝的痛苦啊

Liang Guo

unread,
May 27, 2011, 3:45:46 AM5/27/11
to hefe...@googlegroups.com
2011/5/25 Zhizhuo zhi <skl...@gmail.com>:
rc.local脚本是有/etc/rc2.d/S

有没有/etc/rc2.d/S开头的脚本指向/etc/rc.local


--
Liang Guo
http://bluestone.cublog.cn

Reply all
Reply to author
Forward
0 new messages