Debian 9 默认不带 /etc/rc.local 文件?而 rc.local 服务却还是自带的。
参考该篇文章链接
例如开机后台启动frp服务。
root@phicomm:~/frp_0.28.2_linux_arm64# cat startfrpc.sh
#!/bin/sh
cd /root/frp_0.28.2_linux_arm64
./frpc -c frpc.ini 1>/dev/null 2>&1 &
1>/dev/null 2>&1 &保持后台运行
对应rc.local文件
root@phicomm:~/frp_0.28.2_linux_arm64# cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/root/frp_0.28.2_linux_arm64/startfrpc.sh
exit 0
再执行:
systemctl enable rc-local
systemctl start rc-local.service
网友评论