Restarting:/etc/rc.sendmail: restart-mta: /var/run/sendmail.pid not found sendmail-c

Hi.

I'm here again but hopefully Unix gets easier.

I'm trying to reinstall/restart my MTA afresh; getting back to base settings really so I can at least try to send/accept mail from internal users/external hosts (i.e. Yahoo, Gmail etc) to my FreeBSD server.

# cd /etc/mail
# mv hostname.mc hostname.mc.bak
# make

Pause for a second; I am correct in thinking that *my* hostname.mc file is actually: my.fullyqualifieddomain.com.mc or the result of # hostname?

Advice: (Add only the bare minimum required to run to hostname.mc, like smart hosting. It may not need anything.)

Stood in /etc/mail.

# make all install restart
and
# service sendmail status
Code:
sendmail is not running.
sendmail_clientmqueue is running as pid 51326.
# make restart
Code:
Restarting:/etc/rc.sendmail: restart-mta: /var/run/sendmail.pid not found
 sendmail-clientmqueue.

OK, so where do I find/copy/generate/obtain a copy of /var/run/sendmail.pid?
 
After moving the existing hostname.mc, run make. It will show the name of the .mc file it creates.

/var/run/sendmail.pid is automatically created when sendmail is started.
 
wblock@ said:
After moving the existing hostname.mc, run make.

I'm a little behind here. I don't have/see a hostname.mc file?

pwd
/etc/mail

ls
Code:
Makefile			freebsd.submit.cf		submit.cf
README				freebsd.submit.mc		virtusertable
access				helpfile			virtusertable.db
access.db			local-host-names		virtusertable.sample
access.sample			mailer.conf			me.mydomain.org.cf
aliases				mailertable.sample		me.mydomain.org.mc
aliases.db			relay-domains			me.mydomain.org.mc.bak
freebsd.cf			sendmail.cf			me.mydomain.org.submit.cf
freebsd.mc			statistics			me.mydomain.org.submit.mc


Are we talking about me.mydomain.org.mc?
 
OK, I'm satisfied its me.mydomain.org.mc

Stood in /etc/mail I build my .mc file.

make
Code:
cp freebsd.mc me.mydomain.org.mc
/usr/bin/m4 -D_CF_DIR_=/usr/share/sendmail/cf/   /usr/share/sendmail/cf/m4/cf.m4 me.mydomain.org.mc > me.mydomain.org.cf

Try and start Sendmail:

make start
Code:
Starting: sendmail554 5.3.5 /etc/mail/sendmail.cf: line 279: Unknown address family inet6 in Family=option
 sendmail-clientmqueue.

I dont want to have to edit /etc/mail/sendmail.cf directly. Can you advise how to remove
Code:
line 279: Unknown address family inet6
this issue?
 
Edit me.mydomain.org.mc. Change

Code:
DAEMON_OPTIONS(`Name=IPv6, Family=inet6, Modifiers=O')

to

Code:
[color="Red"]dnl[/color] DAEMON_OPTIONS(`Name=IPv6, Family=inet6, Modifiers=O')

Rebuild, install, and restart:

# make all install restart
 
I've followed that to the letter. It still is being a b*&%$ though.

make all install restart
Code:
/usr/bin/m4 -D_CF_DIR_=/usr/share/sendmail/cf/   /usr/share/sendmail/cf/m4/cf.m4 my.domain.org.mc > my.domain.org.cf
install -m 444 my.domain.org.cf /etc/mail/sendmail.cf
install -m 444 my.domain.org.submit.cf /etc/mail/submit.cf
Restarting:/etc/rc.sendmail: restart-mta: /var/run/sendmail.pid not found
 sendmail-clientmqueue.

/var/run/sendmail.pid should be automatically created when sendmail is started?
 
Yes. The message will be seen if sendmail was not already running. Now that you have it built and installed, try restarting it again:
# make restart
 
wblock@ said:
Yes. The message will be seen if sendmail was not already running. Now that you have it built and installed, try restarting it again:
# make restart

pwd
Code:
/etc/mail
make restart
Code:
Restarting:/etc/rc.sendmail: restart-mta: /var/run/sendmail.pid not found
 sendmail-clientmqueue.

make restart
Code:
Restarting:/etc/rc.sendmail: restart-mta: /var/run/sendmail.pid not found
 sendmail-clientmqueue.

make restart
Code:
Restarting:/etc/rc.sendmail: restart-mta: /var/run/sendmail.pid not found
 sendmail-clientmqueue.
 
Actually you want to use just make start or service sendmail start if there's no process already running. make restart is a shortcut for make stop; make start and if there's no running process there won't be a pid file either.
 
Is it still not running? Wait... is Sendmail enabled in /etc/rc.conf?

Code:
sendmail_enable="YES"

What does /var/log/maillog show?
 
wblock@ said:
Is it still not running? Wait... is Sendmail enabled in /etc/rc.conf?

Code:
sendmail_enable="YES"

What does /var/log/maillog show?

service sendmail status
Code:
sendmail is not running.
sendmail_clientmqueue is running as pid 54990.

/etc/rc.conf
Code:
sendmail_enable="YES"

cat /var/log/maillog | less reveals a huge amount of messages of this nature:
Code:
Apr 30 00:04:22 web sm-msp-queue[55711]: r3TJCSRQ054573: to=root, delay=08:51:54, xdelay=00:00:00, mailer=relay, pri=16146366, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Apr 30 00:06:06 web sm-msp-queue[55716]: r3S7U6v1048411: to=1cookie, ctladdr=admin (1004/1004), delay=1+20:36:00, xdelay=00:00:00, mailer=relay, pri=74820038, relay=[127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Apr 30 00:31:34 web sm-msp-queue[55758]: r3S7IYfI048384: to=myaccount@yahoo.com, ctladdr=admin (1004/1004), delay=1+21:13:00, xdelay=00:00:00, mailer=relay, pri=75720070, relay=[127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Apr 30 01:31:34 web sm-msp-queue[55893]: r3SCRuwi050158: to=1cookie, delay=1+17:03:38, xdelay=00:00:00, mailer=relay, pri=69241431, relay=[127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]

It looks like the problem lies with
Code:
Connection refused by [127.0.0.1]
It's not a firewall issue as my VPS providers opened the ports that Sendmail is listening on.
 
kpa said:
Actually you want to use just make start or service sendmail start if there's no process already running. make restart is a shortcut for make stop; make start and if there's no running process there won't be a pid file either.

Hang on!

make start
Code:
Starting: sendmail sendmail-clientmqueue.
service sendmail status
Code:
sendmail is running as pid 55984.
sendmail_clientmqueue is running as pid 54990.

I *think* this means it's started successfully :)
 
kpa said:
Verify with sockstat(1) that sendmail(8) is indeed listening for connections on correct addresses.

# sockstat
Code:
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS 
smmsp    sendmail   55987 3  dgram  -> /var/run/log
root     sendmail   55984 3  tcp4   *:***                 *:*
root     sendmail   55984 4  dgram  -> /var/run/logpriv
root     sendmail   55984 5  tcp4   *:***                *:*
smmsp    sendmail   54990 3  dgram  -> /var/run/log
smmsp    sendmail   54492 3  dgram  -> /var/run/log
smmsp    sendmail   48495 3  dgram  -> /var/run/log
smmsp    sendmail   48465 3  dgram  -> /var/run/log
smmsp    sendmail   48460 3  dgram  -> /var/run/log

All would appear well. Thanks.
 
Back
Top