麒麟v10專業(yè)版本添加rc.local的方法
1、切換至root,建立rc-local.service文件
sudo su
vim /etc/systemd/system/rc-local.service
2、在里面寫入如下內(nèi)容
[Unit]?
Description=/etc/rc.local Compatibility?
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、然后在創(chuàng)建文件rc.local
vim /etc/rc.local
4、里面寫入下面內(nèi)容(紅色部分就是開機(jī)所要執(zhí)行的腳本和命令)?
#!/bin/sh -e?
sleep 3
mount -t cifs -o iocharset=utf8,username=your_username,password=your_password,uid=1000,gid=1000 //192.168.123.1/軟件 /home/kylin/桌面/share_test
mount -t cifs -o iocharset=utf8,username=your_username,password=your_password,vers=1.0 //192.168.123.1/7F-file-62 /home/kylin/桌面/share_test
exit 0
5、加上權(quán)限
chmod +x /etc/rc.local
6、啟動(dòng)服務(wù)
systemctl enable rc-local
7、開啟服務(wù)
systemctl start rc-local.service

以上內(nèi)容來源于技術(shù)論壇“信創(chuàng)技術(shù)聯(lián)盟”https://www.cnxclm.com/read-3690-1.html,歡迎對(duì)信創(chuàng)感興趣的朋友們一同到論壇相互討論交流!
