Mariadb configuration is not loaded from my.cnf
I am having the same problem in ~/.my.cnf file (MySQL 5.5.5-10.2.6-MariaDB installed via Homebrew). 

Apparently it is a recorded bug in both MySQL and MariaDB:

Bug #84172    The pid-file value is ignored in the /etc/my.cnf option file
https://bugs.mysql.com/bug.php?id=84172

pid_file in my.cnf ignored
https://jira.mariadb.org/browse/MDEV-8168