In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
A pit was encountered when the project was deployed.
When deploying zhihudemo, we did not use Jenkins as an automatic deployment tool, and encountered a hole when deploying the jar package project in linux centos. When you connect to the server remotely through xshell, when you start the jar package in the system using the "java-jar" command, the output log will occupy the current terminal page. If you close the terminal window, the whole java program will stop. In order to solve this problem, you can set the jar package as a background service. And further set for system service and boot self-booting
1. Write a startup script
The script is stored in a random location, and this example is saved in / etc/rc.d/init.d/file-preview-server.sh
#! / bin/bash# program# file preview server start export JAVA_HOME=/opt/jdk8export JRE=$JAVA_HOME/jreexport CLASSPATH=$JAVA_HOME/lib:$JRE/lib:.export PATH=$JAVA_HOME/bin/:$JRE/bin:$PATHnohup java-jar / root/file-preview-server/file-preview-server.jar > / root/file-preview-server/stdout.log &
two。 Add execution permissions to the / etc/rc.d/init.d/file-preview-server.sh file
Chmod + x / etc/rc.d/init.d/file-preview-server.sh
3. Add execution permissions to the / etc/rc.d/rc.local file
Chmod + x / etc/rc.d/rc.local
4. Edit / etc/rc.d/rc.local file
Add the following statement at the end of the file
Su-root-c'/ etc/rc.d/init.d/file-preview-server.sh'
At this point, it is done!
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.