Problem with Postfix - /usr/libexec/postfix on Ubuntu

**OS type and version:**Ubuntu 20.04
**Webmin version:**1.981
**Virtualmin version:**6.17-3
Related products version:

I have installed my Ubuntu 20.04 after a migration from CentOS 6 (I don’t know if it is useful to say that) and everything runs fine except Postfix which doesn’t start.

It says : postfix: fatal: chdir(/usr/libexec/postfix): No such file or directory

What can I do to make it work ? reinstall it ? change something ?

Where are you seeing that error?

/usr/libexec/postfix is a CentOS path. I’m not sure how that’d show up on Ubuntu.

Hello Joe,
I have migrated from CentOS 6 to Ubuntu 20 and migrated configuration, maybe that’s the reason.
When I re-check configuration of the server it says Postfix is not installed and gives me a link there :


Error while checking current Postfix configuration. Please manually fix Postfix configuration.
postfix: fatal: chdir(/usr/libexec/postfix): No such file or directory

Should I try reinstalling the postfix module or is there somewhere something that could have stayed after CentOS 6 migration to change ?


Reinstalling the Postfix module can’t do anything good. You do need to fix your configuration as the error says, but presumably you’re also trying to keep your changes, since you went to the trouble to migrate the Webmin configuration from the other system. So…you’ve got to do some work.

Though I can’t figure out how you have the configuration you have. I don’t see any mention of that path in my Webmin Postfix module config.

Are you sure it’s coming from the Webmin module configuration and not the Postfix configuration? Did you copy the Postfix configuration over too? (You’re really making this hard on yourself. You really can’t do that sort of thing between very different Linux distributions. You have to manually bring across just your changes.)

You need to figure out where this bogus config is coming from. I can’t see it mentioned in my Webmin config on CentOS boxes, so I assume it’s not in yours, either. Must be in /etc/postfix/ somewhere, so grep for it:

grep -R libexec /etc/postfix/

If you blindly copied over every config file from your CentOS box to the new Ubuntu box, you’re going to be finding little gotchas like this all over the place.

No i haven’t done anything manually during the migration.
I have made a backup just like explained in Virtualmin Migration webpage, then installed Virtualmin on the new server and restored the settings on the new server. Everything was fine except postfix that never started.
Now I’m making backups and restores of all my virtualmin domains and It’s almost finished.
I have not changed anything in postfix configuration or modules configuration. I don’t know how that works :frowning:

Your grep returns :
/etc/postfix/ = /usr/libexec/postfix

should I change it ? I swear i did not change it manually on the new server :slight_smile:

I guess there’s a “backup /etc” or “backup configuration files” and restore step in that doc…which should be more clear that it should be done with extreme care when moving to a whole other distro. It’s not a “just copy some files” situation when you’re changing your OS.

And, yes, you need to change it. It’s probably /usr/share/postfix on Ubuntu, but I don’t have one in front of me to check.

You might check all of /etc/ for references to libexec, because anywhere it appears is wrong. That’s where CentOS puts things. On Ubuntu it’s usually /usr/share, but I think some things that are in /usr/libexec can also be in /usr/lib or /var/lib on Ubuntu. I’m having vague recollections here…it’s late and I’m exhausted. But, /usr/libexec is definitely wrong.

There are no other references to libexec.
I have changed the daemon directory to /usr/lib
but when i restart postfix I have another message :
postfix: fatal: /usr/lib/postfix/postfix-script: No such file or directory

This script is in

I have that in the
command_directory = /usr/sbin

is it this line to change ?
thanks again

Oh I have just managed to fix it by changing the daemons folder :

sudo vi /etc/postfix/
and changed
#daemon_directory = /usr/libexec/postfix
daemon_directory = /usr/lib/postfix/sbin

And it works fine :slight_smile:
Thanks for you help

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.