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



## Blodia (Dec 28, 2009)

Hi everybody,

here is my problem when I run _postfix check_:


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

From where can it come?

Thank you for the answers you can give me.

Blodia


----------



## crsd (Dec 28, 2009)

Well, postfix is installed in /usr/local, by default. If you are transferring your config files from some kind of linux distro, check your paths.


----------



## Blodia (Dec 28, 2009)

can you tell me they are checking the file?

Thank you


----------



## SirDice (Dec 28, 2009)

How did you install postfix?


----------



## Blodia (Dec 28, 2009)

```
cd /usr/ports/mail/postfix
make install clean
```

and that's all.


----------



## ohauer (Dec 29, 2009)

Ups,

it seems your main.cf has a wrong parameter of daemon_directory or is missing.
(ether in file /usr/local/libexec/postfix/main.cf or /usr/local/etc/postfix/main.cf)

what is the output of

```
postconf -n daemon_directory
postconf -d daemon_directory
```

if the output from

```
postconf -n config_directory
postconf -d config_directory
```

try the following command and then try to restart postfix

```
postconf -e "daemon_directory=/usr/local/libexec/postfix"
```


----------



## Blodia (Jan 4, 2010)

Hi,

when i do:


```
postconf -n config_directory -> output -> config_directory = /usr/local/etc/postfix

postconf -d config_directory -> outpout -> config_directory = /usr/local/etc/postfix
```

i restart and i do a postfix check:


```
/usr/local/libexec/postfix/postfix-script: /usr/sbin/postconf: not found
/usr/local/libexec/postfix/postfix-script: /usr/sbin/postlog: not found
```

You have an idea?

Thanks a lot.


----------



## ohauer (Jan 4, 2010)

The parameter *command_directory* is missing or pointing to a wrong directory.

If you have postfix-2.5.x installed make sure the following line exist in 
/usr/local/etc/postfix/main.cf
/usr/local/libexec/postfix/main.cf

```
config_directory = /usr/local/etc/postfix
daemon_directory = /usr/local/libexec/postfix
mailq_path = /usr/local/bin/mailq
newaliases_path = /usr/local/bin/newaliases
sample_directory = /usr/local/etc/postfix
sendmail_path = /usr/local/sbin/sendmail
```

how did you install postfix? (ports, package, source)
this will help to find why you have wrong/missing parameters


----------



## Blodia (Jan 11, 2010)

I install postfix with ports, like this:


```
cd /usr/ports/mail/postfix
make install clean
```

And that's all.

Now when i do a 'postfix check', i recieve this message:


```
/usr/local/libexec/postfix/postfix-script: /usr/sbin/postconf: not found
/usr/local/libexec/postfix/postfix-script: /usr/sbin/postlog: not found
```

You have an idea? Thanks for the help.


----------



## DutchDaemon (Jan 11, 2010)

Did you perform the steps in ohauer's post (before yours)?


----------



## Blodia (Jan 11, 2010)

Hello.

Yes. He seems to have followed the steps.


----------



## DutchDaemon (Jan 11, 2010)

What is the output of [cmd=]grep command_directory /usr/local/etc/postfix/main.cf[/cmd]? You should *not* have /usr/sbin there (and I'm assuming it should be /usr/local/sbin -- what is the output of [cmd=]which postconf[/cmd]? -> use that path).

If you copied your Postfix configuration from a Linux installation: better don't do that. Start with the port's default config files and adjust those to your situation.


----------



## Blodia (Jan 12, 2010)

Hi,

1. "What is the output of  grep command_directory /usr/local/etc/postfix/main.cf?" -> Nothing

2. "what is the output of  which postconf?" -> /usr/local/sbin/postconf

Thanks

3. "If you copied your Postfix configuration from a Linux installation: better don't do that. Start with the port's default config files and adjust those to your situation." -> I do the install with ports in a new installation FreeBSD.


----------



## crsd (Jan 12, 2010)

`# ls -l /usr/local/etc/postfix/main.cf*`


----------



## Blodia (Jan 12, 2010)

```
# ls -l /usr/local/etc/postfix/main.cf*  ->

-rw-r--r--  1 root  wheel   4369 Jan 11 17:00 /usr/local/etc/postfix/main.cf
-rw-r--r--  1 root  wheel  26026 Dec 18 16:30 /usr/local/etc/postfix/main.cf.0
-rw-r--r--  1 root  wheel   4285 Dec 22 17:45 /usr/local/etc/postfix/main.cf.20091222
-rw-r--r--  1 root  wheel  23285 Dec 18 16:58 /usr/local/etc/postfix/main.cf.default
```


----------



## DutchDaemon (Jan 12, 2010)

[cmd=]grep command_directory /usr/local/etc/postfix/main.cf.default[/cmd] ?


----------



## Blodia (Jan 12, 2010)

grep command_directory /usr/local/etc/postfix/main.cf.default -> command_directory = /usr/sbin


----------



## DutchDaemon (Jan 12, 2010)

```
vi /usr/local/etc/postfix/main.cf
(add line) command_directory = /usr/local/sbin
(save)
(restart postfix)
(retry commands)
```


----------



## Blodia (Jan 12, 2010)

I think he misses the sign '=' in your order.

I made the command 'postfix reload' and here's what he gets out of control:

 -> postfix / postfix-script: refreshing the Postfix mail system

And if I do the command 'postfix check', nothing appears in the output.

Thank you for your help.


----------



## Blodia (Jan 12, 2010)

You think it's OK?
I await your confirmation to see if I can go forward.


----------



## DutchDaemon (Jan 12, 2010)

If there are no complaints, it should be ok.


----------



## Blodia (Jan 12, 2010)

Ok. Thanks a lot for all!

This post is SOLVED


----------

