Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 479524

Summary: mail-mta/sendmail - add systemd unit
Product: Gentoo Linux Reporter: CFuga <cfuga>
Component: [OLD] ServerAssignee: Gentoo systemd Team <systemd>
Status: RESOLVED FIXED    
Severity: normal CC: graham, net-mail+disabled
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 448882, 468898    
Attachments: sendmail service file
sm-client service file

Description CFuga 2013-08-02 15:19:48 UTC
Created attachment 354934 [details]
sendmail service file

The package should provide sendmail.service and sm-client.service files.
Comment 1 CFuga 2013-08-02 15:20:22 UTC
Created attachment 354936 [details]
sm-client service file
Comment 2 Graham Murray 2013-08-03 13:43:20 UTC
(In reply to CFuga from comment #1)
> Created attachment 354936 [details]
> sm-client service file

I found a problem using this. /usr/share/sendmail-cf/cf/submit.cf (which m4 incorporates into /etc/mail/submit.cf) defines the PIDfile for the sm-client to be /var/spool/clientmqueue/sm-client.pid. I had to replace the PIDFile line in sm-cient.service to use this otherwise systemd started the service but then (after a timeout) killed the sendmail queue handler because it could not read the defined pid file.
Comment 3 Tim Harder gentoo-dev 2013-08-05 19:23:53 UTC
@systemd herd: Feel free to check, test, and commit this when it's working properly.
Comment 4 Pacho Ramos gentoo-dev 2013-08-20 09:29:58 UTC
I will review, test and commit it in a week if nobody disagrees. Thanks
Comment 5 Pacho Ramos gentoo-dev 2013-08-30 19:48:59 UTC
Why is:

ExecStartPre=-/usr/bin/make -C /etc/mail

run? I don't see any equivalent in init.d file
Comment 6 Pacho Ramos gentoo-dev 2013-08-31 12:33:29 UTC
Looks like fedora is running a similar one for building mail aliases, no?
Comment 7 CFuga 2013-09-03 00:15:13 UTC
(In reply to Pacho Ramos from comment #6)
> Looks like fedora is running a similar one for building mail aliases, no?

The 'make' order is not for mail aliases. Sendmail uses Berkeley databases for tabular data, e.g. virtual users. But you don't update the database by hand: you should edit the corresponding flat file and run the 'makemap' order to make any modification.

Instead of running 'makemap' for each flat file/database pair, Fedora/Red Hat created a Makefile to maintain those files.

Since the sendmail ebuild doesn't install that Makefile, it's fine to delete that 'ExecStartPre' line from the sendmail service file.
Comment 8 Pacho Ramos gentoo-dev 2013-09-03 19:31:19 UTC
+*sendmail-8.14.7-r1 (03 Sep 2013)
+
+  03 Sep 2013; Pacho Ramos <pacho@gentoo.org> +files/sendmail.service,
+  +files/sm-client.service, +sendmail-8.14.7-r1.ebuild:
+  Add unit file (#479524 by CFuga and Graham Murray)
+

About making them run in foreground (instead of forking), I have considered it but looks to lead to problems with sm-client:
https://bugzilla.redhat.com/show_bug.cgi?id=719931