Problems encountered when Java background scheduled jobs are released on Linux

Source: Internet
Author: User

In Linux these days, a Java scheduled job is released.ProgramStart to incrementally update the search engine index library at every day, but every time I log on to the server via SSH the next morning, PS-Ef | grep starttimer looks for the process of my scheduled job (starttimer is the class name at the entry point of the main program of My Timer Program ), the result process is gone, and I am wondering, I wrote a start. the sh script is used to start the job and CD it directly to the job directory, and then sudo. /start. sh starts to run, and the console also shows that the quantz job has been started successfully, but the process is no longer in the next day.

Baidu later said that the startup method will end with the exit of SSH. To implement the daemon process, you must use nohup to start it, that is, sudo nohup. /start. sh &, in this way, the SSH client exits and the Job Program is still running. You can view the process tree and pstree and find that the job starts a separate process instead of a SSH sub-process, exiting the index SSH does not end the job process.

 

Refer to Region

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.