[CentOS] /etc/init.d CentOS 7

Thu Sep 25 19:56:29 UTC 2014
m.roth at 5-cent.us <m.roth at 5-cent.us>

Jerry Geis wrote:
>>is your init.d script chmod +x ?
>
>>just putting something in init.d isn't sufficient, it has to be linked
>>in rc?.d  as a S##name  ... which chkconfig on (or systemctl) are
>>supposed to do
>
> Yes the script is executable... forgot to mention that.
>
> From the comment in the README file, I thought that was all I needed to
> do.
>
> I have not run any chkconfig or systemctl.

That's the problem, then. It should have comments, near the top, as to
what what runlevel it should be started at, and *when* (i.e., after the
network is up for apache...). Then running chkconfig <servicename> on will
make it happen.

>From a 6.5 server, from /etc/init.d/sshd:

# chkconfig: 2345 55 25

This will start and make sure sshd is running in runlevels 2, 3, 4, and 5,
and it will start it as S55sshd on the way up, and shut id down with K25
on the reboot.

      mark