/etc/profile This is also the startup script. And the priority is very high oh.
The following are all online search
(1) Edit File/etc/rc.local
Input command: Vim/etc/rc.local will appear a text fragment similar to the following:
#!/bin/sh
#
# This script is executed *after* all and the other init scripts.
# 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
/etc/init.d/mysqld Start #mysql开机启动
/etc/init.d/nginx Start #nginx开机启动
/ETC/INIT.D/PHP-FPM Start #php-fpm boot
/etc/init.d/memcached Start #memcache开机启动
#在文件末尾 (before exit 0) plus the program you need to start or the command you want to run (the program you execute needs to write an absolute path, except for the system environment variable), such as:
/usr/local/thttpd/sbin/thttpd-c/usr/local/thttpd/etc/thttpd.conf
(2) Write a shell script yourself
Place the written script (. sh file) in the directory/etc/profile.d/, and the system will automatically execute all shell scripts in that directory after it is started.
(3) Set by Chkconfig command
Start file CP to/etc/init.d/or/etc/rc.d/init.d/(the former is the latter's soft connection)
Vim startup file, the file must be preceded by the following three lines of code, no side will prompt Chkconfig does not support
#!/bin/sh tells the system to use the shell, so the shell script is like this
#chkconfig: 35 20 80 represents the RunLevel, start priority, close priority, and the line code must
#description: HTTP server (self-play)//Two lines are commented out!!! , this line code must
Chkconfig--add The script file name operation has been added
Startup items under Linux