Fli
07-03-2013, 06:32 PM
How one can make some linux service like mysql, apache start automatically on server reboot?
There are several ways, here is Mysqld service example:
will just add the service:
chkconfig --add mysqld
will add + enable service to autostart (make the service enabled on levels 2345 - default & working config on my linux) that is what we need
chkconfig mysqld on
It can be done also manually entering levels, but why? :
chkconfig --level 2345 mysqld on
After the command, try to run following command to ensure service was added/enabled (on):
chkconfig --list mysqld
The result - enabled mysqld autostart should be:
chkconfig --list mysqld
mysqld 0 off 1 off 2 on 3 on 4 on 5 on 6 off
On Debian/Ubuntu
At Debian based os, mysql should be able to launch using: update-rc.d mysqld defaults ?
There are several ways, here is Mysqld service example:
will just add the service:
chkconfig --add mysqld
will add + enable service to autostart (make the service enabled on levels 2345 - default & working config on my linux) that is what we need
chkconfig mysqld on
It can be done also manually entering levels, but why? :
chkconfig --level 2345 mysqld on
After the command, try to run following command to ensure service was added/enabled (on):
chkconfig --list mysqld
The result - enabled mysqld autostart should be:
chkconfig --list mysqld
mysqld 0 off 1 off 2 on 3 on 4 on 5 on 6 off
On Debian/Ubuntu
At Debian based os, mysql should be able to launch using: update-rc.d mysqld defaults ?