原创
麒麟v10专业版本添加rc.local的方法
2022-12-22 14:18
1957
7
7
分类:
物联网
1、切换至root,建立rc-local.service文件
sudo su
vim /etc/systemd/system/rc-local.service复制代码2、在里面写入如下内容
[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、然后在创建文件rc.local
4、里面写入下面内容(红色部分就是开机所要执行的脚本和命令)
#!/bin/sh -e
sleep 3mount -t cifs -o iocharset=utf8,username=your_username,password=your_password,uid=1000,gid=1000 //192.168.123.1/软件 /home/kylin/桌面/share_testmount -t cifs -o iocharset=utf8,username=your_username,password=your_password,vers=1.0 //192.168.123.1/7F-file-62 /home/kylin/桌面/share_testexit 0复制代码5、加上权限
chmod +x /etc/rc.local
复制代码6、启动服务
systemctl enable rc-local
复制代码7、开启服务
systemctl start rc-local.service
复制代码
以上内容来源于技术论坛“信创技术联盟”,欢迎对信创感兴趣的朋友们一同到论坛相互讨论交流!
作者: 信创技术联盟, 来源:面包板社区
链接: https://mbb.eet-china.com/blog/uid-me-4027494.html
版权声明:本文为博主原创,未经本人允许,禁止转载!
文章评论(0条评论)
登录后参与讨论