LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   sendmail (https://www.linuxquestions.org/questions/linux-software-2/sendmail-15431/)

islandkid 03-02-2002 05:20 PM

sendmail
 
I followed all the proper steps to install sendmail. I have a sendmail binary in /usr/sbin and my config file is in /ect/mail , but sendmail still won't run. I setup a user and group smmsp and set all the permissions properly. My system gives me this warning when I shutdown: WARNING: Mail Transfer Agent sendmail not installed. What is going on?? How do I start sendmail?

DavidPhillips 03-02-2002 07:12 PM

It is started in the init scripts, what distro are you using?

islandkid 03-03-2002 04:41 AM

that's what I figured
 
Ya, that's what I figured, but there was no init script created for it on installation. How would I go about creating one? My distro is Caldera OpenLinux 2.4 I figured that there should be an init script in init.d on my system it is /etc/rc.d/init.d but nothing is there for it. I figured that maybe it was becuase the installation script couldn't find the init.d directory so I made a symlink /etc/init.d to my init.d directory and reinstalled, but it still didn't create any script for it.

DavidPhillips 03-03-2002 04:59 PM

contents of /etc/rc.d/init.d/sendmail

#!/bin/bash
#
# sendmail This shell script takes care of starting and stopping
# sendmail.
#
# chkconfig: 2345 80 30
# description: Sendmail is a Mail Transport Agent, which is the program \
# that moves mail from one machine to another.
# processname: sendmail
# config: /etc/sendmail.cf
# pidfile: /var/run/sendmail.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Source sendmail configureation.
if [ -f /etc/sysconfig/sendmail ] ; then
. /etc/sysconfig/sendmail
else
DAEMON=no
QUEUE=1h
fi

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/sbin/sendmail ] || exit 0

RETVAL=0



prog="sendmail"

start() {
# Start daemons.

echo -n $"Starting $prog: "
/usr/bin/newaliases > /dev/null 2>&1
if test -x /usr/bin/make -a -f /etc/mail/Makefile ; then
make -C /etc/mail -q
else
for i in virtusertable access domaintable mailertable ; do
if [ -f /etc/mail/$i ] ; then
makemap hash /etc/mail/$i < /etc/mail/$i
fi
done
fi
daemon /usr/sbin/sendmail $([ "$DAEMON" = yes ] && echo -bd) \
$([ -n "$QUEUE" ] && echo -q$QUEUE)
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/sendmail
return $RETVAL
}

stop() {
# Stop daemons.
echo -n $"Shutting down $prog: "
killproc sendmail
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sendmail
return $RETVAL
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
RETVAL=$?
;;
condrestart)
if [ -f /var/lock/subsys/sendmail ]; then
stop
start
RETVAL=$?
fi
;;
status)
status sendmail
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac

exit $RETVAL
--------------------------------------------------------------------------

contents of /etc/sysconfig/sendmail

DAEMON=yes
QUEUE=1h


--------------------------------------------------------------------------

you will need to link to the init.d/sendmail in your /rc2.d /rc3.d /rc4.d and rc5.d folders using a link named S80sendmail.

And a link to init.d/sendmail in your /rc1.d and rc6.d folders using a link named K30sendmail


these links will start sendmail in levels 2,3,4 and 5 and kill it in levels 1 and 6




these scripts are for redhat 7.2 so yours may need to be somewhat different paths or filenames.

islandkid 03-03-2002 06:19 PM

great thanks, but this mail script won't run for some reason. When I list it, it shows up black while the rest of the scripts in /etc/rc.d/init.d show up green and when I try to run it, it just gives me a 'bash: ./sendmail: Permission denied'

DavidPhillips 03-03-2002 07:20 PM

it needs to be chmoded
mine is like this

ls -l /etc/rc.d/init.d/sendmail
-rwxr-xr-x 1 root root 1830 Aug 31 2001 /etc/rc.d/init.d/sendmail

chmod 755 filename

islandkid 03-03-2002 08:55 PM

it's working now thanks!

islandkid 03-03-2002 08:55 PM

it's working now. thanks!

DavidPhillips 03-03-2002 09:21 PM

your welcome:D :Pengy:


All times are GMT -5. The time now is 10:33 AM.