Re: newbie, issue with qmail


Subject: Re: newbie, issue with qmail
From: Patrick Callahan (pac1@tiac.net)
Date: Tue Feb 01 2000 - 04:58:59 MST


Ivailo Djilianov wrote:

> Hi all,
> hope someone can help me with this one...
> I installed qmail on my YDL CS 1.1 BWG3/300, following the instructions in
> Life With qmail. Yet when I try to start /etc/rc.d/init.d/qmail start, an
> error comes up:
>
> [root@mymachine ivo]# /etc/rc.d/init.d/qmail start
> Starting qmail: svscan.
> [root@mymachine ivo]# env: svscan: No such file or directory
>
> it seems the startup script can't find svscan.

 find / -name \*svscan\*
/var/run/svscan.pid
find: /proc/6/fd: Permission denied
/usr/local/bin/svscan
/usr/src/daemontools-0.61/svscan.c
/usr/src/daemontools-0.61/svscan.o
/usr/src/daemontools-0.61/svscan

Svscan is part of the daemontools package as described in "Life". See 2.4
Download Source and 2.7 - Install daemontools. Did you install ucspi-tcp? I
don't know if daemontools is required by qmail, by ucspi-tcp, or by the
plain vanilla instructions in "Life with qmail". Maybe someone can enlighten
us on this point. At any rate I can vouch for a successful installation on
a blue g3 with only one change: in /var/qmail/supervise/qmail-smtpd/run,
the value 2000000 is passed as a parameter to softlimit. In order to get
tcpserver to run properly, I had to increase this value. In changed it to
4000000.

Also, do I need to use the _exact_ same group and user id's for the qmail

> daemons and groups, as the ones pointed in Life With qmail?

Don't know, I just added the groups and user ids as given in "Life". It did
no harm to add them manually.

Attached below is a prototype of three scripts I'll be including on the web
site I'm building

one is a support script for listing the contents of files
two is a support script for ensuring that required entries are added to
configuration files
three is intended to completely configure q-mail

The script as written must run as root. It would be an excellent idea for
anyone running these scripts to read and understand everything the scripts do
before running them. They are derived solely from "Life with qmail" based
verbatim on its contents, but come with no guarantee that they will work and
not do damage on anything but my personal machine. I'm relatively new to
Linux and do not know anywhere near enough to make any statements about the
code's quality.
I welcome constructive criticism of the code, its style and substance.

--
Pat Callahan
Acton Ma USA
Programmer and Kohlrabi Rancher

cat disp #!/bin/sh #! #! disp a shell script for displaying a file's name, its directory entry #! and contents #! #! inputs: $1 #! outputs: stdout #! pre-conditions: $1 must contain a valid file specification #! post-conditions: the parameter is treated as a file name #! output on stdin is formatted using echo #! the file name is #! o echoed to stdin #! o used as a parameter to the ls -lah command #! o used as a parameter to the cat command #! echo "-------------------------------------------------------------" echo "File: $1" echo " " ls -lah $1 echo " " cat $1 echo " "

#!/bin/sh #! #! ensure - a shell script for ensuring that a specific string is included #! in a configuration file #! #! inputs: $1, $2 #! outputs: file specified in $2 #! pre-conditions: $2 must contain a valid file specification #! post-conditions: grep is used to determine if the file specified in $1 #! contains the string supplied in $1. #! if the string is present then the file is left unchanged #! otherwise, the string is added as a new line in the file #! by appending it employing the echo command with output #! redirection #! if !(grep '$1' $2) ; then echo "$1" >>$2 fi

Rather than cut and paste screenfuls of data into netscape' e-mail client, I'm including 0200-qmail as an attachment.

