summaryrefslogtreecommitdiff
path: root/source/a/sysklogd/sysklogd_1.4.1-20.diff
blob: 9bb27bbb61ce720afa55bf9c43c688d7583e764d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
--- sysklogd-1.4.1.orig/CHANGES
+++ sysklogd-1.4.1/CHANGES
@@ -30,3 +30,4 @@
  . Olaf Kirch <okir@caldera.de>
    - Remove Unix Domain Sockets and switch to Datagram Unix Sockets
  . Several bugfixes and improvements, please refer to the .c files
+
--- sysklogd-1.4.1.orig/README.linux
+++ sysklogd-1.4.1/README.linux
@@ -44,8 +44,8 @@
 mail to Majordomo@Infodrom.North.DE with a line "subscribe sysklogd"
 in the message body.
 
-New versions of this package will be available at Joey's ftp server.
-ftp://ftp.infodrom.north.de/pub/people/joey/sysklogd/
+New versions of this package will be available at Joey's server.
+  http://www.infodrom.org/projects/sysklogd/
 
 Best regards,
 
@@ -67,6 +67,6 @@
 
 Martin Schulze
 Infodrom Oldenburg
-joey@linux.de
+joey@infodrom.org
 
 And a host of bug reporters whose contributions cannot be underestimated.
--- sysklogd-1.4.1.orig/klogd.8
+++ sysklogd-1.4.1/klogd.8
@@ -321,7 +321,7 @@
 .B klogd
 to reload the module symbol information whenever a protection fault
 is detected.  Caution should be used before invoking the program in
-\'paranoid\' mode.  The stability of the kernel and the operating
+\&'paranoid\&' mode.  The stability of the kernel and the operating
 environment is always under question when a protection fault occurs.
 Since the klogd daemon must execute system calls in order to read the
 module symbol information there is the possibility that the system may
--- sysklogd-1.4.1.orig/ksym_mod.c
+++ sysklogd-1.4.1/ksym_mod.c
@@ -78,6 +78,11 @@
  *
  * Tue Sep 12 23:11:13 CEST 2000: Martin Schulze <joey@infodrom.ffis.de>
  *	Changed llseek() to lseek64() in order to skip a libc warning.
+ *
+ * Wed Mar 31 17:35:01 CEST 2004: Martin Schulze <joey@infodrom.org>
+ *	Removed references to <linux/module.h> since it doesn't work
+ *	anymore with its recent content from Linux 2.4/2.6, created
+ *	module.h locally instead.
  */
 
 
@@ -89,11 +94,12 @@
 #include <errno.h>
 #include <sys/fcntl.h>
 #include <sys/stat.h>
+#include "module.h"
 #if !defined(__GLIBC__)
 #include <linux/time.h>
-#include <linux/module.h>
+#include <linux/linkage.h>
 #else /* __GLIBC__ */
-#include <linux/module.h>
+#include <linux/linkage.h>
 extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
 extern int get_kernel_syms __P ((struct kernel_sym *__table));
 #endif /* __GLIBC__ */
--- sysklogd-1.4.1.orig/module.h
+++ sysklogd-1.4.1/module.h
@@ -0,0 +1,90 @@
+/*
+    module.h - Miscellaneous module definitions
+    Copyright (c) 1996 Richard Henderson <rth@tamu.edu>
+    Copyright (c) 2004 Martin Schulze <joey@infodrom.org>
+
+    This file is part of the sysklogd package.
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+/* ChangeLog:
+ *
+ * Wed Mar 31 17:35:01 CEST 2004: Martin Schulze <joey@infodrom.org>
+ *	Created local copy of module.h based on the content of Linux
+ *	2.2 since <linux/module.h> doesn't work anymore with its
+ *	recent content from Linux 2.4/2.6.
+ * Thu May 25 09:14:33 CEST 2006: Martin Schulze <joey@infodrom.org>
+ *	Removed asm/atomic.h since it is not needed anymore.
+ */
+
+#define MODULE_NAME_LEN 60
+
+struct kernel_sym
+{
+	unsigned long value;
+	char name[MODULE_NAME_LEN];
+};
+
+
+struct list_head {
+	struct list_head *next, *prev;
+};
+
+
+struct module_info
+{
+	unsigned long addr;
+	unsigned long size;
+	unsigned long flags;
+	long usecount;
+};
+
+
+struct module
+{
+	unsigned long size_of_struct;	/* == sizeof(module) */
+	struct module *next;
+	const char *name;
+	unsigned long size;
+
+	union
+	{
+		int usecount;
+		long pad;
+	} uc;				/* Needs to keep its size - so says rth */
+
+	unsigned long flags;		/* AUTOCLEAN et al */
+
+	unsigned nsyms;
+	unsigned ndeps;
+
+	struct module_symbol *syms;
+	struct module_ref *deps;
+	struct module_ref *refs;
+	int (*init)(void);
+	void (*cleanup)(void);
+	const struct exception_table_entry *ex_table_start;
+	const struct exception_table_entry *ex_table_end;
+#ifdef __alpha__
+	unsigned long gp;
+#endif
+	/* Members past this point are extensions to the basic
+	   module support and are optional.  Use mod_opt_member()
+	   to examine them.  */
+	const struct module_persist *persist_start;
+	const struct module_persist *persist_end;
+	int (*can_unload)(void);
+};
--- sysklogd-1.4.1.orig/pidfile.c
+++ sysklogd-1.4.1/pidfile.c
@@ -87,7 +87,7 @@
   int fd;
   int pid;
 
-  if ( ((fd = open(pidfile, O_RDWR|O_CREAT, 0644)) == -1)
+  if ( ((fd = open(pidfile, O_RDWR|O_CREAT|O_TRUNC, 0644)) == -1)
        || ((f = fdopen(fd, "r+")) == NULL) ) {
       fprintf(stderr, "Can't open or create %s.\n", pidfile);
       return 0;
--- sysklogd-1.4.1.orig/syslog.conf.5
+++ sysklogd-1.4.1/syslog.conf.5
@@ -64,7 +64,7 @@
 The
 .I facility
 is one of the following keywords:
-.BR auth ", " authpriv ", " cron ", " daemon ", " kern ", " lpr ", "
+.BR auth ", " authpriv ", " cron ", " daemon ", " ftp ", " kern ", " lpr ", "
 .BR mail ", " mark ", " news ", " security " (same as " auth "), "
 .BR syslog ", " user ", " uucp " and " local0 " through " local7 .
 The keyword 
@@ -122,7 +122,7 @@
 This 
 .BR syslogd (8)
 has a syntax extension to the original BSD source, that makes its use
-more intuitively.  You may precede every priority with an equation sign
+more intuitive.  You may precede every priority with an equation sign
 (``='') to specify only this single priority and not any of the
 above.  You may also (both is valid, too) precede the priority with an
 exclamation mark (``!'') to ignore all that priorities, either exact
@@ -300,7 +300,7 @@
 .B syslogd
 log all messages that come with either the
 .BR info " or the " notice
-facility into the file
+priority into the file
 .IR /var/log/messages ,
 except for all messages that use the
 .B mail
--- sysklogd-1.4.1.orig/syslogd.c
+++ sysklogd-1.4.1/syslogd.c
@@ -890,11 +890,11 @@
 		dprintf("Checking pidfile.\n");
 		if (!check_pid(PidFile))
 		{
+			signal (SIGTERM, doexit);
 			if (fork()) {
 				/*
 				 * Parent process
 				 */
-				signal (SIGTERM, doexit);
 				sleep(300);
 				/*
 				 * Not reached unless something major went wrong.  5
@@ -1074,9 +1074,9 @@
 				  (fd_set *) NULL, (struct timeval *) NULL);
 		if ( restart )
 		{
+			restart = 0;
 			dprintf("\nReceived SIGHUP, reloading syslogd.\n");
 			init();
-			restart = 0;
 			continue;
 		}
 		if (nfds == 0) {
@@ -1141,13 +1141,13 @@
 				 */
 				printchopped(from, line, \
  					     i + 2,  finet);
-			} else if (i < 0 && errno != EINTR) {
+			} else if (i < 0 && errno != EINTR && errno != EAGAIN) {
 				dprintf("INET socket error: %d = %s.\n", \
 					errno, strerror(errno));
 				logerror("recvfrom inet");
 				/* should be harmless now that we set
 				 * BSDCOMPAT on the socket */
-				sleep(10);
+				sleep(1);
 			}
 		}
 #endif
@@ -1216,6 +1216,7 @@
 {
 	int fd, on = 1;
 	struct sockaddr_in sin;
+	int sockflags;
 
 	fd = socket(AF_INET, SOCK_DGRAM, 0);
 	if (fd < 0) {
@@ -1241,6 +1242,24 @@
 		close(fd);
 		return -1;
 	}
+	/* We must not block on the network socket, in case a packet
+	 * gets lost between select and recv, otherise the process
+	 * will stall until the timeout, and other processes trying to
+	 * log will also stall.
+	 */
+	if ((sockflags = fcntl(fd, F_GETFL)) != -1) {
+		sockflags |= O_NONBLOCK;
+		/*
+		 * SETFL could fail too, so get it caught by the subsequent
+		 * error check.
+		 */
+		sockflags = fcntl(fd, F_SETFL, sockflags);
+	}
+	if (sockflags == -1) {
+		logerror("fcntl(O_NONBLOCK), suspending inet");
+		close(fd);
+		return -1;
+	}
 	if (bind(fd, (struct sockaddr *) &sin, sizeof(sin)) < 0) {
 		logerror("bind, suspending inet");
 		close(fd);
@@ -1275,7 +1294,7 @@
 	for (count=i=0; p[i]; i++)
 		if (p[i] == LIST_DELIMITER) count++;
 	
-	if ((result = (char **)malloc(sizeof(char *) * count+2)) == NULL) {
+	if ((result = (char **)malloc(sizeof(char *) * (count+2))) == NULL) {
 		printf ("Sorry, can't get enough memory, exiting.\n");
 		exit(0);
 	}
@@ -1539,20 +1558,37 @@
 	int fac, prilev, lognum;
 	int msglen;
 	char *timestamp;
+#ifdef __gnu_linux__
+	sigset_t mask;
+#else
+#ifndef SYSV
+	sigset_t omask;
+#endif
+#endif
 
 	dprintf("logmsg: %s, flags %x, from %s, msg %s\n", textpri(pri), flags, from, msg);
 
+#ifdef __gnu_linux__
+	sigemptyset(&mask);
+	sigaddset(&mask, SIGHUP);
+	sigaddset(&mask, SIGALRM);
+	sigprocmask(SIG_BLOCK, &mask, NULL);
+#else
 #ifndef SYSV
 	omask = sigblock(sigmask(SIGHUP)|sigmask(SIGALRM));
 #endif
+#endif
 
 	/*
 	 * Check to see if msg looks non-standard.
 	 */
 	msglen = strlen(msg);
-	if (msglen < 16 || msg[3] != ' ' || msg[6] != ' ' ||
-	    msg[9] != ':' || msg[12] != ':' || msg[15] != ' ')
-		flags |= ADDDATE;
+	flags |= ADDDATE;
+	if ( !(msglen < 16 || msg[3] != ' ' || msg[6] != ' ' ||
+	    msg[9] != ':' || msg[12] != ':' || msg[15] != ' ')) {
+		msg += 16;
+		msglen -= 16;
+	}
 
 	(void) time(&now);
 	if (flags & ADDDATE)
@@ -1581,9 +1617,13 @@
 			(void) close(f->f_file);
 			f->f_file = -1;
 		}
+#ifdef __gnu_linux__
+		sigprocmask(SIG_UNBLOCK, &mask, NULL);
+#else
 #ifndef SYSV
 		(void) sigsetmask(omask);
 #endif
+#endif
 		return;
 	}
 #ifdef SYSV
@@ -1646,9 +1686,13 @@
 			}
 		}
 	}
+#ifdef __gnu_linux__
+	sigprocmask(SIG_UNBLOCK, &mask, NULL);
+#else
 #ifndef SYSV
 	(void) sigsetmask(omask);
 #endif
+#endif
 }
 #if FALSE
 } /* balance parentheses for emacs */
