由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Linux版 - 请问Ubuntu下开机自动执行命令的设置?
相关主题
刚装了个ubuntu 10.10ubuntu 8.10下的 kde 4.1很华丽阿
是不是ubuntu下面硬盘转的比较多?新警察求助 Ubuntu 8.10 下安装aMule 问题
ubuntu server 14.04.1关机卡住在ubuntu下怎么装latex?菜鸟求助!
在w520上装10.04,fn+home/end调亮度问题。。Ubuntu向普通用户提供高级Screen功能 [ZZ]
system beep为什么有两个ubuntu在启动里面
Ubuntu 16.04 LTS 关机重启问题?[已解决]请问如何在auto mount NTFS partition?
thinkpad 无线问题菜鸟求教怎么卸载amsn
ubuntu 8.10 真tmd烦,搞半天都没找到rootUbuntu 自动安装微软雅黑字体 (zt)
相关话题的讨论汇总
话题: etc话题: ubuntu话题: lcd话题: 开机话题: 设置
进入Linux版参与讨论
1 (共1页)
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

1 (共1页)
进入Linux版参与讨论
相关主题
Ubuntu 自动安装微软雅黑字体 (zt)system beep
ubuntu有可能自动删除帐号吗?Ubuntu 16.04 LTS 关机重启问题?
ubuntu 装了5个boot optionsthinkpad 无线问题
ubuntu 如何安装 tomcatubuntu 8.10 真tmd烦,搞半天都没找到root
刚装了个ubuntu 10.10ubuntu 8.10下的 kde 4.1很华丽阿
是不是ubuntu下面硬盘转的比较多?新警察求助 Ubuntu 8.10 下安装aMule 问题
ubuntu server 14.04.1关机卡住在ubuntu下怎么装latex?菜鸟求助!
在w520上装10.04,fn+home/end调亮度问题。。Ubuntu向普通用户提供高级Screen功能 [ZZ]
相关话题的讨论汇总
话题: etc话题: ubuntu话题: lcd话题: 开机话题: 设置