#!/bin/sh # 0200-qmail - a shell script to install qmail as illustrated in "Life with qmail" # # inputs: $1 # outputs: tbs. # pre-conditions: Use your head. This script works on my machine # in the machine's present state. Are you sure it will # work on yours in your machine's state? # # Read the code # # the value of $1 should be a valid username # other than postmaster or root. # qmail sources available in /usr/src/qmail # ucspi-tcp is already installed # daemontools is already installed # # post-conditions: qmail is REMOVED and re-installed. # if not already present, users and groups are added # as specified in "life with qmail" # details tbs. # 0200-qmail is copyright 2000 Patrick A. Callahan it is a derived work # with nearly its entire content copied verbatim from "Life with qmail", # copyright 1999 David E Sill. # # 0200-qmail is covered by the OpenContent License, version 1.0. See # http://www.opencontent.org/opl.shtml for the full license. Basically # you can copy, redistribute, or modify 0200-qmail provide that modified # versions, if redistributed, are also covered by the OpenContent License. # set -v ensure=`pwd`/ensure rm -rf /var/log/qmail rm -rf /var/qmail cd /usr/src/qmail-1.03 mkdir /var/qmail $ensure qmail:*:2107: /etc/group $ensure nofiles:*:2108: /etc/group $ensure alias:x:7790:2108::/var/qmail/alias:/bin/true /etc/passwd $ensure qmaild:x:7791:2108::/var/qmail:/bin/true /etc/passwd $ensure qmaill:x:7792:2108::/var/qmail:/bin/true /etc/passwd $ensure qmailp:x:7793:2108::/var/qmail:/bin/true /etc/passwd $ensure qmailq:x:7794:2107::/var/qmail:/bin/true /etc/passwd $ensure qmailr:x:7795:2107::/var/qmail:/bin/true /etc/passwd $ensure qmails:x:7796:2107::/var/qmail:/bin/true /etc/passwd make setup check ./config-fast localhost cd /usr/src/qmail-1.03 mkdir /var/qmail $ensure qmail:*:2107: /etc/group $ensure nofiles:*:2108: /etc/group $ensure alias:x:7790:2108::/var/qmail/alias:/bin/true /etc/passwd $ensure qmaild:x:7791:2108::/var/qmail:/bin/true /etc/passwd $ensure qmaill:x:7792:2108::/var/qmail:/bin/true /etc/passwd $ensure qmailp:x:7793:2108::/var/qmail:/bin/true /etc/passwd $ensure qmailq:x:7794:2107::/var/qmail:/bin/true /etc/passwd $ensure qmailr:x:7795:2107::/var/qmail:/bin/true /etc/passwd ensure qmails:x:7796:2107::/var/qmail:/bin/true /etc/passwd make setup check ./config cp /var/qmail/boot/home /var/qmail/rc chmod 755 /var/qmail/rc if ! [ -d "/var/log/qmail" ]; then mkdir /var/log/qmail fi if ! [ -e "/etc/rc.d/init.d/qmail" ]; then cat > /etc/rc.d/init.d/qmail <<ENDOFRCFILE #!/bin/sh

PATH=/var/qmail/bin:/usr/local/bin:/usr/bin:/bin export PATH

