GET 24/7 LIVE HELP NOW

Announcement

Announcement Module
Collapse
No announcement yet.

Why does the PID file rely on the hostname?

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why does the PID file rely on the hostname?

    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

  • #2
    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/...ysqld_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.

    Comment


    • #3
      Hey,

      No I installed using the "official" percona YUM repository listed here
      http://www.percona.com/doc/percona-s.../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.

      Comment


      • #4
        Hi, can you provide exact Percona server version so we can check? Thanks.

        Comment

        Working...
        X