postfix configuration failures should not let 'stop' fail

Bug #534773 reported by Simon Huerlimann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
postfix (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

Binary package hint: postfix

Actual problem:

For some reason my /etc/mailname is empty. For another reason I'd like to install nullmailer instead of postfix. A simple 'sudo apt-get install nullmailer' should do the trick...

But:
eading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  postfix
The following NEW packages will be installed:
  nullmailer
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
Need to get 0B/109kB of archives.
After this operation, 3,064kB disk space will be freed.
Do you want to continue [Y/n]?
Preconfiguring packages ...
dpkg: postfix: dependency problems, but removing anyway as you requested:
 bsd-mailx depends on postfix | mail-transport-agent; however:
  Package postfix is to be removed.
  Package mail-transport-agent is not installed.
  Package postfix which provides mail-transport-agent is to be removed.
 bsd-mailx depends on postfix | mail-transport-agent; however:
  Package postfix is to be removed.
  Package mail-transport-agent is not installed.
  Package postfix which provides mail-transport-agent is to be removed.
(Reading database ... 16149 files and directories currently installed.)
Removing postfix ...
 * Stopping Postfix Mail Transport Agent postfix postfix: fatal: myorigin file /etc/mailname is empty
                                                                                                                                                                     [fail]
invoke-rc.d: initscript postfix, action "stop" failed.
dpkg: error processing postfix (--remove):
 subprocess installed pre-removal script returned error exit status 1
Errors were encountered while processing:
 postfix
E: Sub-process /usr/bin/dpkg returned an error code (1)

Manually stopping postfix using 'sudo /etc/init.d/postfix stop' gives the same '...mailname is empty' error.

The simplest and IMHO opinion cleanest way would be to enhance the postfix init script to use some force to stop postfix even when there's no working configuration. Other deamons like squid even kill the daemon process in their init scripts after some waiting...

Revision history for this message
Mathias Gug (mathiaz) wrote :

Could you try to put the hostname into /etc/mailname (ie make /etc/mailname not-empty)?

Changed in postfix (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Simon Huerlimann (huerlisi) wrote :

It works if /etc/mailname is non-empty, I know that.

The problem is: you can't simply uninstall postfix if you have a configuration problem like that. The pre-removal package script fails because the daemon can't be stopped and the init script gives an error. This is unfortunate as non-technical guys are left with a postfix which doesn't work but they can't to the 'apt-get remove (--purge) XX', 'apt-get install XX' or 'apt-get install YY' they've been told to try by some more geeky friend;-)

It might be nitpicking, but fixing should be more or less simple and make the Ubuntu experience just that little bit better.

I understand that stopping postfix in an 'orderly fashion' (from the manpage:-) is a priority, but stopping the deamon is triggered by some human action and meant to succeed. And there's the 'abort' action supported by the init script, too.

My take would be to kill the postfix process if 'quiet-stop' gives an error.

tags: added: kernel-series-unknown
tags: removed: kernel-series-unknown
Chuck Short (zulcss)
Changed in postfix (Ubuntu):
status: Incomplete → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.