Linux怎么设置开机时自动运行某个程序?
直接vi /etc/rc.d/rc.local这个文件,新建一行,运行你程序所在的目录就OK了
例如我要运行/home/ttt下的 abc.sh文件,就在rc.local里写一行
/home/ttt/abc.sh
其实很简单
只要把一些消息加到后面就可以了
比如:
echo "/usr/sbin/vsftpd &" >> /etc/rc.d/rc.local
echo "mount -t vfat /dev/sda5 /mnt/d" >> /etc/rc.d/rc.local
直接vi /etc/rc.d/rc.local这个文件,新建一行,运行你程序所在的目录就OK了
例如我要运行/home/ttt下的 abc.sh文件,就在rc.local里写一行
/home/ttt/abc.sh
其实很简单
只要把一些消息加到后面就可以了
比如:
echo "/usr/sbin/vsftpd &" >> /etc/rc.d/rc.local
echo "mount -t vfat /dev/sda5 /mnt/d" >> /etc/rc.d/rc.local