5

I have another question about opensmtpd on Ubuntu 18.04...

apt-get install opensmtpd

... installs version 6.0.3p1-1build1, which has a problem:

The systemd opensmtpd.service seems to think that ExecStop=/usr/sbin/smtpctl stop will stop the service. However smtpctl stop yields a non-zero exit code and its output also hints at that it doesn't know about that subcommand:

possibilities are:
discover
encrypt
pause
resume
show
log
monitor
profile
remove
schedule
trace
uncorrupt
unprofile
untrace
update

I find that this problem has been recognized and fixed in versions 6.0.3p1-2

That was March 2018, well over a one and half year ago.

I see that newer versions do get installed for Ubuntu 18.10 and 19.04.... so how can it be that this- and newer releases since then, haven't made it into 18.04 yet?

How could this be made to happen?

3
  • 1
    Non-security updates are rarely backported to older releases of Ubuntu for several reasons (there are some exceptions). Generally, the accepted way to get newer software is to run a newer release of Ubuntu.
    – user535733
    Commented Aug 17, 2019 at 21:05
  • It would seem that something that is clearly a bug would warrant making an exception for, wouldn't it? Also, I'm surprised to learn that the latest LTS version would be considered old already.
    – cueedee
    Commented Aug 18, 2019 at 14:12
  • Depends entirely upon the severity of the bug and the popularity of the package. Do note that Ubuntu developers are working on their third release since 18.04, so it might not seem like an 'older' release to you, but others may see it differently.
    – user535733
    Commented Aug 18, 2019 at 15:55

2 Answers 2

5

Two options here:

  • You have to write comprehensive bug-report to launchpad with apport-bug opensmtpd to inform the developers about possible problem.

  • You have to install package from disco on bionic:

    cd ~/Downloads
    wget http://archive.ubuntu.com/ubuntu/pool/universe/o/opensmtpd/opensmtpd_6.0.3p1-5_amd64.deb
    sudo apt-get install ./opensmtpd_6.0.3p1-5_amd64.deb
    

    But this manually installed package will not receive security updates.


Update: I have reported bug 1840586 for you with backport / SRU (stable release upgrade) request.

4
  • Ad option-1) It does seem rather odd to have to bug-report for something that has already been recognised as such, -fixed, and released, but if that's what it takes to get it moving...
    – cueedee
    Commented Aug 18, 2019 at 14:35
  • I have reported bug for you.
    – N0rbert
    Commented Aug 18, 2019 at 14:48
  • Thank you so much for that! Awesome!
    – cueedee
    Commented Aug 18, 2019 at 14:49
  • 1
    While waiting for that to happen, I suppose as a third option I could investigate differences between the 6.0.3p1-1build1 and later versions, and locally craft a so-called "drop-in snippet" to override the opensmtpd.service unit's ExecStop definition;
    – cueedee
    Commented Aug 18, 2019 at 14:50
3

Meanwhile, I've investigated the differences between Bionic's and Disco's opensmtpd packages, and concluded that the default ExecStop behaviour of systemd is sufficient to make opensmtpd indeed, stop.

diff -p ./{bionic,disco}/lib/systemd/system/opensmtpd.service:

*** ./bionic/lib/systemd/system/opensmtpd.service 2018-01-16 17:18:40.000000000 +0000
--- ./disco/lib/systemd/system/opensmtpd.service  2018-03-18 16:16:45.000000000 +0000
*************** After=network.target
*** 6,12 ****
  [Service]
  Type=forking
  ExecStart=/usr/sbin/smtpd
! ExecStop=/usr/sbin/smtpctl stop

  [Install]
  WantedBy=multi-user.target
--- 6,12 ----
  [Service]
  Type=forking
  ExecStart=/usr/sbin/smtpd
! ExecStop=/bin/kill -15 $MAINPID

  [Install]
  WantedBy=multi-user.target

Afaict, disco's ExecStop=/bin/kill -15 $MAINPID line is simply the systemd default behaviour made explicit.

So. here's the temporary workaround I've settled upon for now while we wait & hope for @N0rbert's bugreport to be picked-up:

sudo apt-get install opensmtpd
sudo systemctl edit opensmtpd.service

... then copy/paste this into the editor:

[Service]

    ##  While waiting for [this bug](https://bugs.launchpad.net/ubuntu/+source/opensmtpd/+bug/1840586)
    ##  to be fixed, work around it as follows:
    ##
    ##  Clear `ExecStop` to get the [default systemd behaviour](https://www.freedesktop.org/software/systemd/man/systemd.service.html#ExecStop=)
    ##  back;
    ##
    ExecStop=

# vim: syntax=systemd expandtab shiftround shiftwidth=4 softtabstop=4 tabstop=4

...and finally, reload and restart:

sudo systemctl restart opensmtpd

Proving that it works:

journalctl -u opensmtpd
...
Aug 19 10:10:13 ip-10-0-2-210 systemd[1]: Stopping OpenSMTPD SMTP server...
Aug 19 10:10:13 ip-10-0-2-210 smtpd[2163]: Exiting
Aug 19 10:10:13 ip-10-0-2-210 systemd[1]: Stopped OpenSMTPD SMTP server.
Aug 19 10:10:13 ip-10-0-2-210 systemd[1]: Starting OpenSMTPD SMTP server...
Aug 19 10:10:13 ip-10-0-2-210 smtpd[5987]: info: OpenSMTPD 6.0.3-portable starting
Aug 19 10:10:13 ip-10-0-2-210 systemd[1]: Started OpenSMTPD SMTP server.

Hoping someone may find this useful.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .