# Percona Server shutdown PID file not deleting

**URL:** <https://forums.percona.com/t/percona-server-shutdown-pid-file-not-deleting/2014>\
**Category:** Other MySQL® Questions\
**Created:** [March 14, 2013, 12:08pm UTC](https://forums.percona.com/t/percona-server-shutdown-pid-file-not-deleting/2014 "2013-03-14T12:08:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlee](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dlee/32/919_2.png) [@dlee](https://forums.percona.com/u/dlee)\
**Post date:** [March 14, 2013, 12:08pm UTC](https://forums.percona.com/t/percona-server-shutdown-pid-file-not-deleting/2014/1 "2013-03-14T12:08:39Z")

</div>

Hi there,

I have two separate servers.

Server 1:  
Ubuntu 12.04.2 LTS  
Percona Server 5.5 Release 29.4

Server 2:  
Ubuntu 12.04.2 LTS  
Percona Server 5.5 Release 30.1

Both installed Percona via the apt repo instructions here:

[percona.com/doc/percona-server/5.5/installation/apt\_repo.htm](http://percona.com/doc/percona-server/5.5/installation/apt_repo.htm) l

Server 1 and 2 has their pid\_file set to /var/run/mysqld/mysqld.pid to reflect what vanilla mysql does.

If I issue a sudo service mysql stop on Server 1, the server shuts down cleanly with no problem. If I do the same on Server 2, mysql will shutdown but it seems that the pid file is not being deleted on shutdown, so mysqld\_safe will restart the server again rather than ending the script. On Server 2, I either have to manually delete the pid file and then issue the shutdown or kill the process that’s running mysqld\_safe and then try shutting down mysql.

To fix this, I just leave out the pid\_file setting in /etc/mysql/my.cnf, which defaults to /var/lib/mysql/thehostname.pid. That works perfectly fine and shutdown works correctly.

Permissions look the same on both Server 1 and 2 for all mysql-related directories and their parent directories. This suggests to me that there’s been a change between R29.4 and 30.1 where whatever shuts down mysql (the mysqladmin binary?) isn’t respecting the pid\_file setting in my.cnf upon shutdown/deletion of the pid file.

I’m not sure if this is an issue that’s coming from vanilla mysql or percona server. Any ideas?

---

<div class="post-metadata">

**Author:** ![gmouse](https://avatars.discourse-cdn.com/v4/letter/g/b9e5f3/32.png) [@gmouse](https://forums.percona.com/u/gmouse)\
**Post date:** [March 15, 2013, 6:05am UTC](https://forums.percona.com/t/percona-server-shutdown-pid-file-not-deleting/2014/2 "2013-03-15T06:05:43Z")

</div>

Have you checked whether selinux imposes some restrictions on server 2?

---

<div class="post-metadata">

**Author:** ![dlee](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/dlee/32/919_2.png) [@dlee](https://forums.percona.com/u/dlee)\
**Post date:** [March 15, 2013, 1:29pm UTC](https://forums.percona.com/t/percona-server-shutdown-pid-file-not-deleting/2014/3 "2013-03-15T13:29:08Z")

</div>

What I haven’t tried was installing Percona Server on a VM to test whether Mysql won’t shutdown properly on the VM as well. I just tried it and it works fine, so it looks like there’s nothing wrong with Percona/Mysql and that something’s just borked on my server (server 2.)

SELinux isn’t installed on the server, but at this point, I’ve made do with leaving the pid\_file location as the default, which works, and I think I’ll just leave it at that.
