Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am very new in Linux (first day). I needed to add my program to the OS startup. I could not find a solution, so I tried to do something that could solve my issue.

I added my line of text /opt/mono/bin/mono /root/MySoft/UDPServer.exe "$@" to /etc/rc.d/rc.local

Now my Centos is frozen in loading screen... Is there any way to fix it back? :)

share|improve this question
up vote 1 down vote accepted

You probably forgot to put it in the background with &. Your system will "come back" when the process exits.

If you can't log in from the console, you can always log in via ssh from another machine.

share|improve this answer
The problem is, that when I wrote my application, I infinite looped it since it is a UDP server application :\ And the funny thing that it works -- catches my packets and places them to the database :) – Andrew Feb 27 '13 at 4:22
OK, so ssh into the machine and fix it. – Michael Hampton Feb 27 '13 at 4:22
Michael, thank you! I was able to solve it! – Andrew Feb 27 '13 at 5:25

This certainly "works" (for some value of "works"), but it isn't the right way to start a server. CentOS 6 is still using upstart in SysVinit compatility mode, and my Fedora 18 here runs systemd, so the following is from memory. Check your system, look around! Don't trust a colored square on the Internet...

Check /etc/init.d, you will find the scripts that start all services on the machine there. See if there is as simple (short, ls(1) helps) script for handling a network service, copy that to /etc/init.d/yourservice, adjust the precedences (want to start latest and stop earliest), the runlevels in which the service is to be active, and the description in the header (the commented section at the beginning); read, understand, and modify to handle your service. Then use chkconfig(8) to activate it and check if it is correctly configured, and try starting/stopping/restarting it (service start yourservice, etc).

Check the documentation on startup/shutdown, this is a more detailed discussion of creating a new service from scratch, while you'll find a simple template here.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.