w****g 发帖数: 597 | 1 请问Ubuntu 9.04下开机自动执行命令行的设置? 包子感谢。
需要开机自动执行的命令是调节LCD亮度,这条调亮度命令是需要先输入密码使用
在root用户权限之下,才能执行的调亮度命令:
$sudo sh -c "echo -n 60 > /proc/acpi/video/VID1/LCD/brightness"
但是,每次执行sudo命令需要用户手动输入密码,很麻烦,没有自动化的设置。
希望的系统设置为可以让OS每次开机后自动调节LCD亮度:
1,既可以使Ubuntu自动执行调节LCD亮度,又
2,不需要每次开机后用户手动输入root用户的密码。谢谢。 |
N****w 发帖数: 21578 | 2 put it in
/etc/rc.d/rc.local
LCD
【在 w****g 的大作中提到】 : 请问Ubuntu 9.04下开机自动执行命令行的设置? 包子感谢。 : 需要开机自动执行的命令是调节LCD亮度,这条调亮度命令是需要先输入密码使用 : 在root用户权限之下,才能执行的调亮度命令: : $sudo sh -c "echo -n 60 > /proc/acpi/video/VID1/LCD/brightness" : 但是,每次执行sudo命令需要用户手动输入密码,很麻烦,没有自动化的设置。 : 希望的系统设置为可以让OS每次开机后自动调节LCD亮度: : 1,既可以使Ubuntu自动执行调节LCD亮度,又 : 2,不需要每次开机后用户手动输入root用户的密码。谢谢。
|
w****g 发帖数: 597 | 3 谢谢。查了一下,Ubuntu 9.04没有这个你提到这个目录和文件:
$ cat /etc/rc.d/rc.local
cat: /etc/rc.d/rc.local: No such file or directory
$ cd /etc/rc.d
bash: cd: /etc/rc.d: No such file or directory
使用了/etc/rc.local运行调节亮度的命令也没有效果。
$ cat /etc/rc.local
#!/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 thi
【在 N****w 的大作中提到】 : put it in : /etc/rc.d/rc.local : : LCD
|
p*****s 发帖数: 344 | 4 check those files, and your runlevel
ls -la /etc/rc*.d/S99rc.local
you will see which rc.local is executed durint bootup |
w****g 发帖数: 597 | 5 谢谢。按照你的指导查看一下,得知结果如下,然后,请问该怎么设置?
$ ls -la /etc/rc*.d/S99rc.local
/etc/rc2.d/S99rc.local -> ../init.d/rc.local
/etc/rc3.d/S99rc.local -> ../init.d/rc.local
/etc/rc4.d/S99rc.local -> ../init.d/rc.local
/etc/rc5.d/S99rc.local -> ../init.d/rc.local
$ cat /etc/init.d/rc.local
#! /bin/sh
### BEGIN INIT INFO
# Provides: rc.local
# Required-Start: $remote_fs
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Run /etc/rc.local if it exist
### END INIT INFO
PAT
【在 p*****s 的大作中提到】 : check those files, and your runlevel : ls -la /etc/rc*.d/S99rc.local : you will see which rc.local is executed durint bootup
|