Not the answer you need?
Register and ask your own question!

Why does the PID file rely on the hostname?

trevorotrevoro EntrantCurrent User Role Beginner
Hey Everyone,

I was doing some troubleshooting on the init script for the official Percona RPMS and I was wondering about a quirk.
The PID file passed to mysql is generated based on the hostname value of the server. That means if the server name is changed while the mysql process is running, a "service mysql restart" or "service mysql stop" would fail, as it won't find the PID file.

I cant think of a good reason why the PID file for a process should be based on an arbitrary value like a hostname.

Is there any reason this was done explicitly?

Thanks!

-Trevor

Comments

  • niljoshiniljoshi MySQL Sage Inactive User Role Beginner
    Hi,

    Have you installed MySQL by compiling binaries? In this case, it might be possible that default PID file will be like hostname.PID which can cause this issue. You can avoid it by starting mysql with specific pid-file option (http://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_pid-file) Or can start mysql with --no-defaults option.

    You can also mention PID file path in my.cnf which can override the default settings.
  • trevorotrevoro Entrant Current User Role Beginner
    Hey,

    No I installed using the "official" percona YUM repository listed here
    http://www.percona.com/doc/percona-server/5.5/installation/yum_repo.html

    These RPM packages do not respect the pid-file-path setting in my.cnf. You cannot even over-ride the setting with an /etc/defaults/mysql file or pass extra arguments to the init process because the init script doesn't source anything.
  • niljoshiniljoshi MySQL Sage Inactive User Role Beginner
    Hi, can you provide exact Percona server version so we can check? Thanks.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.