Linux boot script linux boot script
User-defined Boot program (/etc/rc.d/rc.local)
The simplest and most convenient operation. Each time you start PHP ah, nginx ah bored to death, other ways to get shell Ah, connection ah, too cumbersome.
The operating examples are as follows:
vim /etc/rc.d/rc.local
#!/bin/sh##This script is executed *after* all and the other init scripts.#You can put your own initialization stuff in here if you don' t #Want to does the full Sys V style init stuff.Touch/var/lock/subsys/local#Add execute command/usr/local/nginx/sbin/nginx/usr/local/sbin/php-fpm/usr/local/mysql/support-files/mysql.server start
Redis boot requires point processing
Access to the Redis source package
$cp/utils/redis_init_script/etc/init.d #/utils/redis_init_script Copy to/etc/init.d $cp/etc/init.d/redis_6379 #重命名 (This is done in preparation for possible future cluster) $vi/etc/init.d/redis_6379 #第六行 redisport Modify the same port number
chmod 0777 /etc/init.d/redis_6379chkconfig redis_6379 on
Add to boot vi/etc/rc.d/rc.local
Add the following line
Service Redis Start
Finally, restart reboot to complete all service startup.
Linux boot Script