遇到一个棘手的需求,需要在后端跑到爬虫进程
刚开始是这样的,在后面加 &
$ ./test.sh &
关掉shell依然后kill掉进程,后来发现其父进程还是当前终端shell的进程,而一旦父进程退出,则会发送hangup信号给所有子进程,子进程收到hangup以后也会退出。如果要在退出shell的时候继续运行进程,则需要使用nohup忽略hangup信号,或者setsid将将父进程设为init进程(进程号为1)
详细代码是这样的:
$nohup ./test.sh & $echo $$ 21734 $ nohup ./test.sh & [1] 29016 $ ps -ef | grep test 515 29710 21734 0 11:47 pts/12 00:00:00 /bin/sh ./test.sh 515 29713 21734 0 11:47 pts/12 00:00:00 grep test $ setsid ./test.sh & [1] 409 $ ps -ef | grep test 515 410 1 0 11:49 ? 00:00:00 /bin/sh ./test.sh 515 413 21734 0 11:49 pts/12 00:00:00 grep test
安装screen
yum install -y screen
输入screen,然后输入你要运行的命令
ctrl+A 然后按D,screen会关闭
查看正在运行的程序
screen -ls
I’ve been absent for a while, but now I remember why I used to love this blog. Thanks, I?¦ll try and check back more often. How frequently you update your web site?
I have been exploring for a bit for any high quality articles or weblog posts on this sort of house . Exploring in Yahoo I eventually stumbled upon this web site. Reading this information So i am glad to exhibit that I have an incredibly just right uncanny feeling I found out just what I needed. I most definitely will make sure to do not disregard this site and give it a glance on a constant basis.
Interesting post made here. One thing I would really like to say is most professional domains consider the Bachelors Degree just as the entry level standard for an online certification. Even though Associate College diplomas are a great way to start out, completing a person’s Bachelors presents you with many good opportunities to various professions, there are numerous on-line Bachelor Diploma Programs available through institutions like The University of Phoenix, Intercontinental University Online and Kaplan. Another concern is that many brick and mortar institutions provide Online editions of their college diplomas but often for a drastically higher cost than the companies that specialize in online education programs.
I?ll right away grab your rss as I can not find your e-mail subscription link or newsletter service. Do you’ve any? Please let me know in order that I could subscribe. Thanks.
Hello! I simply want to give a huge thumbs up for the great info you could have here on this post. I will probably be coming back to your weblog for more soon.
I’ve been absent for some time, but now I remember why I used to love this blog. Thanks , I?ll try and check back more frequently. How frequently you update your website?
I’d personally also like to state that most of those who find themselves with out health insurance are usually students, self-employed and those that are unemployed. More than half of the uninsured are really under the age of 35. They do not think they are requiring health insurance because they are young in addition to healthy. Their particular income is generally spent on houses, food, in addition to entertainment. Many people that do represent the working class either full or part-time are not provided insurance by way of their work so they get along without as a result of rising cost of health insurance in the states. Thanks for the tips you discuss through this web site.
It?s laborious to seek out knowledgeable folks on this matter, however you sound like you already know what you?re speaking about! Thanks
Thanks , I have recently been searching for info approximately this subject for a long time and yours is the best I have came upon so far. However, what concerning the conclusion? Are you sure in regards to the source?
We are a gaggle of volunteers and starting a brand new scheme in our community. Your website provided us with valuable info to work on. You’ve performed an impressive activity and our entire community will probably be thankful to you.
I used to be suggested this blog by my cousin. I am not certain whether or not this post is written via him as no one else recognise such designated approximately my difficulty. You’re amazing! Thanks!
In my opinion that a foreclosure can have a major effect on the borrower’s life. Foreclosures can have a Several to ten years negative effects on a borrower’s credit report. The borrower having applied for a mortgage or any loans as an example, knows that the particular worse credit rating is, the more tricky it is to have a decent mortgage. In addition, it may affect a borrower’s capacity to find a quality place to lease or rent, if that gets the alternative property solution. Interesting blog post.
Along with everything which appears to be developing within this particular area, all your perspectives happen to be relatively radical. Having said that, I am sorry, because I do not give credence to your whole theory, all be it refreshing none the less. It appears to everyone that your commentary are generally not completely rationalized and in fact you are generally yourself not even completely confident of the point. In any case I did appreciate looking at it.
It?s laborious to find educated individuals on this subject, but you sound like you know what you?re talking about! Thanks
I have been browsing online more than three hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. In my opinion, if all site owners and bloggers made good content as you did, the web will be a lot more useful than ever before.
Thanks a lot for sharing this with all people you really realize what you’re talking about! Bookmarked. Kindly also consult with my site =). We can have a link change agreement between us!
I beloved up to you will receive carried out proper here. The comic strip is tasteful, your authored subject matter stylish. nevertheless, you command get got an impatience over that you wish be handing over the following. in poor health certainly come further earlier once more since exactly the same just about a lot frequently inside of case you shield this hike.
You made some first rate points there. I appeared on the internet for the problem and located most individuals will go along with with your website.
Thanks for your advice on this blog. 1 thing I would want to say is that purchasing electronic devices items through the Internet is certainly not new. In truth, in the past decades alone, the market for online electronic products has grown considerably. Today, you could find practically any type of electronic unit and tools on the Internet, ranging from cameras and also camcorders to computer pieces and video games consoles.
I savour, result in I discovered exactly what I was taking a look for. You’ve ended my four day long hunt! God Bless you man. Have a nice day. Bye
I really appreciate this post. I?ve been looking everywhere for this! Thank goodness I found it on Bing. You have made my day! Thanks again
Valuable info. Lucky me I found your site by accident, and I’m shocked why this accident didn’t happened earlier! I bookmarked it.
Spot on with this write-up, I actually think this website wants much more consideration. I?ll in all probability be again to learn much more, thanks for that info.
Please tell me more about this. May I ask you a question?
Thank you for writing such a great article. It helped me a lot and I love the subject.
Thank you for your articles. I find them very helpful. Could you help me with something?
Thanks for writing the article
You’ve been a big help to me. Thank you!
I believe this web site has got some rattling wonderful info for everyone. “Glory is fleeting, but obscurity is forever.” by Napoleon.
One thing I’d prefer to say is that often car insurance cancellation is a terrifying experience and if you’re doing the correct things being a driver you simply will not get one. A number of people do are sent the notice that they are officially dropped by the insurance company they then have to scramble to get extra insurance following a cancellation. Inexpensive auto insurance rates are usually hard to get from cancellation. Having the main reasons for auto insurance cancellation can help people prevent completely losing in one of the most significant privileges accessible. Thanks for the thoughts shared by means of your blog.
May I request more information on the subject? All of your articles are extremely useful to me. Thank you!
Thank you for your post. I really enjoyed reading it, especially because it addressed my issue. It helped me a lot and I hope it will help others too.
I am curious to find out what blog system you’re utilizing? I’m having some minor security issues with my latest website and I would like to find something more safe. Do you have any recommendations?
You helped me a lot. These articles are really helpful dude.
Please tell me more about this
obviously like your web-site however you have to test the spelling on quite a few of your posts. Several of them are rife with spelling issues and I to find it very troublesome to inform the truth nevertheless I will certainly come back again.
That’s what i mean when i say that content is the king!
I really appreciate your help
WONDERFUL Post.thanks for share..more wait .. …
Thank you for your post. I really enjoyed reading it, especially because it addressed my issue. It helped me a lot and I hope it will help others too.
Thanks , I have just been searching for info about this subject for a long time and yours is the greatest I’ve found out so far. However, what concerning the bottom line? Are you sure concerning the source?
Thanks for another informative website. Where else could I am getting that kind of information written in such an ideal method? I’ve a undertaking that I am just now working on, and I have been on the look out for such information.
Thanks for your post. Another factor is that to be a photographer consists of not only problems in recording award-winning photographs and also hardships in getting the best camera suited to your needs and most especially problems in maintaining the standard of your camera. This really is very genuine and clear for those photography fans that are straight into capturing the particular nature’s eye-catching scenes – the mountains, the actual forests, the particular wild or maybe the seas. Going to these exciting places surely requires a camera that can live up to the wild’s tough setting.
There is no doubt that your post was a big help to me. I really enjoyed reading it.
What?s Happening i am new to this, I stumbled upon this I’ve found It positively helpful and it has aided me out loads. I hope to contribute & aid other users like its helped me. Great job.
Thank you for posting such a wonderful article. It helped me a lot and I adore the topic.
Please tell me more about your excellent articles
Dear can you please write more on this? Your posts are always helpful to me. Thank you!
Thanks for the tips about credit repair on all of this site. The things i would tell people is to give up the actual mentality that they may buy right now and pay out later. Like a society many of us tend to do this for many things. This includes trips, furniture, plus items we really want to have. However, you should separate your current wants from all the needs. As long as you’re working to improve your credit score you really have to make some trade-offs. For example you are able to shop online to save cash or you can check out second hand merchants instead of expensive department stores intended for clothing.
Good write-up, I am normal visitor of one’s site, maintain up the excellent operate, and It is going to be a regular visitor for a lengthy time.