Help me to understand. On the Red Hat Enterprise Linux Server release 6.7 (Santiago) system, it’s worth init upstart:
rpm -qf /sbin/init upstart-0.6.5-13.el6_5.3.x86_64
But despite the presence of the /etc/init/nginx.conf file:
cat /etc/init/nginx.conf # nginx description "nginx http daemon" author "George Shammas <georgyo@gmail.com>" # start on (filesystem and net-device-up IFACE=!lo) start on runlevel [2345] stop on runlevel [!2345] env DAEMON=/usr/sbin/nginx env PID=/var/run/nginx.pid expect fork respawn respawn limit 10 5 #oom never pre-start script $DAEMON -t if [ $? -ne 0 ] then exit $? fi end script exec $DAEMON
NGINX does not start after reboot:
initctl status nginx nginx stop/waiting
There used to be a /etc/init.d/nginx file, and when you added it to autorun, it started:
chkconfig nginx on
But this is System V's behavior, and I do not quite understand where is the bridge from Upstart to it. After all, chkconfig works, and the scripts from /etc/init.d run. Who launches them is not clear ( /etc/init.d/rc
did not find). But this later. Now I can’t understand why if there is a start on runlevel [2345]
entry in the /etc/init/nginx.conf
folder and the start on runlevel [2345]
entry, it does not start.
I want to use the Upstart autostart because /etc/init/nginx.conf
has the ability to automatically respawn during a crash (God forbid)).
initctrl start nginx
run? - Alexey Ten/etc/init/
run? - Alexey Teninitctl emit runlevel=3
to simulate such an event in the system but nginx did not start. - Mihail Politaev