When installing mysql-server on Debian Wheezy, the user "mysql" is created without a home directory. In my setup, directly after MySQL was installed, a new task is performed which relies on the mysql user having /var/lib/mysql as home directory.
At the moment, this task fails. I have to adjust the mysql user and re-run my task again. So what I am looking for is a builtin method in Debian which allows me to either "preseed" the home dir of the mysql user (which is created by one of the mysql packages) or creating a trigger which reacts on the event of the mysql-server package being installed (or the mysql user being created, I don't care).
I know that I could modify the mysql package or wrap mysql installation in some sort of script or puppet manifest; however, things like this are not suitable for my setup. I need a clean Debian method to do it.
Is there something existing which could be triggered on package installation or user creation? I thought about watching mysql files via inotify as a workaround; however, I think that inotify would be too much for my little problem here.
I am currently looking at dpkg-triggers, but I am not sure if this is the right solution..