一.添加启动脚本 vim /etc/rc.d/rc.local sh /home/glt/apache-tomcat-/bin/email.sh 二.启动服务 systemctl enable rc-local.service systemctl status rc-local.service 参考:https://blog.csdn.net/qq562029186/article/details/67639676 https://blog.csdn.net/jiafu1115/article/