我试图终止一个进程,但每次我这样做时它都会不断回来。该过程如下所示:
我查看了Mysql上的进程列表,什么也没有。
/usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/server.weloveyou.err --pid-file=/var/lib/mysql/server.weloveyou.com.pid
我查看了日志,发现这种情况一直发生:
130726 13:32:03 [Note] /usr/sbin/mysqld: Normal shutdown
130726 13:32:03 [Note] Event Scheduler: Purging the queue. 0 events
130726 13:32:03 InnoDB: Starting shutdown...
130726 13:32:05 InnoDB: Shutdown completed; log sequence number 0 2115443139
130726 13:32:05 [Note] /usr/sbin/mysqld: Shutdown complete
130726 13:32:05 mysqld_safe mysqld from pid file /var/lib/mysql/server.weloveyou.pid ended
130726 13:32:05 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130726 13:32:05 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
130726 13:32:05 [Note] Plugin 'FEDERATED' is disabled.
130726 13:32:05 InnoDB: Initializing buffer pool, size = 8.0M
130726 13:32:05 InnoDB: Completed initialization of buffer pool
130726 13:32:06 InnoDB: Started; log sequence number 0 2115443139
130726 13:32:06 [Note] Event Scheduler: Loaded 0 events
130726 13:32:06 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.70-cll' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
130726 13:32:15 mysqld_safe Number of processes running now: 0
130726 13:32:15 mysqld_safe mysqld restarted
130726 13:32:15 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
130726 13:32:15 [Note] Plugin 'FEDERATED' is disabled.
130726 13:32:15 InnoDB: Initializing buffer pool, size = 8.0M
130726 13:32:15 InnoDB: Completed initialization of buffer pool
130726 13:32:15 InnoDB: Started; log sequence number 0 2115443139
130726 13:32:15 [Note] Event Scheduler: Loaded 0 events
130726 13:32:15 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.70-cll' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
有人有什么想法吗?
干杯
约翰
答案1
mysql 服务器运行 2 个进程,mysqld 和 mysqld_safe。如果您使用 SIGKILL 信号 (9) 终止 mysqld,mysqld_safe 将重新生成 mysqld。如果您以标准方式停止 mysqld,或使用 sigint(15) 信号终止它,mysqld_safe 会注意到它并结束。如果出现紧急情况,请记住始终先终止 -9 mysqld_safe。
在这种情况下,mysqld_safe 似乎在关闭后立即重新启动。您究竟是如何杀死 mysql 的?