Hi.
On Tue, Feb 03, 2015 at 02:03:25PM +0000, Michael Grant wrote:
> I'm still searching for an answer to this.
>
> After upgrade from wheezy to testing, sendmail no longer starts.
>
> I see that the system is using systemd. I see that the /etc/init.d/sendmail script now runs /bin/systemctl start sendmail.service. But sendmail isn't
> started. Even running '/bin/systemctl start sendmail.service' manually, nothing happens.
A nessesary correction - /etc/init.d/sendmail *tries* to run
'/bin/systemctl start sendmail.service'.
But, since no sendmail* package provide systemd's service file -
nothing happens.
Such behaviour cannot be considered systemd's bug IMO - systemd simply
does what it's intended to do in this case.
But, at the same time, such behaviour can be considered as a sendmail
bug (given that systemd is Jessie's default init, and sendmail is not
starting with this init).
Still, there's a way to workaround this.
Try adding
export _SYSTEMCTL_SKIP_REDIRECT="true"
to /etc/init.d/sendmail
On Tue, Feb 03, 2015 at 05:31:26PM +0000, Michael Grant wrote:
> On Tue, Feb 3, 2015 at 4:04 PM, Reco <recov...@gmail.com> wrote:
...
>
> Try adding
>
> export _SYSTEMCTL_SKIP_REDIRECT="true"
>
> to /etc/init.d/sendmail
>
> Thanks, this is progress, I can now start sendmail by hand by running '/etc/init.d/sendmail start', but it's not starting automatically at boot time.
An expected result, sadly (see below).
> I don't know if this has anything to do with that:
>
> # systemctl enable sendmail
> Synchronizing state for sendmail.service with sysvinit using update-rc.d...
> Executing /usr/sbin/update-rc.d sendmail defaults
> Executing /usr/sbin/update-rc.d sendmail enable
>
> # systemctl is-enabled sendmail
> Failed to get unit file state for sendmail.service: No such file or directory
No, it doesn't have anything with it.
Systemd uses it's own way to define a service called a 'service unit'.
Presumably, systemd has something for the compatibility with old init
(aka sysvinit), which *should* start those /etc/init.d/ scripts just as
good as if sysvinit itself would do it. Well, now we see how well it
works in the reality :)
Ok, let's try something different then - based on [1]. Try creating the
file called /etc/systemd/system/sendmail.service with the following
contents:
###cut###
[Unit]
Description=Sendmail Mail Transport Agent
After=syslog.target network.target
Conflicts=postfix.service exim.service
[Service]
Type=forking
PIDFile=/run/sendmail.pid
Environment=SENDMAIL_OPTS=-q1h
EnvironmentFile=-/etc/default/sendmail
ExecStartPre=-/etc/mail/make
ExecStartPre=-/etc/mail/make aliases
ExecStart=/usr/sbin/sendmail -bd $SENDMAIL_OPTS $SENDMAIL_OPTARG
[Install]
WantedBy=multi-user.target
###cut###
Revert the _SYSTEMCTL_SKIP_REDIRECT change, see how it goes now.
This unit file may require tweaking in $SENDMAIL_OPTS $SENDMAIL_OPTARG
part - I'm unable to check now what kind of variables are sourced by
/etc/default/sendmail.
> Incidentally, the sendmail package even in experimental is significantly out of date. The package appears orphaned. Several people seem to have tried to step
> up to do something about this but nothing has happened. Is sendmail dead on Debian?
Unknown to me. Truth to be told, personally I try to avoid using
sendmail whenever possible. Sendmail.cf's syntax is way too arcane to me.
Still, I can't stand a broken Debian package more than a certain MTA :)
Could you try restarting sendmail (systemctl restart sendmail) and show
the output of `systemctl status sendmail'? It also shows the most recent
log entries, but the output of journalctl --unit sendmail --since -5min
might also be useful (if it shows more messages).
I tried installing sendmail on a minimal test installation and systemd
started at least one daemon ("sendmail: MTA: accepting connections"),
so at least something gets started (though it complained about the test
installation not having a FQDN so other parts might be broken and not
have started).
Michael Grant wrote:
> I'm still searching for an answer to this.
> After upgrade from wheezy to testing, sendmail no longer starts.
> I see that the system is using systemd.
> ...
Some comments that I think are relevant...
Since it took a while for someone to respond to your question it tells
me that it is a combination of tools that not many people are using.
You are using sendmail in combination with systemd. That is an
unusual combination. If it were widely used then many people would
have been responding already. Frankly you might be one of the few
trailblazing that combination.
Trailblazers are great! They are the ones who make things happen.
However not everyone wants to be a trailblazer. There just isn't
enough time for everyone to do everything. You sound like a busy
person without the time to debug everything. Perhaps it would be good
to change to a more mainstream combination? If it were a mainstream
combination then the problem would almost certainly already have been
seen and fixed. Something with a lot of users and a lot of support.
In this case I would suggest that Sendmail is no longer the mainstream
mail transfer agent. Instead I suggest migrating to Postfix. (Or
Exim but I personally really prefer Postfix so will recommend
Postfix.) Postfix is well tested and very well supported. There has
been discussion of making Postfix the default mta on Debian. (But
that will never happen because Exim isn't bad just not as popular.)
Since you are using Sendmail I assume you have been using Sendmail
forever. You probably have multiple editions of the O'Reilly Sendmail
book on your bookshelf. You probably hate to take the time to migrate
a working configuration tuned over decades to something different. I
have been there and glance over at my two remaining editions of the
O'Reilly Sendmail books on my bookshelf. Let me say that moving to
Postfix was very easy. I don't even have one copy of the O'Reilly
Postfix book. It has an easy to understand design and the online
documentation is excellent. I have been where you are with Sendmail
and migrating to Postfix was a good decision for me. I suggest that
it would be for you too. YMMV.