# [CLOSED] Postfix "fatal error" query

## trossachs

Have just reinstalled Postfix due to a mail server prob. Emerge it as usual, but now it won't start siting the following error:

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

Have checked the directory and yes, it is not there but I am not sure why. Have re-emerged but no joy. Why would PF fail to create this directory?Last edited by trossachs on Sat Jul 21, 2007 12:10 am; edited 1 time in total

----------

## Rob1n

Presumably it's done some checks on the install, found existing files and decided you were reinstalling/upgrading so there was no need to create directories (especially as you might have changed them from the defaults).  You could try unmerging it first to clear up the old files/directories.

----------

## trossachs

Have emerge -C postfix and emerge postfix some 3 times now. When I had probs earlier I removed the /var/spool/postfix directory in error and am wondering if this is the cause of the prob.

But then I would have thought that an emerge --sync then emerge postfix would have sorted the prob. Is there anyway to force creation of directories?Last edited by trossachs on Fri Jul 20, 2007 11:11 pm; edited 1 time in total

----------

## Rob1n

Not all of them, no - from the looks of things you can rerun the post-install script which will create the queue directories but not the daemon directory.  The only thing I can think of is to do the "emerge -C postfix" again, check what files/directories it's not removed (these'll be indicated in the list and will probably include /etc/postfix) and delete/rename/move these before installing postfix again.

----------

## Rob1n

Okay, to decode the info there:

 <<< => deleted

 >>> => installed

 --- => skipped, reasons being:

!mtime => different modification time (i.e. it's been edited since install)

!md5 => different md5 (again, edited since install)

!empty => the directory is not empty (either a shared directory or contains files left for the above reasons)

So, from the list there you can see that /etc/postfix and /var/spool/postfix are being left.  These should be moved/renamed before reinstalling if you want to be sure of getting a clean install.

----------

## trossachs

SORTED! Have downloaded the source files from postfix.org installed the package, then emerged PF which has now found the relevant files and directories needed. All ok!

----------

## trossachs

Just an update for you guys, had the same prob again today some 5 months after my last post. If after downloading a fresh copy from postfix.org the problem still occurs, look into directory 

```
/usr/lib
```

If you see a postfix directory (which you should), copy this directory into /usr/libexec and it should work.   :Very Happy: 

----------

## neofutur

I just had the same problem after upgrading postfix.

files are now in libexec, I hadto update my postfix main.cf , replacing :

daemon_directory = //usr/lib/postfix

with 

daemon_directory = /usr/libexec/postfix

and fixed !

----------

## cach0rr0

 *neofutur wrote:*   

> I just had the same problem after upgrading postfix.
> 
> files are now in libexec, I hadto update my postfix main.cf , replacing :
> 
> daemon_directory = //usr/lib/postfix
> ...

 

changed with postfix-2.9

```

ricker ~ # eselect news list

News items:

  [1]      2009-04-18  Generation 1 Java Setup Deprecated

  [2]      2009-07-02  kdeprefix and monolithic ebuilds issues

  [3]      2010-03-23  New desktop subprofiles for GNOME and KDE

  [4]      2010-03-25  Python 3.1

  [5]      2010-08-01  --as-needed enabled in default profiles

  [6]      2011-04-27  Upgrade to GLIB 2.28

  [7]      2011-05-22  Removal of kdeprefix support

  [8]      2011-08-28  Mesa r600 driver now defaults to gallium

  [9]      2011-10-15  Upgrade to libpng15

  [10]     2012-03-16  udev-181 unmasking

  [11]     2012-04-24  The default JPEG implementation

  [12]     2012-05-21  Portage config-protect-if-modified default

  [13]     2012-07-23  Upgrading to postfix-2.9

ricker ~ # eselect news read 13

2012-07-23-upgrading-postfix

  Title                     Upgrading to postfix-2.9

  Author                    Eray Aslan <eras@gentoo.org>

  Posted                    2012-07-23

  Revision                  1

Daemons for >=mail-mta/postfix-2.9 are installed under

/usr/libexec/postfix.  Please do not forget to adjust your main.cf by

running etc-update/dispatch-conf or similar and accepting the new

daemon_directory setting.  Otherwise, postfix will not be able to find

the binaries it is looking for.

```

----------