@@ -1839,7 +1883,7 @@
 #else
 				&& e == EBADF) {
 #endif
-				f->f_file = open(f->f_un.f_fname, O_WRONLY|O_APPEND|O_NOCTTY);
+				f->f_file = open(f->f_un.f_fname, O_WRONLY|O_APPEND|O_NOCTTY|O_NONBLOCK);
 				if (f->f_file < 0) {
 					f->f_type = F_UNUSED;
 					logerror(f->f_un.f_fname);
@@ -2640,7 +2684,7 @@
 			f->f_file = open(++p, O_RDWR|O_NONBLOCK);
 			f->f_type = F_PIPE;
 	        } else {
-			f->f_file = open(p, O_WRONLY|O_APPEND|O_CREAT|O_NOCTTY,
+			f->f_file = open(p, O_WRONLY|O_APPEND|O_CREAT|O_NOCTTY|O_NONBLOCK,
 					 0644);
 			f->f_type = F_FILE;
 		}
--- sysklogd-1.4.1.orig/debian/NMU-Disclaimer
+++ sysklogd-1.4.1/debian/NMU-Disclaimer
@@ -0,0 +1,45 @@
+Non Maintainer Upload of this Package
+-------------------------------------
+
+If you plan to work on an NMU for this package, read the following
+closely.  It can save you and me some grief.
+
+ 1. At first, contact the maintainer (i.e. send a mail to
+    joey@debian.org, do not cc or bounce a mail, send a plain mail,
+    not copied to any mailing list or the BTS) and ask about the
+    status of the bug you are considering to work on.
+
+ 2. In this mail include all information relevant for this problem,
+    i.e. include a description of the bug and not only its bug
+    number.
+
+ 3. If the maintainer is not able or willing to fix the problem or
+    does not respond within four days, continue with step 4.
+
+ 4. Work on the bug and prepare a patch.  Do not upload into the
+    Debian archive.
+
+ 5. Send the entire patch, together with enough explanations, to the
+    maintainer for reviewing and ask him for permission of an NMU
+    using this patch.
+
+ 6. IF AND ONLY IF the maintainer approves the patch (or doesn't
+    respond within four days), upload the NMU to the incoming
+    directory and send the patch to the BTS.  If the NMU is not
+    approved, go back to 4. or add the NMU to your homepage, but do
+    not upload it to the Debian archive.
+
+ 7. Properly sized and well-written patches sent to the BTS are always
+    appreciated, even if they are rejected later.  They demonstrate a
+    potential solution which could probably improved into a real
+    solution.
+
+ 8. NEVER change the way a package is maintained in an NMU, i.e. don't
+    remove dh_* stuff or switch to dh_* respectively.  This rule
+    applies to all NMU's, not only to an NMU for this package.
+
+These rules always apply.  They even apply if somebody declares NMUs
+as ok and reduces regular NMU rules to a delay of zero days.  Unless
+I'm on vacation or on a show I am reachable via mail, so there is
+hardly a reason not to contact me.
+
--- sysklogd-1.4.1.orig/debian/changelog
+++ sysklogd-1.4.1/debian/changelog
@@ -0,0 +1,694 @@
+sysklogd (1.4.1-20) unstable; urgency=low
+
+  * Added a missing whitespace to the rc file (Closes: Bug#388787,
+    Bug#388378, Bug#388260)
+  * Corrected typo in syslog.conf(5) (Closes: Bug#327200)
+
+ -- Martin Schulze <joey@infodrom.org>  Thu, 28 Sep 2006 20:46:41 +0200
+
+sysklogd (1.4.1-19) unstable; urgency=high
+
+  * Converted init.d scripts to LSB style
+    - accidently closes: Bug#211858
+  * Removed code that's not required anymore in cron.daily/sysklogd
+  * Fix initial permission (closes: Bug#285500)
+  * Added a special exception for when /var/log/news is a file (closes:
+    Bug#266555)
+  * Tidy up the postinst script
+  * Added devfs awarenes for /dev/xconsole creation (closes: Bug#206066)
+  * Move daemon stop logic into klogd's postinst
+  * Removed both preinst scripts from the distribution
+
+ -- Martin Schulze <joey@infodrom.org>  Mon, 18 Sep 2006 13:15:59 +0200
+
+sysklogd (1.4.1-18) unstable; urgency=medium
+
+  * Removed asm/atomic.h since it is not needed anymore. (closes:
+    Bug#350764)
+  * Fixed typo in NMU-Disclaimer (closes: Bug#225895)
+  * Corrected getconf call in debian/rules to fix lagefile support
+    (closes: Bug#320119)
+  * Applied patch by Joey Hess to prevent klogd to be stopped/started too
+    fast (closes: Bug#284914)
+  * Finish /usr/share/doc transition with patch by Julien Cristau (closes:
+    Bug#337712, Bug#322769, Bug#255590)
+  * Reset the 'restart' flag immediately after entering the restart code.
+    Thanks to Dean Gaudet (closes: Bug#154805)
+  * Added support for /etc/default/{syslogd,klogd} files to contain
+    commandline arguments for syslogd and klogd (closes: Bug#98631,
+    Bug#127579, Bug#241350, Bug#266985)
+  * Added a description of system log level and link to sysctl(8) (closes:
+    Bug#164153)
+  * Acknowledging Joey's NMUs (closes: Bug#347333)
+
+ -- Martin Schulze <joey@infodrom.org>  Thu, 25 May 2006 11:07:52 +0200
+
+sysklogd (1.4.1-17) unstable; urgency=high
+
+  * Use $(getconf LFS_CFLAGS) for large file support
+  * Applied adjusted patch by Miquel van Smoorenburg to fix spurious
+    hanging syslogd in connection with futex and NPTL introduced in recent
+    glibc versions and Linux 2.6 (closes: Bug#301511)
+
+ -- Martin Schulze <joey@infodrom.org>  Wed, 25 May 2005 20:10:31 +0200
+
+sysklogd (1.4.1-16) unstable; urgency=medium
+
+  * applied patch by cph
+  * Applied patch by Colin Phipps so that syslogd doesn't block on the
+    network socket, in case a packet gets lost between select and
+    recv. (closes: Bug#275578)
+  * Applied patch by Anders Henke so that syslog calculates the time for
+    each message (closes: Bug#207619)
+  * Don't create /var/log/news if it's not needed (closes: Bug#266555)
+
+ -- Martin Schulze <joey@infodrom.org>  Sun,  7 Nov 2004 13:10:03 +0100
+
+sysklogd (1.4.1-15) unstable; urgency=low
+
+  * Applied patch by Steve Grubb <linux_4ever@yahoo.com> to adjust memory
+    calculation in crunch_list().
+  * Removed atomic_t in the usecount field of the module struct for
+    compatibility reasons (closes: Bug#245513)
+
+ -- Martin Schulze <joey@infodrom.org>  Tue, 27 Jul 2004 17:28:49 +0200
+
+sysklogd (1.4.1-14) unstable; urgency=medium
+
+  * Added more trailing newlines to init.d programs (closes: Bug#216110)
+  * Adjusted the use of head to the new behaviour for GNU coreutils
+    (closes: Bug#205535, Bug#172655)
+  * Install /usr/share/sysklogd/dummy to replace /usr/share/doc/sysklogd,
+    since /usr/share/doc should be removable by an admin (Policy 12.3).
+    (closes: Bug#237724)
+  * Added a private module.h with extracted data from Linux 2.2 to replace
+    <linux/module.h> which creates a number parse errors.  (closes: Bug#223210)
+  * Added support for invoke-rc.d as written in policy 9.3.3 (closes:
+    Bug#213211, Bug#213585, Bug#216858, Bug#214912)
+
+ -- Martin Schulze <joey@debian.org>  Wed, 31 Mar 2004 18:18:54 +0200
+
+sysklogd (1.4.1-13) unstable; urgency=medium
+
+  * Updated some text in the cronjobs
+  * Direct output of reloading to /dev/null so that no cron log mails will
+    be created defaultly (closes: Bug#213717, Bug#213646)
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Thu,  2 Oct 2003 19:51:34 +0200
+
+sysklogd (1.4.1-12) unstable; urgency=low
+
+  * On heavily loaded system syslog will not spit out error messages
+    anymore when recvfrom() results in EAGAIN (closes: Bug#188194)
+  * Applied patch by Ryan Murray to make this package build on mipsel
+    again (closes: Bug#191969)
+  * Added O_NONBLOCK to two more locations, since Andreas Barth
+    <aba@not.so.argh.org> believes that it fixes this bug.  However,
+    according to the note in open(2) this does not have to have any effect
+    on files other than pipes... (closes: Bug#45245)
+  * Permissions on empty files should also be corrected (closes: Bug#135485)
+  * Corrected the number of bytes denoting 1GB for large logfiles (closes: Bug#138234)
+  * Corrected the handling of the skip pattern (closes: Bug#152247)
+  * Don't cut non-newline trailing characters from the last line anymore
+    (closes: Bug#152248)
+  * Improved init.d scripts so non-existing pid directories are not
+    touched anymore (see Bug#165472)
+  * Whoops, looks like O_TRUNC was missing when opening the pidfile for writing,
+    increasing the chance of left-overs from older pid contents in the
+    file.  (closes: Bug#165472) 
+  * Don't send SIGHUP to klogd anymore.  Only restart it in case the old
+    process got lost somehow.  (closes: Bug#168851)
+  * Improved init.d script output (closes: Bug#190328)
+  * Adjusted the use of chown to the new behaviour for GNU coreutils
+    (closes: Bug#205364)
+  * Adjusted the use of head to the new behaviour for GNU coreutils
+    (closes: Bug#205535)
+  * Moved the installation of the signal handler up a little bit so it
+    guaranteed to be available when the child is forked, hence, fixing a
+    race condition.  This used to create problems with UML and fast
+    machines.  Thanks to Jon Burgess <Jon_Burgess@eur.3com.com> (closes:
+    Bug#211993)
+
+ -- Martin Schulze <joey@kyllikki.infodrom.north.de>  Sun, 28 Sep 2003 12:34:31 +0200
+
+sysklogd (1.4.1-11) unstable; urgency=low
+
+  * Added a disclaimer for those people who plan to NMU this package
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Thu, 17 Oct 2002 08:26:04 +0200
+
+sysklogd (1.4.1-10) unstable; urgency=low
+
+  * Removed bashism from rc files (closes: Bug#127406, Bug#127407,
+    Bug#127578, Bug#127372)
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Thu,  3 Jan 2002 18:22:13 +0100
+
+sysklogd (1.4.1-9) unstable; urgency=low
+
+  * Use a newer Standards-Version
+  * Corrected dependency of sysklogd (closes: Bug#123908)
+  * Transfer section/priority into .deb (closes: Bug#123908)
+  * Fix typo in syslog.conf(5) (closes: Bug#126899)
+  * Added ``-e'' to weekly and daily cron scripts.  Beware, from now on
+    they will fail if an error occurs and leave /var/log in an undefined
+    state, not signalling syslogd to reopen files as well. (closes: Bug#123281)
+  * Added some intelligence into /etc/init.d/sysklogd and klogd so the
+    daemons will be restarted when they should only be reloaded but are
+    not running.  This could be helpful if after an OOM situation syslogd
+    or klogd were killed by init but cron wasn't.  (closes: Bug#126749, Bug#126750)
+  * Create /dev/xconsole in init.d script if it doesn't exist.  Hence
+    removing this out of the postinst script.  This should help situations
+    when devfs is installed and /dev/ get's removed on system boot, thus
+    /dev/xconsole gets removed as well. (closes: Bug#106535)
+  * Added ftp facility (closes: Bug#100437)
+  * Added missing documentation to syslogd-listfiles(8) (fixes: Bug#48326)
+  * Added a PATH= statement to all init.d files (closes: Bug#47901)
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Tue,  1 Jan 2002 13:44:42 +0100
+
+sysklogd (1.4.1-8) unstable; urgency=low
+
+  * Added special code to find out if a logfile was rotated within the
+    last 5 hours already, hence should not be rotated again.  Hope this
+    satisfies Craig Sanders' request properly. (closes: Bug#39198)
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Thu,  6 Dec 2001 11:06:53 +0100
+
+sysklogd (1.4.1-7) unstable; urgency=low
+
+  * Fixed override disparity
+  * Added more defines so files larger than 2GB can be created, approved
+    by the glibc maintainer (closes: Bug#120574)
+  * Closing old bug reports (closes: Bug#95230, Bug#34391, Bug#72892)
+  * Added `--large nnn' as argument to syslogd-listfiles so people can
+    decide on their own what a large file is (closes: Bug#39198)
+  * Increased the default definition for large files
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Wed,  5 Dec 2001 22:01:23 +0100
+
+sysklogd (1.4.1-6) unstable; urgency=low
+
+  * Corrected path for syslogd in cron scripts (closes: Bug#122261,
+    Bug#121680, Bug#120809)
+  * Already fixed bugs (closes: Bug#121784)
+  * Improved package description (closes: Bug#120755)
+  * Added an improved pattern for news.*, thanks Takuo (closes: Bug#103999)
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Tue,  4 Dec 2001 09:46:46 +0100
+
+sysklogd (1.4.1-5) unstable; urgency=low
+
+  * Fix the override disparity
+  * Removed superflous Priority
+  * Removed =VER= string from syslogd-listfiles (closes: Bug#102998)
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Wed, 21 Nov 2001 23:00:29 +0100
+
+sysklogd (1.4.1-4) unstable; urgency=low
+
+  * Added convenience code to support $DEB_BUILD_OPTIONS
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Wed, 21 Nov 2001 18:41:23 +0100
+
+sysklogd (1.4.1-3) unstable; urgency=medium
+
+  * Be more anal about whether sysklogd is installed or not in our cron
+    scripts (closes: Bug#100319)
+  * Added missing newline in init.d script upon restart (closes: Bug#95554)
+  * Moved stop code to prerm (closes: Bug#120249, Bug#96355, Bug#105441,
+    Bug#105442, Bug#109470)
+  * Corrected broken character in klogd.8 (closes: Bug#75932) [repeat, due
+    to typo]
+  * Added dependency to klogd so people who upgrade their sysklogd package
+    won't lose it anymore (closes: Bug#93729) [repeat, another bug#]
+  * auth.* files are only rotated daily (closes: Bug#102138)
+  * Changed -p to -s in documentation (closes: Bug#108473)
+  * Updated documentation to reflect the current location of the mailing
+    list
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Tue, 20 Nov 2001 20:48:32 +0100
+
+sysklogd (1.4.1-2) unstable; urgency=low
+
+  * Corrected location of GPL (closes: Bug#90582)
+  * Added section and priority for binary packages
+  * Added dependency to klogd so people who upgrade their sysklogd package
+    won't lose it anymore (closes: Bug#93922)
+  * Added code snipped to stop klogd/syslogd upon removal (closes:
+    Bug#90534, Bug#90970)
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Sat, 21 Apr 2001 15:06:02 +0200
+
+sysklogd (1.4.1-1) unstable; urgency=low
+
+  * New upstream source (closes: Bug#87819, Bug#70790, Bug#32580,
+    Bug#62358, Bug#71631)
+  * Upstream: Doesn't re-set log-level if not requested (closes:
+    Bug#76170, Bug#76170, Bug#85289)
+  * Upstream: Ignore zero bytes (closes: Bug#85478, Bug#85478, Bug#41068)
+  * Upstream: Corrected documentation for `-s' (closes: Bug#87020)
+  * Upstream: test for existence of syslogd-listfiles before calling
+    them.  This got lost due to 1.4.0 brokennes which was packaged and
+    removed some hours later (closes: Bug#84872, Bug#66712)
+  * Applied patch by Tommi Virtanen <tv@debian.org> splitting the package
+    into `sysklogd' and `klogd' (closes:Bug#35586, Bug#72043, Bug#74864,
+    Bug#72122)
+  * Provide / depend on virtual packages system-log-daemon
+    and linux-kernel-log-daemon (closes: Bug#67604)
+  * Applied patch from Tim Janik <timj@gtk.org> to support `-s pattern' in
+    syslogd-listfiles
+  * Transition to FHS, i.e. /usr/share/doc instead of /usr/doc and
+    /usr/share/man instead of /usr/man (closes:  Bug#79250, Bug#80771)
+  * Use --exec for stopping services (closes: Bug#76757)
+  * Corrected broken character in klogd.8 (cloes: Bug#75932)
+  * Only rotate logfiles with size greater than zero.  This got lost due
+    to 1.4.0 brokennes which was packaged and removed some hours later
+    (closes: Bug#74993, Bug#49824)
+  * Added another note about modificability of cronjobs (closes:
+    Bug#88741)
+  * Since klogd replaces parts of sysklogd a proper Replaces line is there
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Sun, 11 Mar 2001 22:30:53 +0100
+
+sysklogd (1.4-1) stable unstable; urgency=medium, closes=70790 32580 49824 62358 66712 71631
+
+  * Added paragraph to binary target
+  * New upstream version (closes: Bug#70790, Bug#32580, Bug#62358,
+    Bug#71631)
+  * Only rotate logfiles that have a size greater than zero (closes:
+    Bug#49824)
+  * Test for existence of syslogd-listfiles before calling it (closes:
+    Bug#66712)
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Mon, 18 Sep 2000 16:02:05 +0200
+
+sysklogd (1.3-33) unstable; urgency=medium, closes=38977
+
+  * chmod 0640 /dev/xconsole regardless of its existence (closes: Bug#38977)
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Sun, 12 Sep 1999 20:47:53 +0200
+
+sysklogd (1.3-32) unstable; urgency=low, closes=35408 34733 36198
+
+  * Fixed typo in syslogd-listfiles (closes: Bug#35408)
+  * Removed superflous call to utmpname() (closes: Bug#34733)
+  * Added --ignore-size and limit for rotating log files at 2MB to
+    syslogd-listfiles (closes: Bug#36198)
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Sun, 23 May 1999 10:40:33 +0200
+
+sysklogd (1.3-31) frozen unstable; urgency=low, closes=28629 30093 31494 30462
+
+  * ``-m 0'' turns off -- MARK -- now. (closes: Bug#28629, Bug#31494)
+  * Changed Greg's e-mail address to represent his current one.
+  * Shortened line length for kernel logging slightly.
+  * Corrected return value of AddModule (closes: Bug#30093)
+  * Finally fixed an error with `-a' processing, thanks to Topi Miettinen
+    <tom@medialab.sonera.net> (closes: Bug#30462)
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Tue, 19 Jan 1999 23:56:07 +0100
+
+sysklogd (1.3-30) unstable; urgency=low, closes=28128 28122 24893
+
+  * Contains more patches from Topi Miettinen.
+  * Fixed two mistakes from the most recent version
+  * Fixed fd leak problem.  Thanks to Topi for detecting it
+  * Ouch!  Looks like the released package again is broken.  It worked
+    locally.
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Sun, 18 Oct 1998 20:38:22 +0200
+
+sysklogd (1.3-29) unstable; urgency=low, closes=24893
+
+  * Re-Applied patch provided vom Topi Miettinen with regard to the people
+    from OpenBSD.  This provides the additional '-a' argument used for
+    specifying additional UNIX domain sockets to listen to.  This is been
+    used with chroot()'ed named's for example.  An example is described at
+    http://www.psionic.com/papers/dns.html.  This time the patch doesn't
+    stall syslogd.  Thanks to Topi Miettinen <tom@medialab.sonera.net>
+    (closes: Bug#24893)
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Sat, 17 Oct 1998 20:23:00 +0200
+
+sysklogd (1.3-28) unstable; urgency=low
+
+  * Added manpage for syslog-facility, also written by Raphaël Hertzog 
+  * Reverted support for multiple Unix domain sockets since it caused
+    syslogd to not accept more sockets after a certain (undefinitve)
+    time.  (opens: Bug#24893)
+  * The complete code is still present, search for `Bug#24893'
+  * Commented out `-a' in the syslogd.8 manpage
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Thu, 15 Oct 1998 19:35:26 +0200
+
+sysklogd (1.3-27) frozen unstable; urgency=low, closes=21212 11917 21606 24609 25835 26015 24648 20135 23502 24893 24894
+
+  * Postinst will create files with correct file modes (closes: Bug#21212)
+  * Made /dev/xconsole mode 0640 and root.adm (closes: Bug#11917)
+  * Changed priority of exit message from LOG_ERR to LOG_INFO (closes
+    Bug#21606)
+  * The code now is compilable without SYSLOG_INET again.  Thanks to
+    Enrik Berkhan <enrik@rzstud1.akk.org>.
+  * Added support for TESTING define which will turn syslogd into
+    stdio-mode used for debugging.
+  * Reworked the initialization/fork code.  Now the parent
+    process activates a signal handler which the daughter process will
+    raise if it is initialized.  Only after that one the parent process
+    may exit.  Otherwise klogd might try to flush its log cache while
+    syslogd can't receive the messages yet. (closes: Bug#24609)
+  * Fixed typo in /etc/syslog.conf (closes: Bug#25835)
+  * Modified pre- and postinst scripts to set +e before executing external
+    scripts.  This is a workaround against a bug in bash (Bug#23857).
+    Bash exports the errexit (-e) flag if allexport (-a) has been set. The
+    bug occurs even if allexport is being _re_set.  (closes: Bug#26015)
+  * Modified ksym::CheckVersion()
+    . Use shift to decode the kernel version
+    . Compare integers of kernel version
+    . extract major.minor.patch from utsname.release via sscanf()
+    The reason lays in possible use of kernel flavours which modify
+    utsname.release but no the Version_ symbol.  (closes: Bug#20135)
+  * Corrected klogd.c in order to support the new address space for late
+    2.1 kernels.  Some support for unsigned long in contrary to int was
+    missing.  (closes: Bug#23502)
+  * Applied patch provided vom Topi Miettinen with regard to the people
+    from OpenBSD.  This provides the additional '-a' argument used for
+    specifying additional UNIX domain sockets to listen to.  This is been
+    used with chroot()'ed named's for example.  An example is described at
+    http://www.psionic.com/papers/dns.html.  Thanks to Topi Miettinen
+    <tom@medialab.sonera.net> (closes: Bug#24893)
+  * Added support for `ftp' log facility which was introduced by glibc
+    version 2.  Thanks to netgod and Flood from #Debian.
+  * Code cleanups with regard to bsd -> posix transition and stronger
+    security (buffer length checking).  Thanks to Topi Miettinen
+    <tom@medialab.sonera.net> (closes: Bug#24894)
+    . index() --> strchr()
+    . sprintf() --> snprintf()
+    . bcopy() --> memcpy()
+    . bzero() --> memset()
+    . UNAMESZ --> UT_NAMESIZE
+    . sys_errlist --> strerror()
+  * Added support for setutent()/getutent()/endutend() instead of binary
+    reading the UTMP file.  This is the the most portable way.  Thanks to
+    Topi Miettinen <tom@medialab.sonera.net>.
+  * Avoid logging of SIGCHLD when syslogd is in the process of exiting and
+    closing its files.  Again thanks to Topi.
+  * Added /usr/sbin/syslog-facility, written by Raphaël Hertzog
+    <hertzog@debian.org>.  It opens a way for other packages to add and
+    remove logfiles/facilities.
+  * Modified printline() to support 8bit characters - such as russion
+    letters.  Thanks to Vladas Lapinskas <lapinskas@mail.iae.lt>.
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Mon, 12 Oct 1998 22:24:04 +0200
+
+sysklogd (1.3-26) frozen unstable; urgency=low, closes=20903 20765 20556 20507 20647 20220
+
+  * Fixed typos in syslogd-listfiles(1), thanks to Francesco Potorti`
+    <F.Potorti@cnuce.cnr.it> (closes: Bug#20903)
+  * Corrected email address for Shane Alderton (closes: Bug#20765)
+  * Fixed manpage to not reflect reverse implementated SIGALRM signal
+    handler (closes: Bug#20647)
+  * Modified behaviour with including <sys/module.h> (closes: Bug#20556)
+  * Added correct prototype for llseek() (closes: Bug#20507, Bug#20220)
+  * Added more log information if problems occurr while reading a system
+    map file.
+  * Modified System.map read function to try all possible map files until
+    a file with matching version is found.
+  * Added Debian release to klogd
+  * Switched to fgets() as gets() is not buffer overrun secure.
+  * Modified loop for detecting the correct system map.
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Thu, 16 Apr 1998 19:28:05 +0200
+
+sysklogd (1.3-25) unstable; urgency=low, closes=19454 19145 1914
+
+  * Corrected permissions on packaging control files (closes: Bug#19414)
+  * Removed kill statements from rc file (closes: Bug#19454, Bug#19145)
+  * Applied patch from Pedro Manuel Rodrigues <pmanuel@cindy.fe.up.pt> to
+    let klogd work togther with >2GB address space.
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Thu, 19 Mar 1998 23:56:09 +0100
+
+sysklogd (1.3-24) unstable; urgency=low, closes=18124
+
+  * Fixed tiny mistake which refused the MARK facility to work properly
+    (closes: Bug#18124)
+  * Corrected Topi's patch as it prevented forwarding during startup due
+    to an unknown LogPort.
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Wed, 25 Feb 1998 13:19:27 +0100
+
+sysklogd (1.3-23) unstable; urgency=low
+
+  * Corrected FSF's address (lintian)
+  * Implemented force-reload (lintian)
+  * Standards-Version: 2.4.0.0
+  * Applied patch from Topi Miettinen <Topi.Miettinen@ml.tele.fi> to open
+    the UDP socket only if it is really needed.
+  * Updated sysklogd(8) manpage
+  * Added notes to mailing list
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Tue, 24 Feb 1998 00:39:10 +0100
+
+sysklogd (1.3-22) unstable; urgency=low, closes=17192 17385 17601
+
+  * Included a real fix to the %'s problem (fixes: Bug#17192)
+  * Another patch for Linux/alpha by Christopher C Chimelis
+    <chris@classnet.med.miami.edu> (fixes: Bug#17385)
+  * Removed killall-statement from postinst.  Thanks to James Troup for
+    reporting it.
+  * Added chdir("/") to both daemons (fixes: Bug#17601)
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Thu, 29 Jan 1998 21:56:40 +0100
+
+sysklogd (1.3-21) unstable; urgency=low, closes=17159
+
+  * Fixed small typo in syslogd-listfiles (Bug#17159)
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Thu, 15 Jan 1998 23:22:57 +0100
+
+sysklogd (1.3-20) unstable; urgency=low, closes=17000
+
+  * Corrected some code that caused klogd to dump core when receiving some
+    special messages from 2.1.78.  Thanks to Chu-yeon Park
+    <kokids@doit.ajou.ac.kr> for informing me.
+  * Fixed bug that caused klogd to die if there is no System.map
+    available.
+  * Added -x switch to omit EIP translation and System.map evaluation.
+    Thanks to Florian La Roche <florian@knorke.saar.de>
+  * Fixed small bugs in F_FORW_UNKN meachanism.  Thanks to Torsten Neumann
+    <torsten@londo.rhein-main.de> for pointing me to it.
+  * Fixed problem with klogd not being able to be built on a kernel newer
+    than 2.1.18.  Worked in a patch from Alessandro Suardi <asuardi@uninetcom.it>
+  * Fixed small typo in syslogd-listfiles
+  * Corrected debug output concerning remote receiption
+  * Removed race condition in syslogd-listfiles
+  * Modified logfile detection routine to take care of double listed
+    logfiles.  Thanks to Roman Hodek <roman@debian.org> for providing an
+    appropriate patch.  (Bug#17000)
+  
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Tue, 13 Jan 1998 01:59:56 +0100
+
+sysklogd (1.3-19) unstable; urgency=low, closes=16643 16769 16796 16828 16148 14776
+
+  * Used better regexp for detecting sensitive data.  Thanks a lot to
+    Susanne Schmidt <banshee@linux.de> for providing it.
+  * Fixed ownership of /usr/doc/sysklogd/copyright and readme (Bug#16643)
+  * Corrected Standards-Version to 2.3.0.1 (Bug#16769)
+  * Reworked one line of an older patch because it prevented syslogd from
+    binding the socket with the result that no messages were forwarded to
+    other hosts.
+  * Changed the behaviour of klogd when receiving a terminate signal. Now
+    the program terminates immediately instead of completing the receipt of
+    a kernel message.  (Bug#16796, Bug#16828, Bug#16148)
+  * Noticed a bug which was closed by 1.3-18 (Bug#14776)
+  * Changed Maintainer address to joey@debian.org
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Fri, 9 Jan 1998 00:58:36 +0100
+
+sysklogd (1.3-18) unstable; urgency=low, closes=11731 12009 13506 14329 14521 14610 15840 15336
+
+  * Added test in postinst if user and group exist.  Christoph Lameter run
+    into trouble upgrading a RedHat system.
+  * Fixed little mistake which prevented klogd from accepting a console
+    log level of 8 to get <7> alias KERN_DEBUG displayed.
+  * Linked against libc6 (Bug#11731)
+  * Added SHELL=/bin/bash to rules as Herbert Xu suggested
+  * Corrected syslog.conf(5) manpage
+  * syslogd resets the ignore priority flag now.  Thanks to Herbert
+    Thielen. (Bug#12009)
+  * Fixed bug that caused syslogd to write into wrong files under some
+    race conditions.  Thanks to Herbet Xu. (Bug#13506)
+  * /var/log/auth.log will only be touch if needed (Bug#14329)
+  * debian/conffiles is treated like a document (Bug#14521)
+  * Added script for generic logfile detection and rotation and included
+    that in cron scripts, included also its manpage (Bug#14610)
+  * Modified restart messages in /etc/init.d/sysklogd (Bug#15840)
+  * klogd will first try to load /boot/System.map-$ver, then
+    /boot/System.map, then /System.map-$ver and after that /System.map
+  * Modified ExpandKadds() because there were some problems accessing
+    memory r/w.  (Bug#15336)
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Fri, 2 Jan 1998 03:31:09 +0100
+
+sysklogd (1.3-17) unstable; urgency=low
+
+  * Fixed stupid bug which caused klogd to eat up 90% cpu time.
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Wed, 25 Jun 1997 15:22:29 +0200
+
+sysklogd (1.3-16) unstable; urgency=low
+
+  * Included Miquel's patches which allows continuation line support
+    for syslogd.  Corrected syslog.conf(5) manpage.  Improved
+    syslog.conf file.  Thanks to Miquel van Smoorenburg
+    <miquels@cistron.nl> for dropping in these patches.
+  * Added /var/log/syslog as a daily rotated logfile which contains
+    everything except auth.*
+  * ksym.c: Added #1 and #2 to some error messages in order to being able
+    to divide them (ulmo@Q.Net)
+  * Improved postinst script (Thanks to Miquel van Smorrenborg for ideas)
+  * klogd now also reads /System.map-<version> and
+    /boot/System.map-<version> (Bug#7210)
+  * syslogd,klogd: made DEBRELEASE optional to support a non-Debian
+    release as well.
+  * Corrected freeing of logfiles.
+  * Removed delay of 10 seconds. (Bug#8104, Bug#8400)
+  * Modified permissions of logfiles from 644 to 640 and 640 to 600 for
+    security aspects.
+  * Corrected syslog.conf(5) manpage (Bug#9779)
+  * Found upstream patches for 1.3.1 to 1.3.3 which are now included.
+    These also include some patches for glibc and Alpha.
+  * Included patch to modules package to support better debugging
+  * Added patch from Leland Olds which fixes a buffer overrun and improved
+    symbol lookup. (Bug#4875)
+  * Some more glibc patches made by Michael Alan Dorman
+    <mdorman@debian.org>. (Bug#8362, Bug#8763)
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Sun, 15 Jun 1997 19:37:13 +0200
+
+sysklogd (1.3-15) unstable; urgency=low
+
+  * Added /var/log/mail.log as a logfile
+  * Corrected Description field (Bug#7624)
+  * Added read statement in postinst script (Bug#8243)
+
+ -- Martin Schulze <joey@infodrom.north.de>  Wed, 26 Mar 1997 13:32:24 +0100
+
+sysklogd (1.3-14) unstable; urgency=low
+
+  * Debugging syslogd now shows facility.priority
+  * Minor fixes
+  * Modified syslogd.c to not kill itself which confuses bash 2.0
+
+ -- Martin Schulze <joey@infodrom.north.de>  Sun, 23 Feb 1997 12:23:55 +0100
+
+sysklogd (1.3-13) stable; urgency=low
+
+  * Made /etc/init.d/sysklogd more verbose
+  * Minor fixes
+  * Uncompressed copyright, but compressed /usr/doc/sysklogd-1.3.16/readme
+
+ -- Martin Schulze <joey@debian.org>  Sat, 8 Feb 1997 14:12:29 +0100
+
+sysklogd (1.3-12) stable; urgency=HIGH
+  
+  * Converted to Standards-Version 2.1.1.2
+  * init.d/sysklogd: added "sleep 1"
+  * syslogd won't hassle anymore if it can't access logfils. Patched by
+    me. This adresses Bug#5865.
+  * /etc/init.d/sysklogd: Modified so that one can use commandline
+    arguments for both syslogd and klogd.
+  * debian.rules: Installed ChangeLog
+
+ -- Martin Schulze <joey@finlandia.infodrom.north.de>  Thu, 30 Jan 1997 22:48:59 +0100
+
+Mon Now 25 10:36:01 1996  Martin Schulze  <joey@finlandia.infodrom.north.de>
+
+	* modified preinst to work if /etc/init.d/sysklogd doesn't exist
+	because of a failure
+
+Mon Sep 10 10:36:01 1996  Martin Schulze  <joey@finlandia.infodrom.north.de>
+
+	* ksyms.c: klogd will first look at /System.map (Bug#4403, #4459)
+
+Fri Aug 16 21:36:01 1996  Martin Schulze  <joey@finlandia.infodrom.north.de>
+
+	* debian.rules: Changed permissions for syslogd and klogd to 755
+	(Bug#4049)
+
+Mon Aug 12 10:40:05 1996  Martin Schulze  <joey@finlandia.infodrom.north.de>
+
+	* Corrected permissions of documentation.  Thanks to Dan
+        Quinlan. (Bug#4090)
+
+Mon Aug  5 22:47:40 1996  Martin Schulze  <joey@finlandia.infodrom.north.de>
+
+	* syslogd.c: If you haven't set your domainname, syslogd will dump
+	core upon startup.  Fixed.  Thanks to Leeland Lucius
+	<llucius@millcomm.com> for reporting and patching it. (Bug#3526)
+
+	* /etc/init.d/sysklogd, /etc/cron.weekly/sysklogd: slight
+	improvements.  Thanks to Bernd Eckenfels <ecki@tapac.inka.de>.
+
+Fri Aug  2 11:03:30 1996  Martin Schulze  <joey@finlandia.infodrom.north.de>
+
+	* modified weekly cron script, thanks to Todd Tyrone Fries <todd@miango.com>
+
+Fri Jun 14 10:42:26 1996  Martin Schulze  <joey@finlandia.infodrom.north.de>
+
+	* ksyms.c: increased the size of vstring, because since Linux
+	major versions are decoded with n * 65536 and we now have 2.0, the
+	field was too short.
+
+Tue May 28 01:02:01 1996  Martin Schulze  <joey@finlandia.infodrom.north.de>
+
+	* syslogd.c: Corrected behaviour of blocking pipes - i.e. the
+	whole system hung.  Michael Nonweiler <mrn20@hermes.cam.ac.uk> has
+	sent us a patch to correct this.  A new logfile type F_PIPE has
+	been introduced.
+
+Thu May 23 08:39:54 1996  Martin Schulze  <joey@finlandia.infodrom.north.de>
+
+	* postinst: Corrected killall-statement, Thanks to Miquel van
+	Smoorenborg for the hint
+
+Mon May 20 00:14:35 1996  Martin Schulze  <joey@finlandia.infodrom.north.de>
+
+	* postinst: added a killall to remove an existing syslogd.  It
+	could exist because of Bug#2836.
+
+Sun May 12 13:36:55 1996  Martin Schulze  <joey@finlandia.infodrom.north.de>
+
+	* removed auth.* from /dev/xconsole
+
+	* klogd won't log old messages anymore (Bug#2337)
+	I have applied the patch from Chris Hanson.
+
+	* I have put another start-stop-daemon call in the startup script
+	so the configs are reloaded on startup. This should
+	help. (Bug#2552)
+
+	* Sysklogd takes care of this and createst /dev/xconsole if it
+	doesn't exist during installation. (Bug#2683)
+
+	* I have corrected permissions of /dev/xconsole. (Bug#2837)
+
+	* defined /etc/cron.weekly/sysklogd as a conffile (Bug#2950, Bug#2960)
+
+	* introduced two binary packages: syslogd and sysklogd which
+	exclude each other
+
+Sun Apr 21 17:56:03 1996  Martin Schulze  <joey@finlandia.infodrom.north.de>
+
+	* Corrected preinst (Bug#2722, Bug#2725, Bug#2726)
+
+	* Linked against libc 5.2.18 (Bug#2723, Bug#2725)
+
+	* Corrected control file to fit with newer dpkgs
+
+Wed Apr 17 21:40:56 1996  Martin Schulze  <joey@finlandia.infodrom.north.de>
+
+	* Added Debian packaging information
+
+
--- sysklogd-1.4.1.orig/debian/conffiles
+++ sysklogd-1.4.1/debian/conffiles
@@ -0,0 +1,5 @@
+/etc/default/syslogd
+/etc/syslog.conf
+/etc/init.d/sysklogd
+/etc/cron.daily/sysklogd
+/etc/cron.weekly/sysklogd
--- sysklogd-1.4.1.orig/debian/conffiles.klogd
+++ sysklogd-1.4.1/debian/conffiles.klogd
@@ -0,0 +1,2 @@
+/etc/default/klogd
+/etc/init.d/klogd
--- sysklogd-1.4.1.orig/debian/control
+++ sysklogd-1.4.1/debian/control
@@ -0,0 +1,32 @@
+Source: sysklogd
+Section: admin
+Priority: important
+Maintainer: Martin Schulze <joey@debian.org>
+Standards-Version: 3.5.6.0
+
+Package: sysklogd
+Architecture: any
+Section: admin
+Depends: ${shlibs:Depends}, klogd | linux-kernel-log-daemon
+Conflicts: syslogd
+Provides: syslogd, system-log-daemon
+Replaces: syslogd
+Description: System Logging Daemon
+ This package implements the system log daemon, which is an enhanced
+ version of the standard Berkeley utility program. It is responsible
+ for providing logging of messages received from programs and facilities
+ on the local host as well as from remote hosts.
+
+Package: klogd
+Architecture: any
+Section: admin
+Depends: ${shlibs:Depends}, sysklogd | system-log-daemon
+Conflicts: sysklogd (<= 1.3-33)
+Provides: linux-kernel-log-daemon
+Replaces: sysklogd
+Description: Kernel Logging Daemon
+ The klogd daemon listens to kernel message sources and is responsible
+ for prioritizing and processing operating system messages.  The klogd
+ daemon can run as a client of syslogd or optionally as a standalone
+ program.  Klogd can now be used to decode EIP addresses if it can
+ determine a System.map file.
--- sysklogd-1.4.1.orig/debian/copyright
+++ sysklogd-1.4.1/debian/copyright
@@ -0,0 +1,50 @@
+This is the Debian GNU/Linux prepackaged version of Linux' system and
+kernel logging daemons.
+
+This package was put together by Martin Schulze <joey@debian.org>,
+from sources obtained from:
+
+  http://www.infodrom.org/projects/sysklogd/download/sysklogd-1.4.1.tar.gz
+
+Recent versions are Debian versions that may be also be found at
+
+  http://www.infodrom.org/projects/sysklogd/
+
+syslogd is under Berkeley copyright, klogd is under GPL.
+
+   Copyright (C) 1994-96 Greg Wettstein <greg@wind.enjellic.com>
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 dated June, 1991.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program;  if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+
+On Debian GNU/Linux systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+There is a mailing list covering this package and syslog in general.
+The lists address is infodrom-sysklogd@lists.infodrom.org .  
+
+To subscribe to this list,
+
+ . send a mail to infodrom-sysklogd-request@lists.infodrom.org with
+   the word "subscribe" as subject, or
+
+ . send a mail to majordomo@lists.infodrom.org with the body of
+   "subscribe infodrom-sysklogd".
+
+The list will be archived publically at
+<http://www.infodrom.org/Mail-Archive/infodrom-sysklogd>.
+
+The source of the Debian package is managed through CVS.  It is publically
+available at <http://cvs.infodrom.org/sysklogd/?cvsroot=debian> or as
+<:pserver:anonymous@cvs.infodrom.org/var/cvs/debian/sysklogd/>.
+
--- sysklogd-1.4.1.orig/debian/cron.daily
+++ sysklogd-1.4.1/debian/cron.daily
@@ -0,0 +1,39 @@
+#! /bin/sh
+
+# sysklogd	Cron script to rotate system log files daily.
+#
+#		If you want to rotate other logfiles daily, edit
+#		this script.  An easy way is to add files manually,
+#		to add -a (for all log files) to syslogd-listfiles and
+#		add some grep stuff, or use the -s pattern argument to
+#		specify files that must not be listed.
+#
+#		This is a configration file.  You are invited to edit
+#		it and maintain it on your own.  You'll have to do
+#		that if you don't like the default policy
+#		wrt. rotating logfiles (i.e. with large logfiles
+#		weekly and daily rotation may interfere).  If you edit
+#		this file and don't let dpkg upgrade it, you have full
+#		control over it.  Please read the manpage to
+#		syslogd-listfiles.
+#
+#		Written by Martin Schulze <joey@debian.org>.
+#		$Id: cron.daily,v 1.13 2006-09-18 09:42:30 joey Exp $
+
+test -x /usr/sbin/syslogd-listfiles || exit 0
+test -x /sbin/syslogd || exit 0
+test -f /usr/share/sysklogd/dummy || exit 0
+
+set -e
+
+cd /var/log
+for LOG in `syslogd-listfiles`
+do
+   if [ -s $LOG ]; then
+      savelog -g adm -m 640 -u root -c 7 $LOG >/dev/null
+   fi
+done
+
+# Restart syslogd
+#
+/etc/init.d/sysklogd reload-or-restart > /dev/null
--- sysklogd-1.4.1.orig/debian/cron.daily.klogd
+++ sysklogd-1.4.1/debian/cron.daily.klogd
@@ -0,0 +1,47 @@
+#! /bin/sh
+
+binpath=/sbin/klogd
+pidfile=/var/run/klogd.pid
+
+test -x $binpath || exit 0
+
+
+running()
+{
+    # No pidfile, probably no daemon present
+    #
+    if [ ! -f $pidfile ]
+    then
+	return 1
+    fi
+
+    pid=`cat $pidfile`
+
+    # No pid, probably no daemon present
+    #
+    if [ -z "$pid" ]
+    then
+	return 1
+    fi
+
+    if [ ! -d /proc/$pid ]
+    then
+	return 1
+    fi
+
+    cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1`
+
+    # No syslogd?
+    #
+    if [ "$cmd" != "$binpath" ]
+    then
+	return 1
+    fi
+
+    return 0
+}
+
+if ! running
+then
+    sh /etc/init.d/klogd start > /dev/null
+fi
--- sysklogd-1.4.1.orig/debian/cron.weekly
+++ sysklogd-1.4.1/debian/cron.weekly
@@ -0,0 +1,38 @@
+#! /bin/sh
+
+# sysklogd	Cron script to rotate system log files weekly.
+#
+#		If you want to rotate logfiles daily, edit
+#		this script and /etc/cron.daily/sysklogd to get
+#		the logfiles in sync (they must not occur in both
+#		files).
+#
+#		This is a configration file.  You are invited to edit
+#		it and maintain it on your own.  You'll have to do
+#		that if you don't like the default policy
+#		wrt. rotating logfiles (i.e. with large logfiles
+#		weekly and daily rotation may interfere).  If you edit
+#		this file and don't let dpkg upgrade it, you have full
+#		control over it.  Please read the manpage to
+#		syslogd-listfiles.
+#
+#		Written by Ian A. Murdock <imurdock@debian.org>.
+#		$Id: cron.weekly,v 1.10 2004-03-31 16:18:15 joey Exp $
+
+test -x /usr/sbin/syslogd-listfiles || exit 0
+test -x /sbin/syslogd || exit 0
+test -f /usr/share/sysklogd/dummy || exit 0
+
+set -e
+
+cd /var/log
+for LOG in `syslogd-listfiles --weekly`
+do
+   if [ -s $LOG ]; then
+      savelog -g adm -m 640 -u root -c 4 $LOG >/dev/null
+   fi
+done
+
+# Restart syslogd
+#
+/etc/init.d/sysklogd reload-or-restart > /dev/null
--- sysklogd-1.4.1.orig/debian/default
+++ sysklogd-1.4.1/debian/default
@@ -0,0 +1,13 @@
+#
+# Top configuration file for syslogd
+#
+
+#
+# Full documentation of possible arguments are found in the manpage
+# syslogd(8).
+#
+
+#
+# For remote UDP logging use SYSLOGD="-r"
+#
+SYSLOGD=""
--- sysklogd-1.4.1.orig/debian/default.klogd
+++ sysklogd-1.4.1/debian/default.klogd
@@ -0,0 +1,15 @@
+#
+# top configuration file for klogd
+#
+
+#
+# Full documentation of possible arguments are found in the manpage
+# klogd(8).
+#
+
+#
+# Use KLOGD="-k /boot/System.map-$(uname -r)" to specify System.map
+# -c 4 to alter the kernel console log level (deprecated)
+#   use sysctl instead
+#
+KLOGD="-x"
--- sysklogd-1.4.1.orig/debian/dummy
+++ sysklogd-1.4.1/debian/dummy
@@ -0,0 +1,4 @@
+Do not remove this file or your log files won't be rotated anymore.
+This is a control file to ensure that the sysklogd package is
+installed so that the cronjobs don't have to parse the dpkg database
+for each run.
--- sysklogd-1.4.1.orig/debian/postinst
+++ sysklogd-1.4.1/debian/postinst
@@ -0,0 +1,83 @@
+#! /bin/sh
+
+set -e
+
+if [ "$1" = "configure" ]
+then
+    case $2 in
+	1.2-*)
+cat<<EOT
+The default behaviour of syslogd has altered from 1.2 to 1.3.  By default
+*no* messages from the UDP port are accepted.
+
+Read the documentation in /usr/doc/sysklogd carefully.  Some important
+things have been changed!
+
+Press [Enter] to continue
+EOT
+	read xyz
+	;;
+  esac
+fi
+
+if [ "$1" = "configure" ]
+then
+
+    # Prepare for takeover of the host
+    if [ -z "$2" ]
+    then
+	if [ ! -e /var/log/news ] \
+	    && grep -q '^[^#].*/var/log/news/' /etc/syslog.conf \
+	    && grep -q ^news: /etc/passwd \
+	    && grep -q ^news: /etc/group 
+	then
+	    mkdir /var/log/news
+	    chmod 2755 /var/log/news
+	    chown news:news /var/log/news
+	fi
+
+	# Create logfiles with correct file modes
+	if [ -z "$2" ]
+	then
+	    for LOG in `syslogd-listfiles --all`
+	    do
+	      if [ ! -f $LOG ]
+	      then
+		  touch $LOG
+	      fi
+	      chown root:adm $LOG
+	      chmod 640 $LOG
+	    done
+	fi
+    fi
+
+    if [ -f /etc/init.d/sysklogd -a -n "$2" ]
+    then
+	set +e
+	if [ -x /usr/sbin/invoke-rc.d ]
+	then
+	    invoke-rc.d sysklogd stop
+	else
+	    sh /etc/init.d/sysklogd stop
+	fi
+	set -e
+    fi
+
+    update-rc.d sysklogd defaults 10 90 >/dev/null
+
+    # restarting daemon
+    #
+    if [ -f /etc/init.d/sysklogd ]
+    then
+	set +e
+	if [ -x /usr/sbin/invoke-rc.d ]
+	then
+	    invoke-rc.d sysklogd start
+	else
+	    sh /etc/init.d/sysklogd start
+	fi
+	set -e
+    fi
+fi
+
+exit 0
--- sysklogd-1.4.1.orig/debian/postinst.klogd
+++ sysklogd-1.4.1/debian/postinst.klogd
@@ -0,0 +1,36 @@
+#! /bin/sh
+
+set -e
+
+if [ "$1" = "configure" ]
+then
+    if [ -f /etc/init.d/klogd -a -n "$2" ]
+    then
+	set +e
+	if [ -x /usr/sbin/invoke-rc.d ]
+	then
+	    invoke-rc.d klogd stop
+	else
+	    sh /etc/init.d/klogd stop
+	fi
+	set -e
+    fi
+
+    update-rc.d klogd defaults 11 89 >/dev/null
+
+    # restarting daemon
+    #
+    if [ -f /etc/init.d/klogd ]
+    then
+	set +e
+	if [ -x /usr/sbin/invoke-rc.d ]
+	then
+	    invoke-rc.d klogd start
+	else
+	    sh /etc/init.d/klogd start
+	fi
+	set -e
+    fi
+fi
+
+exit 0
--- sysklogd-1.4.1.orig/debian/postrm
+++ sysklogd-1.4.1/debian/postrm
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+set -e
+
+if [ "$1" = "purge" ]
+then
+    update-rc.d sysklogd remove >/dev/null
+fi
--- sysklogd-1.4.1.orig/debian/postrm.klogd
+++ sysklogd-1.4.1/debian/postrm.klogd
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+set -e
+
+if [ "$1" = "purge" ]
+then
+  update-rc.d klogd remove >/dev/null
+fi
--- sysklogd-1.4.1.orig/debian/preinst
+++ sysklogd-1.4.1/debian/preinst
@@ -0,0 +1,21 @@
+#! /bin/sh
+
+set -e
+
+dpkg --assert-support-predepends
+
+if [ "$1" = "upgrade" -a -f /etc/init.d/sysklogd ]; then
+    if [ -f /etc/init.d/sysklogd ]
+    then
+	set +e
+	if [ -x /usr/sbin/invoke-rc.d ]
+	then
+	    invoke-rc.d sysklogd stop
+	else
+	    sh /etc/init.d/sysklogd stop
+	fi
+	set -e
+    fi
+fi
+
+exit 0
--- sysklogd-1.4.1.orig/debian/preinst.klogd
+++ sysklogd-1.4.1/debian/preinst.klogd
@@ -0,0 +1,21 @@
+#! /bin/sh
+
+set -e
+
+dpkg --assert-support-predepends
+
+if [ "$1" = "upgrade" -a -f /etc/init.d/klogd ]; then
+    if [ -f /etc/init.d/klogd ]
+    then
+	set +e
+	if [ -x /usr/sbin/invoke-rc.d ]
+	then
+	    invoke-rc.d klogd stop
+	else
+	    sh /etc/init.d/klogd stop
+	fi
+	set -e
+    fi
+fi
+
+exit 0
--- sysklogd-1.4.1.orig/debian/prerm
+++ sysklogd-1.4.1/debian/prerm
@@ -0,0 +1,19 @@
+#! /bin/sh
+
+set -e
+
+if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/sysklogd ]
+then
+    rm -f /usr/doc/sysklogd
+fi
+
+if [ "$1" = "purge"  -o "$1" = "remove" ]
+then
+    if [ -x /usr/sbin/invoke-rc.d ]
+    then
+	invoke-rc.d sysklogd stop
+    else
+	sh /etc/init.d/sysklogd stop
+    fi
+fi
+
--- sysklogd-1.4.1.orig/debian/prerm.klogd
+++ sysklogd-1.4.1/debian/prerm.klogd
@@ -0,0 +1,19 @@
+#! /bin/sh
+
+set -e
+
+if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/klogd ]
+then
+    rm -f /usr/doc/klogd
+fi
+
+if [ "$1" = "purge"  -o "$1" = "remove" ]
+then
+    if [ -x /usr/sbin/invoke-rc.d ]
+    then
+	invoke-rc.d klogd stop
+    else
+	sh /etc/init.d/klogd stop
+    fi
+fi
+
--- sysklogd-1.4.1.orig/debian/rc
+++ sysklogd-1.4.1/debian/rc
@@ -0,0 +1,112 @@
+#! /bin/sh
+# /etc/init.d/sysklogd: start the system log daemon.
+
+### BEGIN INIT INFO
+# Provides:             syslog
+# Required-Start:       $local_fs $network $time
+# Required-Stop:        $local_fs $network $time
+# Default-Start:        2 3 4 5
+# Default-Stop:         S 0 1 6
+# Short-Description:    System logger
+### END INIT INFO
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+pidfile=/var/run/syslogd.pid
+binpath=/sbin/syslogd
+
+test -x $binpath || exit 0
+
+test ! -r /etc/default/syslogd || . /etc/default/syslogd
+
+. /lib/lsb/init-functions
+
+create_xconsole()
+{
+    # Only proceed if not using devfsd
+    if [ -e /dev/.devfsd ] \
+	|| ! grep -q '^[^#].*/dev/xconsole' /etc/syslog.conf
+    then
+	return
+    fi
+
+    if [ ! -e /dev/xconsole ]; then
+	mknod -m 640 /dev/xconsole p
+    else
+	chmod 0640 /dev/xconsole
+    fi
+    chown root:adm /dev/xconsole
+}
+
+running()
+{
+    # No pidfile, probably no daemon present
+    #
+    if [ ! -f $pidfile ]
+    then
+	return 1
+    fi
+
+    pid=`cat $pidfile`
+
+    # No pid, probably no daemon present
+    #
+    if [ -z "$pid" ]
+    then
+	return 1
+    fi
+
+    if [ ! -d /proc/$pid ]
+    then
+	return 1
+    fi
+
+    cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1`
+
+    # No syslogd?
+    #
+    if [ "$cmd" != "$binpath" ]
+    then
+	return 1
+    fi
+
+    return 0
+}
+
+case "$1" in
+  start)
+    log_begin_msg "Starting system log daemon..."
+    create_xconsole
+    start-stop-daemon --start --quiet --pidfile $pidfile --name syslogd --startas $binpath -- $SYSLOGD
+    log_end_msg $?
+    ;;
+  stop)
+    log_begin_msg "Stopping system log daemon..."
+    start-stop-daemon --stop --quiet --pidfile $pidfile --name syslogd
+    log_end_msg $?
+    ;;
+  reload|force-reload)
+    log_begin_msg "Reloading system log daemon..."
+    start-stop-daemon --stop --quiet --signal 1 --pidfile $pidfile --name syslogd
+    log_end_msg $?
+    ;;
+  restart)
+    log_begin_msg "Restarting system log daemon..."
+    start-stop-daemon --stop --retry 5 --quiet --pidfile $pidfile --name syslogd
+    start-stop-daemon --start --quiet --pidfile $pidfile --name syslogd --startas $binpath -- $SYSLOGD
+    log_end_msg $?
+    ;;
+  reload-or-restart)
+    if running
+    then
+	$0 reload
+    else
+	$0 start
+    fi
+    ;;
+  *)
+    echo "Usage: /etc/init.d/sysklogd {start|stop|reload|restart|force-reload|reload-or-restart}"
+    exit 1
+esac
+
+exit 0
--- sysklogd-1.4.1.orig/debian/rc.klogd
+++ sysklogd-1.4.1/debian/rc.klogd
@@ -0,0 +1,46 @@
+#! /bin/sh
+# /etc/init.d/klogd: start the kernel log daemon.
+
+### BEGIN INIT INFO
+# Provides:             klogd
+# Required-Start:       $time syslog
+# Required-Stop:        $time syslog
+# Default-Start:        2 3 4 5
+# Default-Stop:         S 0 1 6
+# Short-Description:    kernel logger
+### END INIT INFO
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+pidfile=/var/run/klogd.pid
+binpath=/sbin/klogd
+
+test -f $binpath || exit 0
+
+test ! -r /etc/default/klogd || . /etc/default/klogd
+
+. /lib/lsb/init-functions
+
+case "$1" in
+  start)
+    log_begin_msg "Starting kernel log daemon..."
+    start-stop-daemon --start --quiet --pidfile $pidfile --name klogd --startas $binpath -- $KLOGD
+    log_end_msg $?
+    ;;
+  stop)
+    log_begin_msg "Stopping kernel log daemon..."
+    start-stop-daemon --stop --retry TERM/1/TERM/1/TERM/4/KILL --quiet --pidfile $pidfile --name klogd
+    log_end_msg $?
+    ;;
+  restart|force-reload)
+    log_begin_msg "Reloading kernel log daemon..."
+    start-stop-daemon --stop --retry TERM/1/TERM/1/TERM/4/KILL --quiet --pidfile $pidfile --name klogd
+    start-stop-daemon --start --quiet --pidfile $pidfile --name klogd --startas $binpath -- $KLOGD
+    log_end_msg $?
+    ;;
+  *)
+    echo "Usage: /etc/init.d/klogd {start|stop|restart|force-reload}"
+    exit 1
+esac
+
+exit 0
--- sysklogd-1.4.1.orig/debian/readme
+++ sysklogd-1.4.1/debian/readme
@@ -0,0 +1,44 @@
+
+Additional information about system logging
+-------------------------------------------
+
+ . When logging into a fifo syslogd will stop loggin into this
+   logfile if no process is reading it and thus the buffer is filled
+   up.  Buffer size can be adjusted through the kernel.
+
+ . When using the Perl5 Sys::Syslog module (use Sys::Syslog;) to
+   provide logging to your Perl programs, please notice that since it
+   will open a UDP connection to the local syslogd you'll need to have
+   remote receiption enabled.
+
+   Joey Hess teaches us how to change this behaviour and switch to
+   using the Unix domain socket.  After the opening with "use" you
+   have to add "Sys::Syslog::setlogsock('unix');".
+
+   The default behaviour might change in future releases of Perl.
+
+Modifying the kernel console log level
+--------------------------------------
+
+  There are two ways to alter the kernel console log level.  This
+  setting controls whether log messages from the kernel should appear
+  on the system console or not.
+
+  In the past, klogd had to do this with the -c parameter.  Using '-c
+  4' will set the log level of console messages to 4 and only display
+  warnings and errors but not regular debug or information messages.
+
+  This behaviour is deprecated and hencely not enforced anymore via
+  the RC script of klogd.  Instead sysctl(8) should be used as
+  interface to various kernel variables.  These can be stored
+  non-volatile in /etc/sysctl.conf.
+
+  The prevent the kernel to flood the system console and to achieve
+  the same behaviour of '-c 4' simply add the following to the
+  configuration file and let sysctl set this kernel parameter upon
+  system boot.
+
+  kernel/printk = 4 4 1 7
+
+  More information can be found in Documentation/sysctl/kernel.txt in
+  the kernel source and proc(5).
--- sysklogd-1.4.1.orig/debian/rules
+++ sysklogd-1.4.1/debian/rules
@@ -0,0 +1,172 @@
+#! /usr/bin/make -f
+
+#   Copyright 1994-98,2001   joey@infodrom.org (Martin Schulze)
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; version 2 dated June, 1991.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program;  if not, write to the Free Software
+#   Foundation Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+#
+SHELL=/bin/bash
+
+# The name and version of the source
+#
+source = $(shell grep "^Source: " debian/control|head -n 1|sed 's/Source: \(.*\)/\1/g')
+package = $(shell grep "^Package: " debian/control|head -n 1|sed 's/Package: \(.*\)/\1/g')
+version = $(shell grep "^$(source) " debian/changelog|head -n 1 |sed 's/.*(\(.*\)\-[^\-]*).*/\1/g')
+revision = $(shell grep "^$(source) " debian/changelog|head -n 1 |sed 's/.*([^\-]*\-\(.*\)).*/\1/g')
+
+installbin = install -g root -o root -m 755
+installdoc = install -g root -o root -m 644
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+CFLAGS = -g -O2 -Wall $(shell getconf LFS_CFLAGS)
+else
+CFLAGS = -O2 -Wall $(shell getconf LFS_CFLAGS)
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+STRIP = -s
+endif
+
+build:
+	$(MAKE) DEB="-DDEBRELEASE=\\\"$(revision)\\\"" \
+		CFLAGS="$(CFLAGS) -DSYSV -fomit-frame-pointer -fno-strength-reduce" \
+		LDFLAGS=""
+	pod2man --section=8 --lax --center="Debian GNU/Linux" \
+	  --release="Debian Project" debian/syslog-facility.pod \
+	  > syslog-facility.8
+	(cat README.linux; printf "\n\n"; cat README.1st; \
+	  printf "\n\nThe following important changes have been reported by the developers:\n\n"; \
+	  cat NEWS debian/readme) \
+	  > readme.txt
+	(cat debian/copyright; \
+	  printf "Syslogd stays under the following copyright:\n\n"; \
+	    sed -e '/^$$/,$$d' < syslogd.c; \
+	  printf "\nKlogd has the following copyright notice:\n\n"; \
+	    sed -e '/^$$/,$$d' < klogd.c ) \
+	  > copyright
+	touch stamp-build
+
+clean: debclean
+	rm -f stamp-build
+	$(MAKE) clobber
+	rm -rf *~ debian/*~ syslog-facility.8 readme.txt copyright
+
+debclean:
+# Cleans debian binary directories to allow binary creation
+	rm -rf debian/tmp.sysklogd debian/tmp.klogd
+	rm -f debian/{files,substvars}
+
+binary-indep:
+# Nothing to be done here
+
+binary-arch-sysklogd: debclean
+	test -f stamp-build || $(MAKE) -f debian/rules build
+	$(installbin) -d debian/tmp.sysklogd/DEBIAN
+	chown -R root:root debian/tmp.sysklogd
+	chmod -R g-ws debian/tmp.sysklogd
+	$(installbin) -d debian/tmp.sysklogd/usr/share/doc/$(package)
+	$(installbin) debian/{postinst,postrm,prerm} debian/tmp.sysklogd/DEBIAN/
+	$(installdoc) debian/conffiles debian/tmp.sysklogd/DEBIAN/
+	$(installdoc) debian/changelog debian/tmp.sysklogd/usr/share/doc/$(package)/changelog.Debian
+	#
+	$(installbin) -d debian/tmp.sysklogd/usr/share/$(package)
+	$(installdoc) debian/dummy debian/tmp.sysklogd/usr/share/$(package)
+	#
+	$(installdoc) copyright debian/tmp.sysklogd/usr/share/doc/$(package)/
+	$(installdoc) readme.txt debian/tmp.sysklogd/usr/share/doc/$(package)/
+	$(installdoc) CHANGES debian/tmp.sysklogd/usr/share/doc/$(package)/changelog
+	gzip -9f debian/tmp.sysklogd/usr/share/doc/$(package)/{changelog.Debian,changelog,readme.txt}
+	#
+	$(installbin) -d debian/tmp.sysklogd/{usr/,}sbin
+	$(installbin) $(STRIP) syslogd debian/tmp.sysklogd/sbin
+	$(installbin) debian/syslogd-listfiles debian/tmp.sysklogd/usr/sbin
+	$(installbin) debian/syslog-facility debian/tmp.sysklogd/usr/sbin
+	#
+	$(installbin) -d debian/tmp.sysklogd/etc/{init.d,cron.{daily,weekly},default}
+	$(installbin) debian/default debian/tmp.sysklogd/etc/default/syslogd
+	$(installbin) debian/rc debian/tmp.sysklogd/etc/init.d/sysklogd
+	$(installbin) debian/cron.weekly debian/tmp.sysklogd/etc/cron.weekly/sysklogd
+	$(installbin) debian/cron.daily debian/tmp.sysklogd/etc/cron.daily/sysklogd
+	$(installdoc) debian/syslog.conf debian/tmp.sysklogd/etc/syslog.conf
+	$(installbin) -d debian/tmp.sysklogd/var/log
+	#
+	$(installbin) -d debian/tmp.sysklogd/usr/share/man/man{5,8}
+	$(installdoc) syslog.conf.5 debian/tmp.sysklogd/usr/share/man/man5
+	$(installdoc) {sysklogd,syslogd,debian/syslogd-listfiles}.8 debian/tmp.sysklogd/usr/share/man/man8
+	$(installdoc) syslog-facility.8 debian/tmp.sysklogd/usr/share/man/man8
+	gzip -9 debian/tmp.sysklogd/usr/share/man/man?/*
+	#
+	dpkg-shlibdeps debian/tmp.sysklogd/sbin/syslogd
+	dpkg-gencontrol -psysklogd -Pdebian/tmp.sysklogd -isp
+	dpkg --build debian/tmp.sysklogd ..
+
+binary-arch-klogd: debclean
+	test -f stamp-build || $(MAKE) -f debian/rules build
+	$(installbin) -d debian/tmp.klogd/DEBIAN
+	chown -R root:root debian/tmp.klogd
+	chmod -R g-ws debian/tmp.klogd
+	$(installbin) -d debian/tmp.klogd/usr/share/doc/klogd
+	$(installbin) debian/postinst.klogd debian/tmp.klogd/DEBIAN/postinst
+	$(installbin) debian/postrm.klogd debian/tmp.klogd/DEBIAN/postrm
+	$(installbin) debian/prerm.klogd debian/tmp.klogd/DEBIAN/prerm
+	$(installdoc) debian/conffiles.klogd debian/tmp.klogd/DEBIAN/conffiles
+	$(installdoc) debian/changelog debian/tmp.klogd/usr/share/doc/klogd/changelog.Debian
+	#
+	$(installdoc) copyright debian/tmp.klogd/usr/share/doc/klogd/
+	$(installdoc) readme.txt debian/tmp.klogd/usr/share/doc/klogd/
+	$(installdoc) CHANGES debian/tmp.klogd/usr/share/doc/klogd/changelog
+	gzip -9f debian/tmp.klogd/usr/share/doc/klogd/{changelog.Debian,changelog,readme.txt}
+	$(installdoc) modutils.patch debian/tmp.klogd/usr/share/doc/klogd
+	#
+	$(installbin) -d debian/tmp.klogd/sbin
+	$(installbin) $(STRIP) klogd debian/tmp.klogd/sbin
+	#
+	$(installbin) -d debian/tmp.klogd/etc/{init.d,default}
+	$(installbin) debian/default.klogd debian/tmp.klogd/etc/default/klogd
+	$(installbin) debian/rc.klogd debian/tmp.klogd/etc/init.d/klogd
+	#
+	$(installbin) -d debian/tmp.klogd/usr/share/man/man8
+	$(installdoc) klogd.8 debian/tmp.klogd/usr/share/man/man8
+	gzip -9 debian/tmp.klogd/usr/share/man/man?/*
+	#
+	dpkg-shlibdeps debian/tmp.klogd/sbin/klogd
+	dpkg-gencontrol -pklogd -Pdebian/tmp.klogd -isp
+	dpkg --build debian/tmp.klogd ..
+
+binary-arch: binary-arch-sysklogd binary-arch-klogd
+
+binary: binary-indep binary-arch
+
+source diff:
+	@echo >&2 'source and diff are obsolete - use dpkg-source -b' or dsc; false
+
+dsc:
+	-test -d debian/tmp.sysklogd -o -d debian/tmp.klogd \
+		&& $(MAKE) -f debian/rules clean
+	if [ ! -f ../$(source)_$(version).orig.tar.gz -a -f ../orig/$(source)_$(version).orig.tar.gz ]; \
+	then \
+	  ln -s orig/$(source)_$(version).orig.tar.gz ../$(source)_$(version).orig.tar.gz; \
+	  touch /tmp/stamp-$(source)-link; \
+	fi; \
+	cd .. && dpkg-source -b $(source)-$(version)
+	if [ -f /tmp/stamp-$(source)-link ]; then \
+	  rm ../$(source)_$(version).orig.tar.gz /tmp/stamp-$(source)-link; \
+	fi
+
+checkroot:
+	$(checkdir)
+	test root = "`whoami`"
+
+dist: binary dsc
+
+.PHONY: binary binary-arch binary-indep clean checkroot
+
--- sysklogd-1.4.1.orig/debian/syslog-facility
+++ sysklogd-1.4.1/debian/syslog-facility
@@ -0,0 +1,140 @@
+#! /usr/bin/perl -w
+
+# Copyright 1998 Hertzog Raphaël
+# You can use this script under the term of the GPL v2 or later.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+
+my $conf_file = '/etc/syslog.conf';
+
+## BUGS :
+#  . This script doesn't know about multi-lines configuration (ie with '\')
+#  . With a line like that "mail,local0.* /anything" 
+#    "syslog-facility remove local0" would remove the entire line
+#    => should not be a problem since lines installed by this script
+#    cannot use such syntax
+##
+
+## Nothing to modify after this line ##
+
+my $command = lc(shift);
+
+usage() if ($command !~ /^(?:set|remove)$/); 
+usage() if (not scalar(@ARGV));
+
+if ($command eq "set")
+{
+    usage() if (int(scalar(@ARGV) / 2) != scalar(@ARGV) / 2);
+    # find a free localx facility
+    my $facility = get_first_free_facility();
+    # if none stop immediately
+    if ($facility eq "none") {
+	print "none\n";
+	exit 1;
+    }
+    # ok append the lines asked
+    open (CONF, ">>$conf_file") || 
+        die "Can't open $conf_file in write mode: $!\n";
+    my ($pri,$file,$line);
+    while (defined($pri = shift)) {
+	$file = shift;
+	$line = "";
+	foreach (split(/;/,$pri)) {
+	    $_ =~ s/all/*/g;
+	    $line .= ";" if ($line);
+	    $line .= "$facility.$_";
+	}
+	$line .= "\t\t$file\n";
+	print CONF $line;
+    }
+    close CONF;
+    print "$facility\n";
+    exit 0;
+
+} elsif ($command eq "remove") {
+
+    my $facility = lc(shift);
+    my ($left,$file,$line);
+    open (CONF, $conf_file) || die "Can't open $conf_file: $!\n";
+    open (CONFNEW, ">$conf_file.new")  || 
+	die "Can't open $conf_file.new in write mode: $!\n";
+    while (defined($_=<CONF>)) {
+	# Write all "simple" lines like empty lines and comments
+	if (/^\s*$/ or /^\s*#/ or /\\$/) {
+	    print CONFNEW $_;
+	    next;
+	}
+	# Otherwise look if the facility to remove appears in the line
+	if (/^\s*(\S+)\s+(\S+)\s*/) {
+	    $left = $1; $file = $2; chomp $file;
+	    # It doesn't appers => write
+	    if ($left !~ /$facility/i) {
+		print CONFNEW $_;
+		next;
+	    }
+	    # It appears => write a new line without the localx facility
+	    $line = "";
+	    foreach (split(/;/,$left)) {
+		if (not /$facility/i) {
+		    $line .= ";" if ($line);
+		    $line .= $_;
+		}
+	    }
+	    next if ($line eq "");
+	    $line .= "\t\t$file\n";
+	    print CONFNEW $line;
+	}
+    }
+    close CONFNEW;
+    close CONF;
+    rename ("$conf_file.new", "$conf_file");
+}
+
+sub get_first_free_facility {
+
+    my @facility = (0) x 8;
+    my ($left,$fac);
+    open(CONF, $conf_file) || die "Can't open $conf_file: $!\n";
+    while(defined($_=<CONF>))
+    {
+	next if (/^\s*$/);
+	next if (/^\s*#/);
+        next if (/\\$/);
+	next if (not /^\s*(\S+)\s+(\S+)\s*$/);
+	$left = $1;
+	foreach $fac (split(/;/,$left)) {
+	    $facility[$1]++ if ($fac =~ /local(\d)/i);
+	}
+    }
+    foreach $fac (0..7)	{
+	return "local$fac" if ($facility[$fac] == 0);
+    }
+    return "none";
+}
+
+sub usage {
+
+    die  "syslog-facility - Copyright (c) 1998 Hertzog Raphaël\n"
+	."Usage : $0 set <set_of_priority> <logfile> ... \n"
+	."        it returns the 'LOCALx' string you have the right to use.\n"
+	."        $0 remove <facility>\n"
+	."Example: $0 set all /var/log/all\n"
+	."         $0 set all\\;\\!=info /var/log/all-without-info\n"
+	."         $0 set =err /var/log/errors =warning /var/log/warn\n"
+	."         $0 remove LOCAL1\n";   
+}
+
+
+
--- sysklogd-1.4.1.orig/debian/syslog-facility.pod
+++ sysklogd-1.4.1/debian/syslog-facility.pod
@@ -0,0 +1,58 @@
+=head1 NAME
+
+syslog-facility - Setup and remove LOCALx facility for sysklogd
+
+=head1 SYNOPSIS
+
+B<syslog-facility> B<set> I<set_of_priority> I<log_file>  ...
+
+B<syslog-facility> B<remove> I<facility>
+
+=head1 DESCRIPTION
+
+B<syslog-facility> can be used to setup a syslog facility and to remove
+it. The primary use of this perl script is to allow packages to
+automatically setup (and remove) a LOCALx facility. With the
+first argument beeing I<set>, it will output a string containing
+the first free LOCALx facility that has been assigned to your request :
+
+  # syslog-facility set all /var/log/sympa
+  local0
+
+This does mean that a line "local0.*	/var/log/sympa" has been
+added to the syslog.conf file. If no free LOCALx facility has been
+found, then it outputs "none" (with a end of line).
+
+You can use different set of priorities (most of what syslogd supports) :
+
+  # syslog-facility set 'all;!=debug;' /var/log/sympa '=debug' /var/log/sympa-d
+  local1
+
+Pay particular attention to shell escapes since ';','!' have special
+meanings for them. The syntax is similar to syslog.conf except that
+'*' must be replaced by 'all'.
+
+In that case you will have two lines added two the syslog.conf file :
+
+  local1.*;local1.!=debug	/var/log/sympa
+  local1.=debug			/var/log/sympa-d
+
+If the first argument is I<remove>, then it will remove all references
+to a precise LOCALx facility. Example :
+
+  # syslog-facility remove local1
+
+It will remove all references to the local1 facility. 
+
+=head1 BUGS
+
+The script doesn't know about multi-lines configuration (ie with '\').
+
+With a line like that "mail,local0.* /anything", "syslog-facility remove
+local0" would remove the entire line. It should not be a problem since
+lines installed by this script cannot use this syntax.
+
+=head1 SEE ALSO
+
+B<syslog.conf>(5), B<sysklogd>(8).
+ 
--- sysklogd-1.4.1.orig/debian/syslog.conf
+++ sysklogd-1.4.1/debian/syslog.conf
@@ -0,0 +1,71 @@
+#  /etc/syslog.conf	Configuration file for syslogd.
+#
+#			For more information see syslog.conf(5)
+#			manpage.
+
+#
+# First some standard logfiles.  Log by facility.
+#
+
+auth,authpriv.*			/var/log/auth.log
+*.*;auth,authpriv.none		-/var/log/syslog
+#cron.*				/var/log/cron.log
+daemon.*			-/var/log/daemon.log
+kern.*				-/var/log/kern.log
+lpr.*				-/var/log/lpr.log
+mail.*				-/var/log/mail.log
+user.*				-/var/log/user.log
+uucp.*				/var/log/uucp.log
+
+#
+# Logging for the mail system.  Split it up so that
+# it is easy to write scripts to parse these files.
+#
+mail.info			-/var/log/mail.info
+mail.warn			-/var/log/mail.warn
+mail.err			/var/log/mail.err
+
+# Logging for INN news system
+#
+news.crit			/var/log/news/news.crit
+news.err			/var/log/news/news.err
+news.notice			-/var/log/news/news.notice
+
+#
+# Some `catch-all' logfiles.
+#
+*.=debug;\
+	auth,authpriv.none;\
+	news.none;mail.none	-/var/log/debug
+*.=info;*.=notice;*.=warn;\
+	auth,authpriv.none;\
+	cron,daemon.none;\
+	mail,news.none		-/var/log/messages
+
+#
+# Emergencies are sent to everybody logged in.
+#
+*.emerg				*
+
+#
+# I like to have messages displayed on the console, but only on a virtual
+# console I usually leave idle.
+#
+#daemon,mail.*;\
+#	news.=crit;news.=err;news.=notice;\
+#	*.=debug;*.=info;\
+#	*.=notice;*.=warn	/dev/tty8
+
+# The named pipe /dev/xconsole is for the `xconsole' utility.  To use it,
+# you must invoke `xconsole' with the `-file' option:
+# 
+#    $ xconsole -file /dev/xconsole [...]
+#
+# NOTE: adjust the list below, or you'll go crazy if you have a reasonably
+#      busy site..
+#
+daemon.*;mail.*;\
+	news.crit;news.err;news.notice;\
+	*.=debug;*.=info;\
+	*.=notice;*.=warn	|/dev/xconsole
+
--- sysklogd-1.4.1.orig/debian/syslogd-listfiles
+++ sysklogd-1.4.1/debian/syslogd-listfiles
@@ -0,0 +1,146 @@
+#! /usr/bin/perl
+
+# Copyright (c) 1998,9,2001,3 by Martin Schulze <joey@infodrom.org>
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+
+$conf = "/etc/syslog.conf";
+$opt_daily = 1;
+$opt_all = 0;
+$opt_auth = 0;
+$opt_ign_size = 0;
+$opt_news = 0;
+$opt_skip = '';
+$opt_large = 1024*1024;
+
+sub usage
+{
+    print STDERR
+"
+Debian GNU/Linux syslogd-listfiles.  Copyright (c) 1997,2001
+Martin Schulze.  This is free software; see the GNU General Public Licence
+version 2 or later for copying conditions.  There is NO warranty.
+
+Usage: syslogd-listfiles <options>
+Options: -f file	specifies another syslog.conf file
+         -a | --all	list all files (including news)
+         --auth		list all files containing auth.<some prio>
+	 --ignore-size  don't rotate files which got too large
+         --large nnn	define what is large in bytes (default: 10MB)
+         --news		include news logfiles, too
+         -w | --weekly	use weekly pattern instead of daily
+         -s pattern	skip files matching pattern
+";
+}
+
+# Test if the file was already rotated within the last n hours
+# with n=5
+#
+sub rotated
+{
+    my $file = shift;
+    my $nfile;
+    my $delta = 5 * 60 * 60;
+    my $now = time();
+    
+    # /var/log/file -> /var/log/file.0
+    $nfile = $file . ".0";
+    if (-r $nfile) {
+	if (($now - (stat $nfile)[9]) > $delta) {
+	    return 0;
+	} else {
+	    return 1;
+	}
+    }
+
+    # /var/log/file -> /var/log/OLD/file.0
+    $nfile =~ s,(.*)/([^/]+),$1/OLD/$2,;
+    if (-r $nfile) {
+	if (($now - (stat $nfile)[9]) > $delta) {
+	    return 0;
+	} else {
+	    return 1;
+	}
+    }
+
+    return 0;
+}
+
+while (@ARGV) {
+    $_=shift(@ARGV);
+    if (m/^-f$/) {
+	$conf = shift(@ARGV);
+    } elsif (m/^-s$/) {
+	$opt_skip = shift(@ARGV);
+    } elsif (m/^--large$/) {
+	$opt_large = shift(@ARGV);
+    } elsif (m/^(--weekly|-w)$/) {
+	$opt_daily = 0;
+    } elsif (m/^(-a|--all)$/) {
+	$opt_all = 1;
+    } elsif (m/^--auth$/) {
+	$opt_auth = 1;
+    } elsif (m/^--ignore-size/) {
+	$opt_ign_size = 1;
+    } elsif (m/^--news$/) {
+	$opt_news = 1;
+    } else {
+	&usage();exit (0);
+    }
+}
+
+open (C, $conf) || die "Can't open $conf, $!";
+while (<C>) {
+    next if (/^(\#|$)/);
+    chomp;
+
+    s/\s*(\S.*)$/$1/ if ($line);
+
+    $line .= $_;
+    chop ($line) if (/\\$/);
+    if (!/\\$/) {
+	$line =~ s/\s+/\t/;
+	$line =~ s/\t-/\t/;
+	push (@lines, $line) if ($line =~ /\t\/(?!dev\/)/);
+	$line = "";
+    }
+}
+close (C);
+
+foreach $line (@lines) {
+    ($pat,$file) = split (/\t/,$line);
+
+    # These files are handled by news.daily from INN, so we ignore them
+    next if (!$opt_news && ($pat =~ /news\.(\*|crit|err|info|notice)/));
+
+    if ($opt_all) {
+	$output{$file} = 1;
+    } elsif ($opt_auth) {
+	$output{$file} = 1 if ($pat =~ /auth[^\.]*\.(?!none).*/);
+    } else {
+	$everything = ($pat =~ /\*\.\*/);
+	$output{$file} = 1 if (($everything && $opt_daily)
+			       || (!$everything && !$opt_daily && !rotated ($file))
+			       || (!$opt_ign_size && ((stat $file)[7] >= $opt_large) && $opt_daily)
+			       );
+    }
+}
+
+foreach $file (keys (%output)) {
+    $skip = $file;
+    if (!length($opt_skip) ||  $skip !~ /$opt_skip/) {
+	printf "%s\n", $file;
+    }
+}
--- sysklogd-1.4.1.orig/debian/syslogd-listfiles.8
+++ sysklogd-1.4.1/debian/syslogd-listfiles.8
@@ -0,0 +1,95 @@
+.\" syslogd-listfiles.8 - generic routine for /etc/syslog.conf
+.\" Copyright (c) 1997,8,2001  Martin Schulze <joey@debian.org>
+.\" 
+.\" This program is free software; you can redistribute it and/or modify
+.\" it under the terms of the GNU General Public License as published by
+.\" the Free Software Foundation; either version 2 of the License, or
+.\" (at your option) any later version.
+.\" 
+.\" This program is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+.\" GNU General Public License for more details.
+.\" 
+.\" You should have received a copy of the GNU General Public License
+.\" along with this program; if not, write to the Free Software
+.\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+.\"
+.TH SYSLOGD-LISTFILES 8 "December 5th, 2001" "Debian Project" "Debian GNU/Linux"
+.SH NAME
+syslogd-listfiles \- list system logfiles
+.SH SYNOPSIS
+.B syslogd-listfiles
+.RB [ " \-a " | " \-\-all " ]
+.RB [ " \-\-auth " ] 
+.RB [ " \-f "
+.I config file
+]
+.RB [ " \-s "
+.I pattern
+]
+.RB [ " \-\-large "
+.I nnn
+]
+.RB [ " \-\-news " ]
+.RB [ " \-w " | " \-\-weekly " ]
+.SH DESCRIPTION
+.B Sysklogd
+provides a modern mechanism to log system messages.  This mechanism is
+controlled by the file
+.IR /etc/syslog.conf .
+Messages are divided into logfiles which can grow quite big.
+Therefore the logfiles need to be rotated once per day, per week or
+per month.  On a Debian GNU/Linux system most of the files are rotated
+once per week.
+
+This program helps the rotation script to determine which logfiles
+need to be rotated and when.  It takes care of news logfiles that are
+handled by the
+.B news.daily
+script from INN.  In conjunction with the scripts in
+.IR /etc/cron.daily " and " /etc/cron.weekly
+it takes care of files with sensitive information.
+
+By default a list of files for daily rotation is generated.  At the
+moment this option only reflects entries that contain "*.*" as
+facility.priority.
+
+.SH OPTIONS
+.TP
+.BR "\-a" ", " "\-\-all"
+List all logfiles and ignore all other rules.
+.TP
+.BI "\-f " "config file"
+Specify an alternative configuration file instead of
+.IR /etc/syslog.conf ","
+which is the default.
+.TP
+.BI "\-s " "pattern"
+Specify a regular expression for files that must not be listed.
+.TP
+.B "\-\-auth"
+Only list files containing sensitive information such as the one
+containing auth.*.
+.TP
+.BI "\-\-large " "nnn"
+Define the filesize for a large file.  The size is provided in bytes.
+This value defaults to 1 megabyte.
+.TP
+.B \-\-ignore\-size
+Don't rotate files whose file size is larger than the regular limit
+(see above).  This option is useful if you are postprocessing logfiles
+which would break if log files are rotated at a different date/time.
+.TP
+.B "\-\-news"
+Don't exclude news logfiles which are normally handled by the
+.B news.daily
+script from INN.
+.TP
+.BR "\-w" ", " "\-\-weekly"
+Generate the list for weekly rotation.
+.LP
+.SH SEE ALSO
+.BR syslog.conf (5),
+.BR syslogd (8),
+.BR savelog (8).
--- sysklogd-1.4.1.orig/debian/technical
+++ sysklogd-1.4.1/debian/technical
@@ -0,0 +1,10 @@
+  Some technical information - unsorted
+  -------------------------------------
+
+  1. Logfiles in syslogd
+
+     As of version 1.3 syslogd doesn't come with a static array of
+     logfiles.  Although the logfiles are still organized in an array.
+     This array is initialized when the configuration file (default is
+     /etc/syslog.conf) is read.  Whenever a new line is read the
+     length of the array it prolongued.