|
1 queue-fix 1.4 |
|
2 19990314 |
|
3 Copyright 1999 |
|
4 Eric Huss |
|
5 e-huss@netmeridian.com |
|
6 |
|
7 This is a small utility for checking and repairing the qmail queue |
|
8 structure. It will fix uid/gid settings and permissions. It will |
|
9 rename the message files to match their inodes. It will even create |
|
10 directories and files that don't exist that should be there (you can |
|
11 even create a queue from scratch). It will also print warnings for |
|
12 any files it finds that should not exist. |
|
13 |
|
14 Compiling: |
|
15 1) Extract the tar file. |
|
16 2) Edit conf-cc and conf-ld for your compiler. |
|
17 3) If you changed conf-split when you compiled qmail, edit queue-fix.c |
|
18 and change SPLIT_NUM to this value. |
|
19 4) Type make. |
|
20 |
|
21 This will produce the "queue-fix" executable. |
|
22 |
|
23 How to use: |
|
24 queue-fix [-i | -N] queue_directory |
|
25 |
|
26 Use the -i option to go into interactive mode. In interactive mode, |
|
27 it will prompt for confirmation before it begins a task. |
|
28 Alternatively, you may use the -N option to go into test mode. |
|
29 In test mode, queue-fix will print to standard output all the actions |
|
30 queue-fix would normally do, but does not actually call them. |
|
31 queue_directory is the location of the queue to fix. |
|
32 |
|
33 For your safety, you should always make a backup of your queue before |
|
34 running queue-fix. |
|
35 |
|
36 Examples: |
|
37 |
|
38 1) Moving your queue. |
|
39 a) Shut down qmail-send. Wait for exiting to show up in the log. |
|
40 Shut down qmail-smptd: |
|
41 - if inetd, comment out of /etc/inetd.conf and send inetd |
|
42 a HUP. |
|
43 - if supervise, use svc -d to bring it down |
|
44 Shut down any processes which may run qmail-queue. This includes, |
|
45 but is not limited to qmqpd, pop, imapd, etc. |
|
46 b) Choose the location for the new home of your queue. In this |
|
47 example: originally in /var/qmail/queue |
|
48 moving to /other/qmail/queue |
|
49 c) cd /var/qmail |
|
50 d) mv queue /other/qmail |
|
51 e) queue-fix -i /other/qmail/queue |
|
52 f) Run queue-fix again just to make sure it worked. If it prints |
|
53 anything other than finished, then something is seriously |
|
54 wrong. |
|
55 g) Either make a link to the new queue location, or recompile |
|
56 qmail with the new queue location. |
|
57 h) Restart qmail and test it. |
|
58 |
|
59 2) Reconstructing the file system. |
|
60 a) Shut down qmail-send. Wait for exiting to show up in the log. |
|
61 Shut down qmail-smptd: |
|
62 - if inetd, comment out of /etc/inetd.conf and send inetd |
|
63 a HUP. |
|
64 - if supervise, use svc -d to bring it down |
|
65 Shut down any processes which may run qmail-queue. This includes, |
|
66 but is not limited to qmqpd, pop, imapd, etc. |
|
67 b) Do whatever file system changes that you need to do. |
|
68 c) queue-fix -i /var/qmail/queue |
|
69 d) Run queue-fix again just to make sure it worked. If it prints |
|
70 anything other than finished, then something is seriously |
|
71 wrong. |
|
72 e) Restart qmail and test it. |
|
73 |
|
74 Extra Safety: |
|
75 |
|
76 You must ensure that no other program modifies the queue while queue-fix |
|
77 is running. If you are unsure whether or not something will try to use |
|
78 the queue, type: |
|
79 |
|
80 chmod 0 /var/qmail/bin/qmail-queue |
|
81 |
|
82 before running queue-fix. This will assume that MUA's and other applications |
|
83 that inject mail will recognize the failure to run qmail-queue. |
|
84 Once you are done, type: |
|
85 |
|
86 chmod 4711 /var/qmail/bin/qmail-queue |
|
87 |
|
88 to get it going again. |
|
89 |
|
90 Known faults: |
|
91 |
|
92 - The error messages are not very descriptive of the problem. |
|
93 - Responding "no" during interactive mode results in a confusing |
|
94 error message. |
|
95 - queue-fix checks for special files to exist in the queue, but does |
|
96 not check their type (for example, a regular file existing where |
|
97 there should be a named pipe). |
|
98 |
|
99 Epilogue: |
|
100 |
|
101 If you have problems, please let me know. I make no guarantees about |
|
102 the quality of this program. |
|
103 |
|
104 This utility as an experiment uses the libraries written by D. J. |
|
105 Bernstein. Thanks! |