FS#32585 - [dbmail] systemd units can't create pid file because directory is missing

Attached to Project: Community Packages
Opened by Paul N. Maxwell (Maxwel) - Saturday, 10 November 2012, 22:06 GMT
Last edited by Sergej Pupykin (sergej) - Sunday, 11 November 2012, 19:19 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
This task is continuation of task #32551. dbmail still cannot create PID files beacause /var/run/dbmail is missing after system start.

Additional info:
* package version: 3.0.2-6

My way to fix this:
1. Place attached file into /usr/lib/systemd/scripts with name 'dbmail' and 755 permissions
2. In [Service] section of each .service file add this line.
ExecStartPre=/usr/lib/systemd/scripts/dbmail

Explaination:
Before start daemon systemd will launch script which creates /var/run/dbmail and change it's ownership according to settings in /etc/dbmail.conf (EFFECTIVE_USER and EFFECTIVE_GROUP values).

Thanks for the attentions))
   dbmail (0.3 KiB)
This task depends upon

Closed by  Sergej Pupykin (sergej)
Sunday, 11 November 2012, 19:19 GMT
Reason for closing:  Fixed
Additional comments about closing:  tmpfiles.d added
Comment by Paul N. Maxwell (Maxwel) - Sunday, 11 November 2012, 10:47 GMT
The other way to fix this problem is creating a file /usr/lib/tmpfiles.d/dbmail.conf with this content:
#=========================================
d /run/dbmail 0755 nobody nobody -
#=========================================

but with this method we can automatically update user and group when user changes it in /etc/dbmail.conf

Loading...