Public bug reported:

It seems that when issuing 'systemctl restart milter-greylist.service',
it tries to start the new instance before the old one is completely
gone.

Jan 21 06:13:48 Ubuntu milter-greylist[30663]: Stopping Greylist Mail Filter 
Daemon: greylist.
Jan 21 06:13:48 Ubuntu milter-greylist[30672]: Starting Greylist Mail Filter 
Daemon: process already running.
Jan 21 06:13:48 Ubuntu milter-greylist[30672]: greylist.
Jan 21 06:13:48 Ubuntu milter-greylist[1196]: greylist: mi_stop=1
Jan 21 06:13:48 Ubuntu milter-greylist[1196]: smfi_main() returned 0
Jan 21 06:13:48 Ubuntu milter-greylist[1196]: Final database dump: no change to 
dump

This is probably caused by the incorrect unit file generated by systemd:
$ systemctl cat milter-greylist.service
# /run/systemd/generator.late/milter-greylist.service
# Automatically generated by systemd-sysv-generator

[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/milter-greylist
Description=LSB: Script to start/stop the greylist-milter
Before=multi-user.target
Before=multi-user.target
Before=multi-user.target
Before=graphical.target
After=nss-lookup.target
After=remote-fs.target
After=sendmail.service

[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
SuccessExitStatus=5 6
ExecStart=/etc/init.d/milter-greylist start
ExecStop=/etc/init.d/milter-greylist stop
ExecReload=/etc/init.d/milter-greylist reload

When restarting mitler-greylist, systemd executes '/etc/init.d/milter-
greylist start' and '/etc/init.d/milter-greylist stop', however
'/etc/init.d/milter-greylist restart' actually has got an additional '--
retry 5' passed to 'start-stop-daemon --stop' so that start-stop-daemon
can make sure that the process does finish.

An easy fix is to add --retry to '/etc/init.d/milter-greylist stop' as
well. I've tested it and attached the patch here. But it'd be probably
better to ship a proper systemd unit file.

** Affects: milter-greylist (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "milter-greylist.diff"
   
https://bugs.launchpad.net/bugs/1860407/+attachment/5321867/+files/milter-greylist.diff

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1860407

Title:
  milter-greylist fails to restart after issuing 'systemctl restart
  milter-greylist.service'

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/milter-greylist/+bug/1860407/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to