case "$1" in start) echo -n "Starting qmail: svscan" cd /var/qmail/supervise env - PATH="$PATH" svscan & echo $! > /var/run/svscan.pid echo "." ;; stop) echo -n "Stopping qmail: svscan" kill `cat /var/run/svscan.pid` echo -n " qmail" svc -dx /var/qmail/supervise/* echo -n " logging" svc -dx /var/qmail/supervise/*/log echo "." ;; stat) cd /var/qmail/supervise svstat * */log ;; doqueue|alrm) echo "Sending ALRM signal to qmail-send." svc -a /var/qmail/supervise/qmail-send ;; queue) qmail-qstat qmail-qread ;; reload|hup) echo "Sending HUP signal to qmail-send." svc -h /var/qmail/supervise/qmail-send ;; pause) echo "Pausing qmail-send" svc -p /var/qmail/supervise/qmail-send echo "Pausing qmail-smtpd" svc -p /var/qmail/supervise/qmail-smtpd ;; cont) echo "Continuing qmail-send" svc -c /var/qmail/supervise/qmail-send echo "Continuing qmail-smtpd" svc -c /var/qmail/supervise/qmail-smtpd ;; restart) echo "Restarting qmail:" echo "* Stopping qmail-smtpd." svc -d /var/qmail/supervise/qmail-smtpd echo "* Sending qmail-send SIGTERM and restarting." svc -t /var/qmail/supervise/qmail-send echo "* Restarting qmail-smtpd." svc -u /var/qmail/supervise/qmail-smtpd ;; cdb) tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp chmod 644 /etc/tcp.smtp* echo "Reloaded /etc/tcp.smtp." ;; help) cat <<HELP stop -- stops mail service (smtp connections refused, nothing goes out) start -- starts mail service (smtp connection accepted, mail can go out) pause -- temporarily stops mail service (connections accepted, nothing leaves) cont -- continues paused mail service stat -- displays status of mail service cdb -- rebuild the tcpserver cdb file for smtp restart -- stops and restarts smtp, sends qmail-send a TERM & restarts it doqueue -- sends qmail-send ALRM, scheduling queued messages for delivery reload -- sends qmail-send HUP, rereading locals and virtualdomains queue -- shows status of queue alrm -- same as doqueue hup -- same as reload HELP ;; *) echo "Usage: $0 {start|stop|restart|doqueue|reload|stat|pause|cont|cdb|queue|help}" exit 1 ;; esac

exit 0 ENDOFRCFILE # # # fi # # # rm /etc/rc.d/rc*.d/*qmail -f ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc0.d/K30qmail ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc1.d/K30qmail ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc2.d/S80qmail ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc4.d/S80qmail ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc5.d/S80qmail ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc6.d/K80qmail mkdir -p /var/qmail/supervise/qmail-send/log mkdir -p /var/qmail/supervise/qmail-smtpd/log chmod +t /var/qmail/supervise/qmail-send chmod +t /var/qmail/supervise/qmail-smtpd cat <<EOF >/var/qmail/supervise/qmail-send/run #!/bin/sh exec /var/qmail/rc EOF cat <<EOF >/var/qmail/supervise/qmail-send/log/run #!/bin/sh exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t /var/log/qmail EOF cat <<EOF >/var/qmail/supervise/qmail-smtpd/run #!/bin/sh QMAILDUID=\`id -u qmaild\` NOFILESGID=\`id -g qmaild\` exec /usr/local/bin/softlimit -m 2000000 \\ /usr/local/bin/tcpserver -v -p -x /etc/tcp.smtp.cdb \\ -u \$QMAILDUID -g \$NOFILESGID 0 smtp /var/qmail/bin/qmail-smtpd 2>&1 EOF # # # cat <<EOF >/var/qmail/supervise/qmail-smtpd/log/run #!/bin/sh exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t /var/log/qmail/smtpd EOF chmod 755 /var/qmail/supervise/qmail-send/run chmod 755 /var/qmail/supervise/qmail-send/log/run chmod 755 /var/qmail/supervise/qmail-smtpd/run chmod 755 /var/qmail/supervise/qmail-smtpd/log/run mkdir -p /var/log/qmail/smtpd chown qmaill /var/log/qmail /var/log/qmail/smtpd chmod 755 /etc/rc.d/init.d/qmail ln -s /etc/init.d/qmail /usr/local/bin echo '127.:allow,RELAYCLIENT=""' >>/etc/tcp.smtp /usr/local/sbin/qmail cdb echo $1 > /var/qmail/alias/.qmail-root echo $1 > /var/qmail/alias/.qmail-postmaster ln -s .qmail-postmaster > /var/qmail/alias/.qmail-mailer-daemon chmod 644 /var/qmail/alias/.qmail-root /var/qmail/alias/.qmail-postmaster

echo mail.tiac.net > /var/qmail/control/defaulthost; chmod 644 /var/qmail/control/defaulthost



This archive was generated by hypermail 2a24 : Tue Feb 01 2000 - 17:50:59 MST