Posts Tagged ‘自动运行’

Linux开机自动运行

我的系统:Ubuntu 11.04 \n \l

修改文件/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 this script does nothing.

/sbin/dhclient &>/tmp/dhclient.log
touch /home/maemo/12345.txt
service cron start
exit 0

这样,开机时,便会自动在/home/maemo/目录下生成一个新文件12345.txt;同时,启动定时服务cron。

%d bloggers like this: