List:General Discussion« Previous MessageNext Message »
From:Reindl Harald Date:June 6 2013 1:55pm
Subject:Re: Stopping mysql does not always stop it?
View as plain text  
Am 06.06.2013 15:39, schrieb Manuel Arostegui:
> Once that problem has been found...you can use either /etc/init.d/mysql
> stop or mysqladmin. Both should work in the same way

> You should never use kill

and why? what do you think does any stop command?
hint: it sends a SIGTERM

what do you think what does systemd with the unit below?
hint: it sends a SIGTERM
hint: it does not need mysqld_safe at all

what do you think does "kill" without any additional param?
hint: it sends a SIGTERM
_______________________________________________

[root@rh:~]$ cat mysql_error.log

[root@rh:~]$ ps aux | grep /etc/my.cnf
mysql     2630  0.2  1.1 3020952 183900 ?      Ssl  10:28   0:54 /usr/libexec/mysqld
--defaults-file=/etc/my.cnf
--pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock
--open-files-limit=500000 --basedir=/usr
--user=mysql
root     31301  0.0  0.0 111356  1032 pts/4    S+   15:54   0:00 /usr/bin/grep --color
/etc/my.cnf

[root@rh:~]$ kill 2630

[root@rh:~]$ cat mysql_error.log
130606 15:54:40 [Note] /usr/libexec/mysqld: Normal shutdown
130606 15:54:40 [Note] Event Scheduler: Purging the queue. 0 events
130606 15:54:40  InnoDB: Starting shutdown...
130606 15:54:41  InnoDB: Shutdown completed; log sequence number 1707525256
130606 15:54:41 [Note] /usr/libexec/mysqld: Shutdown complete
_______________________________________________

cat /usr/lib/systemd/system/mysqld.service
[Unit]
Description=MySQL Database
Before=postfix.service dovecot.service dbmail-imapd.service dbmail-lmtpd.service
dbmail-pop3d.service

[Service]
Type=simple
PIDFile=/var/run/mysqld/mysqld.pid
ExecStart=/usr/libexec/mysqld --defaults-file=/etc/my.cnf
--pid-file=/var/run/mysqld/mysqld.pid
--socket=/var/lib/mysql/mysql.sock --open-files-limit=500000 --basedir=/usr --user=mysql
ExecStartPost=/usr/libexec/mysqld-wait-ready $MAINPID
Restart=always
RestartSec=1
TimeoutSec=300
LimitNOFILE=500000
LimitMEMLOCK=infinity
OOMScoreAdjust=-1000
SysVStartPriority=64
PrivateTmp=true
CapabilityBoundingSet=~CAP_SYS_PTRACE
InaccessibleDirectories=/boot
InaccessibleDirectories=/home
InaccessibleDirectories=/root



[Install]

WantedBy=multi-user.target
_______________________________________________


Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Thread
Stopping mysql does not always stop it?Mike Franon6 Jun
  • Re: Stopping mysql does not always stop it?Manuel Arostegui6 Jun
    • Re: Stopping mysql does not always stop it?Reindl Harald6 Jun
      • Re: Stopping mysql does not always stop it?Manuel Arostegui6 Jun
  • Re: Stopping mysql does not always stop it?hsv6 Jun
    • Re: Stopping mysql does not always stop it?Reindl Harald6 Jun