linux添加x权限,Linux 7 的 rc.local 文件需要 添加 +x 权限才会自动执行
vmware 克隆的虛擬機添加的網關的沒有生效,每次重啟后都需要手工添加網關。 所以將添加命令寫到/etc/rc.local 文件里了。 https://www.cndba.cn/Dave/article/3906
https://www.cndba.cn/Dave/article/3906
https://www.cndba.cn/Dave/article/3906
[root@www.cndba.cn ~]# cat /etc/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
ip route add 192.168.74.1 dev ens33
touch /var/lock/subsys/local
[root@www.cndba.cn ~]#
但是重啟OS后并沒有生效。 需要對rc.local文件添加+x的權限后,重啟才執行命令。 隨筆記之。 https://www.cndba.cn/Dave/article/3906https://www.cndba.cn/Dave/article/3906https://www.cndba.cn/Dave/article/3906https://www.cndba.cn/Dave/article/3906https://www.cndba.cn/Dave/article/3906https://www.cndba.cn/Dave/article/3906
https://www.cndba.cn/Dave/article/3906
[root@www.cndba.cn ~]# chmod +x /etc/rc.local
版權聲明:本文為博主原創文章,未經博主允許不得轉載。
總結
以上是生活随笔為你收集整理的linux添加x权限,Linux 7 的 rc.local 文件需要 添加 +x 权限才会自动执行的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 数字图像处理matlab实验对图像复原,
- 下一篇: linux如何卸载netstat,lin