1. Upload the packaged jar package to linux
2. Set permissions chmod +x xxx.jar
3.ln -s /www/service/xxx.jar /etc/init.d/xxx
4. Start service xxx start for the first time, start service xxx restart again, stop service xxx stop
Set up to start automatically:
1. Create a file
vi /usr/lib/systemd/system/xxx.service
content
[Unit]
Description=xxx Service
After=syslog.target
[Service]
ExecStart=/etc/init.d/ xxx start
SuccessExitStatus=143
Check if the service was created successfully
systemctl list-unit-files|grep tools
2. Set the boot to start automatically
systemctl enable myservice .service
If you modify the configuration file, you need to execute systemctl daemon-reload
After the springboot service is running, logs will be generated in /var/log. If not processed, the logs will continue to increase and eventually fill up the hard disk memory of the server. At this time, log cutting settings need to be made, as follows:
/etc/logrotate.d adds the log configuration file corresponding to /var/log
filenamexxx _
/var/log/xxx.log
{
I'm missing
daily
copytruncate
rotate 3
}
logrotate -vf /etc/logrotate.d/xxx and then start the configuration