Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am fairly new to system administration and I am simply trying to make sure nginx runs at startup on my Amazon EC2 instance (running Amazon linux)

I have placed the script in /etc/init.d, but it seems that Amazon linux does not come with the update-rc.d command. So how do I ensure the script will run at startup?

share|improve this question
add comment

1 Answer

up vote 11 down vote accepted

The Amazon Linux (which is essentially CentOS, which is essentially Red Hat) equivalent of update-rc.d is chkconfig. http://www.cyberciti.biz/faq/rhel5-update-rcd-command/

chkconfig --add nginx
chkconfig nginx on
share|improve this answer
    
Thank you so much! What if I am trying to add something that requires a command after it? Such as 'mysqld start' –  Andrew Guenther Dec 30 '11 at 5:05
    
It'll already automatically do each enabled service's start command on startup, and stop on shutdown. –  ceejayoz Dec 30 '11 at 5:08
add comment

Your Answer

 
discard

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.