A few options...First, cron is not the place for this.
If you have installed memcached from source (which there is little reason to do unless you have some very specific need), you can either:
Add the memcached start command (it would look something like "/usr/local/bin/memcached -d -p 11211 -u nobody -m 1024") to /etc/rc.local
write or find an /etc/init.d/memcached somewhere on the interwebs, drop it in/etc/init.d, and call:
chkconfig --add memcached
chkconfig memcached on
Install monit and configure monit to monitor and control the memcached service.
In my opinion, the best and simplest option is to install the memcached package from the EPEL repository with yum, in which case, you run the chkconfig command above to enable it at start up. With the EPEL packages, you will edit /etc/sysconfig/memcached to control the memcached bucket settings instead of calling the memcached binary with parameters directly.
It is possible, that the --level bit isn't required, but does give finer control
should work too..
The first one will turn memcached on (ie, start the daemon) whenever runlevels 2,3,4,5 are entered. i.e. startup.
This assumes that /etc/init.d/memcached is in the right place, but if you installed it from packages, it should be fine.
A few options...First, cron is not the place for this.
If you have installed memcached from source (which there is little reason to do unless you have some very specific need), you can either:
In my opinion, the best and simplest option is to install the memcached package from the EPEL repository with yum, in which case, you run the chkconfig command above to enable it at start up. With the EPEL packages, you will edit /etc/sysconfig/memcached to control the memcached bucket settings instead of calling the memcached binary with parameters directly.
Good luck.