Ticket #154: qmailboot.patch

File qmailboot.patch, 2.0 KB (added by billy@…, 19 years ago)

adds qmail bootscripts to /etc/rc.d/init.d

  • qmail-config.xml

    old new  
    1111echo "smtp stream tcp nowait qmaild /var/qmail/bin/tcp-env \
    1212tcp-env /var/qmail/bin/qmail-smtpd" >> /etc/inetd.conf
    1313</userinput></screen></para>
    14 <para>Add:
    15 <userinput>sh -cf '/var/qmail/rc &'</userinput>
    16 to your boot scripts, so that the qmail daemons are restarted whenever
    17 your system reboots. Make sure you include the &.</para>
     14
     15<para>To automate the running of qmail, use following command to
     16create the init.d script:</para>
     17
     18<para><screen><userinput>
     19cat &gt; /etc/rc.d/init.d/qmail &lt;&lt; "EOF"
     20#!/bin/sh
     21# Begin $rc_base/init.d/qmail
     22
     23# Based on sysklogd script from LFS-3.1 and earlier.
     24# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org
     25
     26source /etc/sysconfig/rc
     27source $rc_functions
     28
     29case "$1" in
     30
     31        start)
     32        echo "Starting Qmail..."
     33        /var/qmail/rc &
     34        ;;
     35
     36        stop)
     37        echo "Stopping Qmail..."
     38        killall qmail-send
     39        ;;
     40               
     41        restart)
     42        $0 stop
     43        sleep 1
     44        $0 start
     45        ;;
     46
     47        *)
     48        echo "Usage: $0 {start|stop|restart}"
     49        exit 1
     50        ;;
     51esac
     52
     53# End $rc_base/init.d/qmail
     54EOF
     55chmod 755 /etc/rc.d/init.d/qmail</userinput></screen></para>
     56
     57<para>Create the symbolic links to this file in the relevant rc.d directory with the following commands:
     58
     59<screen><userinput>cd /etc/rc.d/init.d &amp;&amp;
     60ln -sf ../init.d/qmail ../rc0.d/K25qmail &amp;&amp;
     61ln -sf ../init.d/qmail ../rc1.d/K25qmail &amp;&amp;
     62ln -sf ../init.d/qmail ../rc2.d/K25qmail &amp;&amp;
     63ln -sf ../init.d/qmail ../rc3.d/S35qmail &amp;&amp;
     64ln -sf ../init.d/qmail ../rc4.d/S35qmail &amp;&amp;
     65ln -sf ../init.d/qmail ../rc5.d/S35qmail &amp;&amp;
     66ln -sf ../init.d/qmail ../rc6.d/K25qmail</userinput></screen></para>
     67
    1868</sect3>
    1969
    2070<sect3><title>Configuring mailers to work with qmail</title>