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 |
| 16 | create the init.d script:</para> |
| 17 | |
| 18 | <para><screen><userinput> |
| 19 | cat > /etc/rc.d/init.d/qmail << "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 | |
| 26 | source /etc/sysconfig/rc |
| 27 | source $rc_functions |
| 28 | |
| 29 | case "$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 | ;; |
| 51 | esac |
| 52 | |
| 53 | # End $rc_base/init.d/qmail |
| 54 | EOF |
| 55 | chmod 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 && |
| 60 | ln -sf ../init.d/qmail ../rc0.d/K25qmail && |
| 61 | ln -sf ../init.d/qmail ../rc1.d/K25qmail && |
| 62 | ln -sf ../init.d/qmail ../rc2.d/K25qmail && |
| 63 | ln -sf ../init.d/qmail ../rc3.d/S35qmail && |
| 64 | ln -sf ../init.d/qmail ../rc4.d/S35qmail && |
| 65 | ln -sf ../init.d/qmail ../rc5.d/S35qmail && |
| 66 | ln -sf ../init.d/qmail ../rc6.d/K25qmail</userinput></screen></para> |
| 67 | |