LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-18-2002, 07:51 PM   #1
morbo
Member
 
Registered: Dec 2001
Posts: 53

Rep: Reputation: 15
sendmail script nowhere.....


Im using Redhat 7,1, but can find nowehere to start, stop, or restart sendmail. I SHOULD have a script in /etc/init.d and it is not there. Can someone give me a copy of their sendmail script, or tell me an alternate script location to check?

thanks
 
Old 01-18-2002, 08:05 PM   #2
te_conway
Member
 
Registered: Apr 2001
Location: MA
Distribution: redhat 7.2
Posts: 182

Rep: Reputation: 30
#!/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/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
for i in virtusertable access domaintable mailertable ; do
if [ -f /etc/mail/$i ] ; then
makemap hash /etc/mail/$i < /etc/mail/$i
fi
done
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
 
Old 01-18-2002, 08:08 PM   #3
morbo
Member
 
Registered: Dec 2001
Posts: 53

Original Poster
Rep: Reputation: 15
Thanks for the script, but when i try to execute it I get:

/etc/xinetd.d/sendmail start
bash: /etc/xinetd.d/sendmail: Permission denied

Ideas?
 
Old 01-18-2002, 08:12 PM   #4
te_conway
Member
 
Registered: Apr 2001
Location: MA
Distribution: redhat 7.2
Posts: 182

Rep: Reputation: 30
Login as root and cd to /etc/rc,d/init.d


type these two commands

chown root:root sendmail

cmod 0755 sendmail

You must start sendmail as root.
 
Old 01-18-2002, 08:15 PM   #5
morbo
Member
 
Registered: Dec 2001
Posts: 53

Original Poster
Rep: Reputation: 15
a new one:
[root@Bugtel init.d]# /etc/rc.d/init.d/sendmail start
/etc/rc.d/init.d/sendmail: -q1h: command not found
 
Old 01-18-2002, 08:22 PM   #6
te_conway
Member
 
Registered: Apr 2001
Location: MA
Distribution: redhat 7.2
Posts: 182

Rep: Reputation: 30
Sorry, can't help you. Sounds like something isn't installed.

Is sendmail in /usr/sbin ?
 
Old 01-18-2002, 08:27 PM   #7
morbo
Member
 
Registered: Dec 2001
Posts: 53

Original Poster
Rep: Reputation: 15
yes it is
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a Perl script with SendMail NewByy Linux - Newbie 4 08-25-2005 01:02 PM
Running a Perl script with SendMail NewByy Programming 2 08-25-2005 09:56 AM
sendmail subject via script ryedunn Linux - Newbie 3 01-08-2005 12:11 PM
Help with PHP sendmail script! cucolin@ Programming 2 06-28-2004 03:43 PM
sending attachments from sendmail in a script pr0fess0r Linux - General 2 05-20-2003 05:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration