/etc/systemd/system/xampp_start.service
文件
[Unit]
Description=xampp_start
ConditionPathExists=/opt/lampp/autostart.sh
[Service]
Type=forking
ExecStart=/opt/lampp/autostart.sh
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99
[Install]
WantedBy=multi-user.target
注: <1>、ConditionPathExists:启动条件为/etc/init.d/aibox-service文件存在,启动条件还有After、Before等等 <2>、ExecStart:需要启动的脚本或程序为:/etc/init.d/aibox-service
autostart.sh
#!/bin/sh
### BEGIN INIT INFO
# Provides: test
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: test
# Description: test
### END INIT INFO
sudo /opt/lampp/xampp restart
systemctl enable xampp_start
systemctl start xampp_start.service
systemctl xampp_start
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
find ./ -name "*.tar.gz" -exec rm -rf {} \;
ClientAliveInterval 60
ClientAliveCountMax 10
PassivePorts 50000 50010 #指定数据端口的范围
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
https://blog.csdn.net/u014070279/article/details/126938399
|