Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
another newbie here, struggling with my dedicated Linux server.
My question is: I have a custom installed program that needs to run 24/7. Before I was able to keep it running with nohup command. But after the upgrade, something keeps terminating the program every few days. Being a total newbie, I don't think I will be able to investigate what keeps shutting down my program.
My question is: what are my other options? What else can I use to keep my program running all the time? My server runs on Centos 5.3, have a WHM and I also have some very basic underatnding how to use SSH and putty. Thanks
nohup will only block the HUP signal to the program; that's the signal that the operating system sends to the program when the terminal closes.
There are other signals that can kill your program; KILL, for example, can be sent only by another userspace program, and will terminate the program. KILL can't be blocked. Another option is SIGSEGV, which is sent by the OS when the program tries to access a part of it's virtual memory space that hasn't been allocated (ie dereferencing a wild pointer); this would always indicate a bug in the program. You can get a full list of signals from http://en.wikipedia.org/wiki/Signal_...ist_of_signals
Basically, you need to know what is killing the program. The easiest way to do that is either to run the program through gdb as paulsm4 suggests, or through strace (which may provide more detailed logging if this is a signal problem).
thanks for the responses, I contacted the developer of the program (which actually IS indeed in testing stage), so there could be a bug in it. He said he would try to work it out, but in the meantime he suggested I write a script to start the program and nohup this script.
Unfortunately, I have no idea how to write such script. any ideas? the program is located in /usr/local/bin/program_name
is the basic one-line script.
(redirect might not be needed if prog already does its own logging, depends on why it dies.)
I suspect what he meant was write a watchdog prog (short shell script) to run from cron every say 5 mins to check the target prog. If target is dead, restart program.
As it seems to be dying unexpectedly, I'd use