aboutsummaryrefslogtreecommitdiff
path: root/wd
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2006-07-16 14:53:38 +0200
committerWilly Tarreau <willy@wtap.(none)>2006-07-26 11:51:24 +0200
commit4bcb5a84fd7d1ee1da85376a866057b1a2fda1c9 (patch)
tree76d2e0ec73975d45b559089d4bb716e550d9423b /wd
parent[RELEASE] flxutils-0.1.21 (diff)
downloadflxutils-4bcb5a84fd7d1ee1da85376a866057b1a2fda1c9.tar.xz
[RELEASE] flxutils-0.1.22v0.1.22
Diffstat (limited to 'wd')
-rw-r--r--wd/install-wdd-nice.scr296
-rw-r--r--wd/install-wdd.scr95
-rw-r--r--wd/wdd.c56
3 files changed, 446 insertions, 1 deletions
diff --git a/wd/install-wdd-nice.scr b/wd/install-wdd-nice.scr
new file mode 100644
index 0000000..31e8405
--- /dev/null
+++ b/wd/install-wdd-nice.scr
@@ -0,0 +1,296 @@
+#!/bin/bash
+
+# ce script peut également être exécuté comme ceci:
+# ssh -t access@na root@remote 'zcat|bash' < $SCRIPT.gz
+#
+
+echo "###### checking /bin/nice ######"
+if [ ! -x /bin/nice ]; then
+ echo "WARNING ! nice absent. Installation en cours !"
+ remountw
+ # this block was generated with : "od -An -tx1 -vw32|tr -d ' '"
+ (sed -e 's/../x\0/g' | while read; do printf "${REPLY//x/\x}"; done | tar -C / -zxUpvf -) <<EOF
+1f8b0800057d1d400203ed5a7d7014c7959ffd905884606510b66c6333261248
+0164890f632cc002b1186c0b1609812f20c44a1a69565eed2abbb39270901159
+6458c69bd339a44c2e291bd9179bdca56cee2ae5c89060f171e05c3989627389
+52a672c4c657a3ac6c2b81c26b23b3f77b3dbdab41809354eef2c7d5b6eae9cd
+eb7efddeebd7af5ff7ec74addb7bafd75d2709ff87a5a8b8a868d1c262a1482f
+1c2fe078dea2e2fb8a04b0142d9ab7e8bef9f31610ffa285f7096291f03728c1
+80e2f28ba2e0f7f9942fe273d5370bff0fcb4ec7a3ab4c265392360b1681a82c
+d56a5b007cf8cb7afd024114d2857c2147b80d9868402778007d782648035801
+16c02502b4114cc1f314de66e2c00ada08b6e50b0201f517b2f47656d78b36c0
+4154e442683a6f3703ed47fb7eb411bc099a209deb20b0a18f6d97d546208216
+0d6df77adcb5f77aeae77adcde607b61c057384fafcfe2b63db4b68afb42afa7
+920720577c093081cb13f858a9cce0b880cb99c2e90cc034c0ad80dbc7f83e9f
+eb9bc9e94c8e2703a603eee0f45d80bbf9f33d805bb86db9dcae2f2a697fa23d
+31be7180f137e1990ac801dc66a8b303ee1cc397cdf124c0449a033e27b36e22
+770ef184adb6597ccc01382307f471934eef02ce07bd9bfb97e6f87ed011ce4f
+31b7dad07f39e031d066de7f354006bd94b7a7a1be1df47f72fa0ed07b415767
+e8f4f3a00f802ee5edc5a00f81cee6741ba097e49b75fad76413e8e9dcbe2e1a
+d411abcdcae6e856162756039d4b3169a09f061e40ff57b9bd3e8006dacde927
+8063a0cf717a05f5df67b54de4f63c43f302ba80d32ef217e87fe5f465f217e8
+73dcdee3e413d07378fb14f03f067a09974f312d83be8fb76fe3f314e2e3fb3e
+a01dedb7f3f697c97fa0cf727a03e0006827a75f001c02fd1baeffdbe43fd032
+6fbf4afe33d08b680d18fcf32ce40fa07d2a6f27d0403bf8f393b4d60cfc15e0
+af7f3e41db85d9e43ff0ff03e7ff9862d4c0ff83d1b4a7af67e4853aca07f709
+01a5de17548496a0525713f47a7c758f4bf542a3a4f85a941a8fcfdb28d4d434
+b448de7a377bac53b6b74835b5c420795b8580a4b4f8dd3ebf5bd94e55c96730
+b6bb6a1adc5e97c7fd842434d7fa155f5b9dd0ecf2408100d12e7f2321c9ef17
+5cb53ebf0233c0e211dc813608f12a429dce9ad008e135cdb53575417f4db3ab
+5d68604c0dc04125306a764d4dbde4971add0108ae69f0bb9aa51ab7b7c1479a
+dcde7ac12fe9429ba566180e6e572020f9959a0697db2334d4797c0189460416
+974722c79079009f1fbcc05e5f0db5296e9f576860f506d56bd6d5a087db5b13
+0c304bc8c335b4e3c27097db4b03ac9321ae5daa6b6d41fb8dec6cae0db8bd6e
+85bbcfa548ed8c686cf679b9a81ae1a147d7ac28ab9957585c387ff439f95494
+7c9a97d8e32cc87c96e45f9ae1f9fa3feb4d394cecbfc0f2b855df37793c05a6
+bbc753f63d6ad2eb6e71bb2752b63dc3e92c465b845f727a32a3cdc2bb3c2647
+5eb7dad20bf47c923649cf2369763d7fa465e9eb246d861eff69797a5ca76143
+6947bf7190b18330d65d276198b89b30027f2f616c0a4f134672ee268ce4bf9f
+3012f601c2b0fcbb8491170f124622fb27c2d8a00e1186a53f208c8de830612c
+ae1f12c6a6d74b1809f3c784b170fb0863f33b45181bc89b84b199bc451889a4
+9f3036bab384b1510e10c686778e3036bdf38491602f10c622d50863131c228c
+cd78983036c24b84b11154853fa8d4c8819b779dfc260e90da3a3821d22a6847
+81b519b064f34f4fa239beb0053de2790afe137b3c8f3c479948183c1f47c923
+0fcad436d8cf68f2a44c5335d8c768f2a84cdbe2e061469367654a238307194d
+1e96698b1fec6634795aa623ed6027a3c9e3f2fd44b7309a3c2fd3d633b88dd1
+3403326d61834e46d34cc8945a074b194d33223f467411a36966644ad98322a3
+6986641ad06016a369a6e416a20546d38cc9ed440f5f259a664eee64e36734cd
+a0bc978d9fd1349372371b3fa36946e5036cfc8ca699950fb2f1339a66583ec4
+c6cf689a69f9301b3fa369c6e55e367e46d3cccb7d6cfc8ca60890df64e36734
+4582dccfc6cf688a0879808d9fd11419f279367e465384c81a1b3fa32952e461
+367e4653c4c83136fecfe3f1c43e50fce1d6f0ef4217869d1b2ae4d2e749e35e
+ab6dfd46b9e569ab4dfb041d2f852f1b63ecde42415043e496ae3ec51cef4774
+75a33db4d48383a9102c894eee91f114715ac353e94115e2fdac2674bf10bcd0
+4bc70774cc90bb51a52d82fc3369d493b24078a89ac94ae0de7c9dd92ee71ca1
+a9a01e124c1fcb171acaae54ab6d5def2a337a3a8f42d3a911670fe50db90f03
+726aebd127fa78e487ecd8c939624e593808790b61410fe51a56554a55933f4f
+56897a6d0f6a47468c8c9d5435882a9d477e0db4fc16555ef89c2ab342a72e55
+6a3910ceec9bb66963a55a9579c63142269c71c498e72fa3a76a7e910c92df47
+dfa674edbf99c84bf24837d98634c3e48fc8fd783b912f90924bf42f46ffd25f
+8077cb33d7ab0e8cd18154f70639111d4a3a6cf6c8774040a53aed4867c95c7b
+d707f4f6f135d3dc608dfd589939d4d71f8a8d6fabd48e21492c7d75a245d8f9
+10a9252b228e11675346931029333bb51376261193705ba53c010a9b84269376
+581f63774499498321b5d156ee5f680b7e0d3a4cba8ed6c9d03a3be83668add6
+5627b5ae67ada6b2eb959b30a6a4f2c906e5f375e5dc89c7d8fbcbe0780478e4
+35aa8047222b5f1f3993461b043bcc9dbad424c89d14dad321c309779516c49c
+da66b83a7c92fc7b25ae6c0d5d79501917bae255ecd10aea61d25e4c4e64d2b2
+1eda7cc83ca7f6fd4949c7b05aa7fca58481cf8c5c67600f1913d9717f1cbaec
+5d5b1016a18e98a0583ea91ee9ba1c1c87b8a0d726cc5bb0adebb27237cd78a9
+2e4ed0caf49080e05b9845a2f6bbcf60f9e933e9fae8628ceb2757f4d1644143
+f08ed03241994a521ea7184977a2f3c8153e9c58a5bc13b55ac9155daea07d15
+4fdad337102aff29a12f27848e58aa472a591feb67ac0a8eb9837843a4aa0875
+aa401d5af50e084ce888588f385580b64defa3d9c8861347e9981b7ac01c4c3b
+ba539f50d5faba537e96b49a9d5051ac5b5ea9f57ec6d75776e5d1820c0b4db5
+7c9014fa3e254164c6db8ad8f980a0dc095b9a32680e2bb4c94c8bea18e94446
+3287dfd97585c276c7ade181a588a29d4f4eee25149da0c71325ec4eb55aa364
+43f1aeaeccb5bed8825474327c993d171d61cfcc8e2c2cf3a08da7894b4eedd9
+4fd9c08adfedeac368681742929a3adade164b38eb2ba395fff669a2729c7619
+0c6a4ed7bb3b1ee8213d470ebfc032e274305630e6c519345d594ef9c768a9dc
+a84dc5e0a2132be4933a990e3222699bb7eab9b2870c2743754dabe37a32d547
+1a7983fe27c7e1b0a94151bd8bce6367d284c4628a998375fa8a7a131ae4b417
+31298e4c6793599bf0a99e0d6371657928266335c55a95cce842c61dff15cdba
+631aa9551d39806c4096938d1a7e1acf331d85e37b187398eb4d2c62c318c8be
+cc4dccd1daaf3fa100552d61c708f5cdd566c01d585169c74a9154c367465ea7
+57fc8bdf53ab46c253988c1a1242f34633d24b5caa7052dd00faed60da1146af
+ccb585cd2749c3a3b95968cad9b725377bef409f96667fadeff87973d74f958c
+c80e93359a41f110e95d499d1685de9f1e1e0effe69d58e8bc29f49ea9f8c43b
+ef15ff2abc081a4f7693bed08e5c5b3a54b6c36327713e63e358022d671c43fa
+a6a0e9e80221ed6718592866b2efef83d2b0e33c9c56fc6ea8ef6a2866b5efa1
+808de77675425477497566600226ebb43083e5633a7f93141d0d91bac153a355
+8334c96a550e965f85fc041ab51a04815a9e133e8daaf5f20eaa7a94e2e24438
+388439e9c4aa9fa62b090ea9e5b67de97bad13cae28e2190680b5e0857a17a88
+8b0ff787ce5b945b9fb0235094b4fb6728b357e0df4cfa77cf0ad5bc1b5961f7
+05652a5eace382323174c24aafd8f1e007a1df5b56ac28f88f709516bd87948d
+c7ec9e4e9f053ff1f10c9161f0914e0db363eb6738e677873a2e084a71a84313
+94d9aa63d8e2d04a1cd96da21acc523b862cc161b55c1b39245c7c293891e48e
+234f592d5bcad4aa2cb57c785ff62d7babced95f7b3bf4d993f63d7b4ce4d66f
+ed8726926adfbd070af8d0d16bfe16f26f195564e8628a601fa7ab404f61f469
+c7b9a2c169e8a9afaa50478ec9befb350b7bb2d8bbcc164a69c3a1e3e692f26c
+7be822b64215563ab23a7714991eb477bd878a7d1b8acc9115ff653fd6178add
+65dff30b339beeeeef21a42fc3de70f9b03e16a6f44166014e0220266ce926ca
+1e22d5bad10f0efe33fdaae98aced7ed395c1b2d38dc10cd3bec8dde46e339ec
+8fda0f2bd109875ba3b710bdcf714e37d9c24c26377442ff5ec7b9c1c7cdccdf
+c382bd6b89393132faad65702ebd73e8fbbf5e7b5a6f37dbbb269b751f72cfcf
+32fa6bcba8ff98f534df6583e74dd4f7bca02c38e31860bb27bdfbd97f6475e6
+09785db0ff08ebe1ece0dd68d1cf1f6759304c4ad2317d1df1a3d6808eceb2b3
+5147763cb816be46b01bc374a6327b15fecda47ff7ac52d3c786e9e964987e64
+59b50afd0b4e8783d93c6b56c5c2556f55a81d98c36c4bc7008e166a7996e9d3
+7079fffa88034936709136564ae897154fe86adcbe7b0d9657e8ead5e097b9ed
+251dd9810a35d84f4bede170ac34ee18400c071e448c76c2d1c18fa20b54c725
+96b12f5fe47b031d1aceeae79db74cc10134aed73e4d34da7737908a8e01535b
+b63e853f61a33f8b99fb3a5bffc396aa81447c62fd3c426d41873e4f7aacb379
+994c0bde71ae4f4bcf2cc2b24fc67f169858bd25771cb5cc2f03953bce5a8430
+c1222c5d7ca2756d6219ef2b3fb737737e59d881a598b5cf6a034b741fd33a9b
+894056eda79da1cfaa5abbc11cfaddf47762874ccac4ebac198fa84197bdd629
+c83fc36c3261206c19ee5c320943fb03ce05d14c4cc362c7b0bdeb7d3a25740c
+094a815a354467807b587ed4d773f910596622cb29953986e82c70c1b0aa84f0
+40345b8fa71cfae979b08a7652caf7522fdf45f89eafef4539c95d475bf1074c
+f819157b746c238e4989ad8eb649765437d3f963fae86e6494d361d32c7fa0c3
+1276b4ae78479a96076af15205dbb67d0ffd2c196933852f1e7fdf121e38ae59
+169f56d2b42b306fd7d24e70b4038279b411dab4dbb17ac3c77ba84a9dba8376
+fd89c4123685d75bf931b0872a9cda144a48534943f838671a2ee8c779e9f879
+0b4e5b91ec5f56687f4f435a483cd811583f685117c4d42d312b1b5f5556058d
+6f63a5a65dd58f5ee2e25fb53dc458237e5378418cbc51dcb7eb4a29d6b2620e
+0f38b57f84e1e1138c25fc8e5a951d86303ad7306755655640d877e8a47caa48
+fbf863f8047b785678e03abfd93061d02d93ef9be238dfbd72553fd524db1dec
+9d0d278bb7f8792734b460d346ececa5d898578657e6664676e46615f78dbc4e
+678d8bff12fe7544c9cd4c9c1dc2fd5b6b42a7169cb00afad9638e3e4f50893d
+26527d8e64576adfa705770a67e0f8c64dda9cab74ea7af35a3b593f74ea40c0
+6627fb7d95f7dbb889c5c61f3f37f6348e8f5e6a2b3086763e865199d536fb31
+4766a4e31c0bbf84d974e0353923c1731bb5629c253636c5713ed79eb9917ce6
+9fa6079cdaa19b9d07d9fb35bd4d62b539b271a8be9db2d1fa0ab9e2251c33b5
+e10fd9d12f3a05f9dbb95edeca2adffd503fea3b72c874596295a75965acb229
+43dbfc71e2edb9b267378bc46f8f362e1b6d943bd153eb405be214ae6f34911f
+b3cf2c3d4fa3af3e10fd07899ebdbdf4bbd4cbf857fc32bd433935e1e3c42bd4
+531f6184c6b8404e7de1c3444e4dd35e898f891deefb18e2eab324df04eda9e4
+fbe6f5f344bccb3e1a95f9956bbc5a45538603a5aae4e6a813c2bfb0bf7a351c
+fbf62757c3ffbe7830981e2e29ee8ba6f5d26685391a9b1bd460a65a9df508bd
+b0de45eb6913b397bf2bb04ed171a1a829f07e71dfe832499c35d96f101d59a1
+786eeb9d72297966a7bc9abcb40dffb4eaa1789ce547e8402a1b1f098ee8f66a
+81213a639fb1e82f8623583814a83fa35a478c524909522f7d8951d34b1cb6e0
+83d8f69173914f955cd8683f266031e75468df8d262c9d98f8c980e55766f6e0
+0293e1bc84fdea0e260f42ecbbed26f642ca0439728e0a891f3a9cda9a6872bf
+fb397f6b2da2970bad28a96b8e7aebbe15a6252b95db77a62f59a14c89deb9c4
+1dbcadf309f38ae02d6fd090a2194735e03728c7abe9fb04eb3176ea5ad8b613
+27aebd2fb39f7b64faf8187d84db47346c889624e891a6f4a8839025ba2c7c99
+ad3b7aeb196932470b753a2d9a47c81abd9be8589339e288e96b3d3a8b1a6cd1
+3442e32a597d06b247d4ae3a629413cdbd6459f43636c3cce04cd3b2441b4df3
+009fe66ebe2cd469b927d9ef75380cc4779ddc7907fd5c471fde8adfa6f5a166
+2189b019547f4f2b6a84c76fe5d12daf63b04be97f5cc9542df1fed0c9915049
+3c7869f3d8dfdb92bf057e09c2b5389cadffc49cfc3e6c625f6b6f5c0e3eafff
+d847c57bc36b074dc180d22c796f723961837fbbb82d2f20ce9d2b4b9e965962
+83cf2f36fbfc92489f4efccdecb34c61c6cdbfff56055c8dd20322246c5ee7dc
+b066ddda6a7173d9baf2f2e56b578a9b97573c545d585858fd05fd2b825e31c1
+dfe65664d1e515759ba57a3150274bf5418fdbdb28263e8215666c222eaf2fd1
+6b8ec8be5a898a2c897541bf1f23bd613f515cbef2e1aaca0da23b20161765d4
+6e17eba50657d0a3a0a5c2e56d94c4469f14101bfcbe6671eebc22315f7637ca
+5240494a2810159f58bc58ccf7f8da505f509891218a73bd73e0ba51272fe54a
+44f8afce2f51555280089dbcb9c1ed0f28cc2b222bbaf7d963bd3bd0e2716dc7
+786028ab7579eb45fa6675432f26fab74afe00a64a147d41a525a88809da308d
+0641b5c1c6b97598e5a0e2f6044a1bbdc1429fbf51c8a8905a7c7e45446b8006
+bb242fb08ce67ea5abd55d2f96bbea1e91bc4fb82561217d105b5b25262508ec
+0690dbdbeaf28091be0b421ba26a9630dbfb40b23ee907d692884f48696e26cb
+9ae142b116d3e06e95bc636281c56f9dcbebf52962a334ea5221af3e23511fb8
+a63ec0e5d738d755ae796c5ecd46474525a2536843b324ea9f1ff30214b89cf7
+45fd97112af4d123f6c228dd7a03bf73ff0a3443c26c41a844ff724029601960
+11a00890cfe5d6f1ef9f1c49813a578b24d4090108f0cc7579da5cdb033a2178
+60a1dfe511f87741fdae8685dfb548e377226608dbd8bd8817be69b5f53f63b5
+c500d66fea3073bfd5f6d2b76e0c97d1260067036c801c801590f5ad9bf7f94b
+e161039472fcd4b33ade36a69deaff1a78788cfc163ef6bf56ee5fa25f34e837
+e2bfa50d84c9d77dfb6fcc43f509185b6fc47f091865de2cbf97f95ab6fb9149
+1531bfac409c5754345f5ce59724b1d2d7a0b4b9b0cfacf205bdf52c3fcd11d7
+78eb0ab11cc5fcbc40015666063d13da8445ab20292081e605aedd8d36509a74
+53de86d000175a826420b11d21e00bfaeb24b6abd5c112da11ea7cde7a37e90b
+20f36f9025daeb02e2da7519e8e9777995ed2522a51389b210f52b775494ad5e
+be76c3f2156b1e5db3e1ef4454ad5ab361ada3b2525cb5ae425c2e3a97576c58
+5356f5e8f20ad15955817ce33098d82c6137dd8eb42bbbd89e369a99f4d2ceaf
+68705c5837f6eea3b864a9a8b7d5d4ba02923873e635245ae7d37d9bd2e7acb6
+431c9c1c6f32d4116ce3b8d150d73286a76d0c4dd00d78f606f54628029c1853
+f7e7e83ff405fa3b9f33e464fe9d3d79ff0fffe8dd97dec8c59746cf40461eba
+0f479f5fe9be5329bfd793bfcb6aa31c9ad965b5511ef57cdd6aa3d9fac0a4df
+cbcbe2f7d512672f0ff49ab9d06c7e778eeeb1f5efb1dae8f90030dd0dba9fdf
+d9232371e0f4ad463d4e8c3eb26318f88f4fdd7c8ddcacd0070e23a6bb8a89b6
+4961abed6e40216019602d602bc00b7812f00dc073805700c7003f07fc16f011
+e02a60d23ef40714029601d602b602bc802701df003c077805700cf073c06f01
+1f01ae02ea13b61406648a4757ad50886398e46f110ab17ca4422c97b98aab51
+28945d015928acdfee0d6c6fd6b1e2170ae9cc91d8438d440ddafc92a7b0d1a7
+e80fb58180fed0e25148851bff15a91dff1b40a0c987ece18260f65f92f59b3f
+4c91abd95d2714d6293e3f44d433f467970986bd97dd4335dcc9140c7750a7f0
+bb8fc4c7ee8b9a46ef761aef47dec3f76e338fc17cf0ad348db627ee96cee2ba
+cd3c363d783868d6fb9a84d17ba6f7f2f834f358ce4cd36378ac7d8bf4f8f111
+1fc5e01fd3f57b76d6e47d5d1d56f2b8a5678addd5189453b8562f954a7ecfd3
+cc63ffc0383de6ad7cdd58f91ad862e03b08be83e02be2edb71af824031fada9
+fe71ba422b5fbf093e2fb7239dafe97edbb5775713f6b90d7c31f0c5c09765be
+968f4031f0d15de52c38bd287b942f710feb09031fe590d2e9fa5dd6b17a3b0d
+f1b20d7cdba65f7b213611137b391fcd1dbb9f9caffb65acbc6f18f8e8a64677
+fe689b91ef00b7cdc2f303dd6b7ed3706f37e1bf1e833c7a29dd52a0d78f9577
+c8c0570fbefa9bf06d32f0518ef4806fbf70bd9fb771fd167eb7952e41ef365d
+ef1793e12e342be07bf506eb2d55522555522555522555522555522555522555
+522555522555522555522555522555522555522555522555522555fef7cbff00
+b7513dc600500000
+EOF
+fi
+
+echo "###### Modprobe softdog #######"
+if ! modprobe softdog soft_margin=30 nowayout=1; then
+ echo "ERREUR de chargement de softdog. Fin de l'installation !"
+ exit 1
+fi
+
+echo "###### remontage R/W #######"
+
+remountw
+
+echo "###### extraction sbin/wdd #######"
+# this block was generated with : "od -An -tx1 -vw32|tr -d ' '"
+(sed -e 's/../x\0/g' | while read; do printf "${REPLY//x/\x}"; done | tar -C / -zxUpvf -) <<EOF
+1f8b0800de741d400203ed934148146114c7bf5967dd3d986e60e1c16aa1ed54
+b1b3dbae8b8521b575296a646b2d82c45cc92652d09995a252fa9a6a9836840e
+754c2528baeca9ec12c3ae641d82e8e425ea627d834451627b10a7f7cdace2a9
+5b1ee2fd868f37efbdfff7defbbe6186ce5de88f0ee772e41f22c52429959088
+e451b589153f968c250948a4543cbe27d912e7fa544b8a8425b20e68436af760
+384c060706d4bfe9ba7397c87fc8c8a1a387054158f57da486704f1d15838935
+ba040943ce63550d1abeda6b08e1cbcf63212fefc6ee430ed606f077c1aaade6
+4f1b5f3a0ae97ba29ced9894216f94628bb424b60e2e691573afeea81b692948
+9db0f6d3bcb264b4f1122c085b65d603a517c64e1a739dd90c1b0747b7ae0762
+96bd0f5e5ff1f1b28cc22b9d168f5d5ee8db4f61e345f0d92d2f48971d6db3e2
+eb9378428198f19a4e0721aa6e5704379a6543aeb48e5604b53ecb92bcb003c0
+6ec5ab63940b949f4266b22b0dea961a50043603ed8d4f4b2f8948c8af671916
+f77a56b34f21cbbe73c98cee5ce39107e0e88e1680b277e15581a7937d236ef7
+d68abb4975e32ce4753dd82eb38f646dcb13d596300d6fe91d78c293d00aaf2d
+30fe1365d863b27698665e576022d4b5e7961da7d0bb70e66cd7db72214f1a5e
+58f3fea2d0f0dc822b36be9a5d21f378a3d9d9640e379b23616713ff18b47233
+5fff7bd628b37e3e40137de3c0f6f2bbd1b2b158acb32db8aeb162ad3de55a9f
+5d74addf7ee2da03f623d72af643d706ec31d78af61d6e1d3522b2dbdeb49369
+6816fbc04fe2334ac67b3edfd42988419f6cc6542375b48d4b88560fb754f2be
+926e5ddda12f6a81719e99df666ee1b6206e95d9f8aa403466e7fd7c3c981b6a
+99e9087c5cd9f82ccbac115a83dfb8331d09d2e950b9b8dbfeb1cce79bb019b7
+d15c6f3e3adcadf6f4e506ce93283972430caefc130241100441100441100441
+10044110044110044110044110044190f5e50f548527e700280000
+EOF
+
+echo "###### modif startup.rc #######"
+
+### startup.rc ###
+ed -s /etc/startup.rc << "EOF"
+1
+g/\/sbin\/wdd/d
+$a
+/bin/nice -n 10 /sbin/wdd
+.
+wq
+EOF
+
+echo "###### modif config.rc #######"
+
+### config.rc ###
+ed -s /etc/config.rc << "EOF"
+1
+/^\(service\|section\)[ ]*system/
+kb
+# on supprime une éventuelle occurence de modprobe softdog
+'b+1,/^\(service\|section\|no service\|no section\)/g/^[ ]*modprobe.*softdog/d
+# on supprime toutes les lignes vides jusqu'à la section suivante
+'b+1,/^\(service\|section\|no service\|no section\)/g/^[ ]*$/d
+'b
+# et on recherche la dernière ligne autre qu'un commentaire avant la section suivante
+/^\(service\|section\|no service\|no section\)/
+?^[^#]?
+a
+ modprobe softdog soft_margin=30 nowayout=1
+
+.
+wq
+EOF
+
+echo "###### démarrage du watchdog ######"
+
+killall wdd
+/bin/nice -n -10 /sbin/wdd
+
+echo "###### remontage R/O #######"
+
+sync
+remountr
+
+echo "###### terminé #######"
diff --git a/wd/install-wdd.scr b/wd/install-wdd.scr
new file mode 100644
index 0000000..602bf27
--- /dev/null
+++ b/wd/install-wdd.scr
@@ -0,0 +1,95 @@
+#!/bin/bash
+
+# ce script peut également être exécuté comme ceci:
+# ssh -t access@na root@remote bash < $SCRIPT
+#
+
+echo "###### checking /bin/nice ######"
+if [ ! -x /bin/nice ]; then
+ echo "ERREUR : nice absent. Fin de l'installation !"
+ exit 1
+fi
+
+echo "###### Modprobe softdog #######"
+if ! modprobe softdog soft_margin=30 nowayout=1; then
+ echo "ERREUR de chargement de softdog. Fin de l'installation !"
+ exit 1
+fi
+
+echo "###### remontage R/W #######"
+
+remountw
+
+echo "###### extraction sbin/wdd #######"
+# this block was generated with : "od -An -tx1 -vw32|tr -d ' '"
+(sed -e 's/../x\0/g' | while read; do printf "${REPLY//x/\x}"; done | tar -C / -zxUpvf -) <<EOF
+1f8b0800de741d400203ed934148146114c7bf5967dd3d986e60e1c16aa1ed54
+b1b3dbae8b8521b575296a646b2d82c45cc92652d09995a252fa9a6a9836840e
+754c2528baeca9ec12c3ae641d82e8e425ea627d834451627b10a7f7cdace2a9
+5b1ee2fd868f37efbdfff7defbbe6186ce5de88f0ee772e41f22c52429959088
+e451b589153f968c250948a4543cbe27d912e7fa544b8a8425b20e68436af760
+384c060706d4bfe9ba7397c87fc8c8a1a387054158f57da486704f1d15838935
+ba040943ce63550d1abeda6b08e1cbcf63212fefc6ee430ed606f077c1aaade6
+4f1b5f3a0ae97ba29ced9894216f94628bb424b60e2e691573afeea81b692948
+9db0f6d3bcb264b4f1122c085b65d603a517c64e1a739dd90c1b0747b7ae0762
+96bd0f5e5ff1f1b28cc22b9d168f5d5ee8db4f61e345f0d92d2f48971d6db3e2
+eb9378428198f19a4e0721aa6e5704379a6543aeb48e5604b53ecb92bcb003c0
+6ec5ab63940b949f4266b22b0dea961a50043603ed8d4f4b2f8948c8af671916
+f77a56b34f21cbbe73c98cee5ce39107e0e88e1680b277e15581a7937d236ef7
+d68abb4975e32ce4753dd82eb38f646dcb13d596300d6fe91d78c293d00aaf2d
+30fe1365d863b27698665e576022d4b5e7961da7d0bb70e66cd7db72214f1a5e
+58f3fea2d0f0dc822b36be9a5d21f378a3d9d9640e379b23616713ff18b47233
+5fff7bd628b37e3e40137de3c0f6f2bbd1b2b158acb32db8aeb162ad3de55a9f
+5d74addf7ee2da03f623d72af643d706ec31d78af61d6e1d3522b2dbdeb49369
+6816fbc04fe2334ac67b3edfd42988419f6cc6542375b48d4b88560fb754f2be
+926e5ddda12f6a81719e99df666ee1b6206e95d9f8aa403466e7fd7c3c981b6a
+99e9087c5cd9f82ccbac115a83dfb8331d09d2e950b9b8dbfeb1cce79bb019b7
+d15c6f3e3adcadf6f4e506ce93283972430caefc130241100441100441100441
+10044110044110044110044110044190f5e50f548527e700280000
+EOF
+
+echo "###### modif startup.rc #######"
+
+### startup.rc ###
+ed -s /etc/startup.rc << "EOF"
+1
+g/\/sbin\/wdd/d
+$a
+/bin/nice -n 10 /sbin/wdd
+.
+wq
+EOF
+
+echo "###### modif config.rc #######"
+
+### config.rc ###
+ed -s /etc/config.rc << "EOF"
+1
+/^\(service\|section\)[ ]*system/
+kb
+# on supprime une éventuelle occurence de modprobe softdog
+'b+1,/^\(service\|section\|no service\|no section\)/g/^[ ]*modprobe.*softdog/d
+# on supprime toutes les lignes vides jusqu'à la section suivante
+'b+1,/^\(service\|section\|no service\|no section\)/g/^[ ]*$/d
+'b
+# et on recherche la dernière ligne autre qu'un commentaire avant la section suivante
+/^\(service\|section\|no service\|no section\)/
+?^[^#]?
+a
+ modprobe softdog soft_margin=30 nowayout=1
+
+.
+wq
+EOF
+
+echo "###### démarrage du watchdog ######"
+
+killall wdd
+/bin/nice -n -10 /sbin/wdd
+
+echo "###### remontage R/O #######"
+
+sync
+remountr
+
+echo "###### terminé #######"
diff --git a/wd/wdd.c b/wd/wdd.c
index 3ee0af8..d521881 100644
--- a/wd/wdd.c
+++ b/wd/wdd.c
@@ -1,5 +1,5 @@
/*
- * wdd - simple watchdog daemon - 2003 - willy tarreau
+ * wdd - simple watchdog daemon - 2003-2004 - willy tarreau
*/
#include <stdio.h>
@@ -10,6 +10,57 @@
const char dev_wd_str[] = "/dev/watchdog";
const char root_str[] = "/";
+/*
+ * This function checks if the system can allocate memory
+ * In case of failure, we exit so that the watchdog device
+ * notices it and can reboot.
+ */
+static inline void try_malloc() {
+ void *heap;
+
+ heap = (void*)sbrk(NULL);
+ if (brk(heap + 4096))
+ exit(1);
+ memset(heap, 0, 4096);
+ if (brk(heap))
+ exit(1);
+}
+
+/*
+ * This function checks if the system can fork
+ * In case of failure, we exit so that the watchdog device
+ * notices it and can reboot.
+ */
+static inline void try_fork() {
+ int pid;
+ pid = fork();
+ if (pid < 0) /* exit on error */
+ exit(1);
+ else if (pid == 0) /* child returns cleanly */
+ exit(0);
+ if (waitpid(pid, NULL, 0) != pid) /* father checks child */
+ exit(1);
+}
+
+
+/*
+ * This function checks if the system can access its root FS
+ * In case of failure, we exit so that the watchdog device
+ * notices it and can reboot.
+ */
+static inline void try_stat() {
+ void *heap;
+
+ heap = (void*)sbrk(NULL);
+ if (brk(heap + sizeof (struct stat)))
+ exit(1);
+ memset(heap, 0, sizeof (struct stat));
+ if (stat(root_str, heap) == -1)
+ exit(1);
+ if (brk(heap))
+ exit(1);
+}
+
int main (void) {
int dev;
@@ -29,6 +80,9 @@ int main (void) {
close(dev);
dev = -1;
}
+ try_malloc();
+ try_fork();
+ try_stat();
/* avoid a fast loop */
sleep(1);
}