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

I recently installed memcached and I want it to run by default on my Fedora LAMP server (Amazon EC2 Instance)

I've set it up in my init script doing the following:

chkconfig --level 4 memcached on

However, I have a bunch of parameters I'd like to set when memcached runs at boot time. Is there a way I can do this through chkconfig, or do I need to use a different approach?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

First, startup scripts generally only accept 'stop' or 'start' as their only parameter. This is passed by the startup routine as it launches each startup/shutdown script.

The chkconfig, basically puts a symbolic link into the startup directory such that the startup/shutdown routines will look at it.

Thus you cannot pass parameters using this process.

-----preferred method 1

However, the way usually used to setup variable and parameters is to put the parameters into /etc/sysconfig/.

The script usually imports these configuration parameters early on in the execution of the service startup script (via a . /etc/sysconfig/).

---- not perferred method 2

You can edit the startup script that is usually located in /etc/init.d/ to do what you want. The problem with this approach is that if you happen to apply an update it is likely that any changes like this would disappear.


Enjoy!

Another approach

share|improve this answer

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.