1、新增rc.local服務
2、賦執行許可權super@super:~$ sudo
more /etc/systemd/system/rc-local.service
[unit]
description=rc.local
conditionpathexists=/etc/rc.local
[service]
type=forking
execstart=/etc/rc.local start
timeoutsec=0
standardoutput=tty
remainafterexit=yes
sysvstartpriority=99
[install]
wantedby=multi-user.target
3、啟動rc.local服務super@super:~$ sudo
chmod +x /etc/rc.local
4、指令碼啟動方式新增到/etc/rc.localsuper@super:~$ sudo systemctl start rc-local.service # 啟動
super@super:~$ sudo systemctl status rc-local.service # 檢視伺服器是否正常啟動
super@super:~$ sudo systemctl enable rc-local.service # 開機啟動
5、檢查mysql是否啟動了super@super:~$ sudo vim /etc/rc.local
#!/bin/bash
#rc.local自啟動指令碼
# 啟動mysql示例
/etc/init.d/mysqld start
exit 0;
這樣就完成了ubuntu跟redhat一樣啟動指令碼了。super@super:~$ ps -ef|
grep mysqld
super 2175 1555 0 02:34 pts/0 00:00:00 grep --color=auto mysqld
ubuntu開機自啟動
update rc.d defaults nn命令 nn為啟動順序 將指令碼新增到初始化執行的佇列中去。注意如果指令碼需要用到網路,則nn需設定乙個比較大的數字,如99。1 將你的啟動指令碼複製到 etc init.d目錄下,以下假設你的指令碼檔名為 test。2 設定指令碼檔案的許可權 sudo ...
ubuntu開機自啟動roslaunch程式
參考鏈結 建立star.sh bin bash source opt ros kinetic setup.bash source catkin ws devel setup.bash roslaunch x x.launch 增加star.sh許可權 sudo chmod 777 star.sh搜尋...
ubuntu開機啟動svn(新增自啟動)
今天伺服器重啟了之後,在手動啟動svn服務的時候,想寫個指令碼,讓ubuntu的開機自啟動svn服務。bin bash svnserve d r home svn update rc.d starsvn.sh defaults 這個命令等效於update rc.d startsvn.sh start...