1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| # 1. 使用root账户登录,修改/etc/rc.local 文件 [root@host-172-16-2-210 ~]# 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.
touch /var/lock/subsys/local
su - test -c "/bin/sh /home/test/init.d/fdfs_trackerd start" su - test -c "/bin/sh /home/test/init.d/fdfs_storaged start"
# 2. 给/etc/rc.local 文件赋予执行权限 chmod +x /etc/rc.d/rc.local
# 3. 禁用防火墙 systemctl disable firewalld systemctl stop firewalld
# 4. 重启测试
|