Created attachment 354934 [details]
sendmail service file
The package should provide sendmail.service and sm-client.service files.
Created attachment 354936 [details]
sm-client service file
(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.
@systemd herd: Feel free to check, test, and commit this when it's working properly.
I will review, test and commit it in a week if nobody disagrees. Thanks
ExecStartPre=-/usr/bin/make -C /etc/mail
run? I don't see any equivalent in init.d file
Looks like fedora is running a similar one for building mail aliases, no?
(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.
+*sendmail-8.14.7-r1 (03 Sep 2013)
+ 03 Sep 2013; Pacho Ramos <email@example.com> +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: