vi etc init.d mysql_vim /etc/init.d/mysqld

/etc/init.d 是一般开机的启动服务存放在这个目录下

/etc/rc.d启动的配置文件和脚本

/etc/init.d & /etc/rc.d/init.d是同一个目录,内容相同

实现机制,其实/etc/init.d是一个符号链接文件,链接指向/etc/rc.d/init.d

你运行以下命令可以看出来

[root@localhost ~]#ls -ld /etc/init.d

lrwxrwxrwx. 1 root root 11 Oct 2 12:15 /etc/init.d -> rc.d/init.d

建立方法是:ln -s /etc/rc.d/init.d /etc/init.d

[root@localhost ]# vim /etc/init.d/mysqld

1 #!/bin/sh

2 # Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB

3 # This file is public domain and comes with NO WARRANTY of any kind

4

5 # MySQL daemon start/stop script.

6

7 # Usually this is put in /etc/init.d (at least on machines SYSV R4 based

8 # systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql.

9 # When this is done the mysql server will be started when the machine

你可能感兴趣的:(vi,etc,init.d,mysql)