Todd Smith Org

December 31, 2009

Howto Compile an upstream Kernel the Debian / Ubuntu way

Filed under: Server Technology,Unix Administration,Web Hosting — admin @ 12:30 pm

Compile vanilla kernel on debian / ubuntu

I realize that there is more than one way to do this, but this is the way that I have most recently done it, and it works providing you with packages that you can redistribute to your other Debian / Ubuntu machines or friends.

Grab the dependencies you’ll need to build the kernel

apt-get install fakeroot kernel-wedge build-essential makedumpfile \
        linux ncurses-dev git-core linux linux-source ncurses-dev kernel-package

Grab the kernel that you want

cd /usr/src
tar zxf linux-
cd /usr/src/linux-

Configure the kernel, I use the config from the stock Ubuntu server kernel, then run “make oldconfig” (hold down enter until all the questions are answered and it gives you back a prompt). Then, run “make menuconfig” and add or remove whatever feature has caused you to want to build your own kernel. Save the config.

cp /boot/config-2.6.31-16-server /usr/src/linux-
make oldconfig
make menuconfig

Now, we’re ready to compile, set the concurrency level to however many processors (including hyperthreads) you have plus 1 or 2. I’m building on a Core i7 860, so I use 9. (Quad core, which hyperthreading, plus) 1 = 9.

Pick a version number for your kernel. It could be anything you want a-z, A-Z, 0-9, +, or . (no underscores “_”). Thi s will go after append-to-version= below

time fakeroot make-kpkg --append-to-version=.31338 kernel_image --initrd binary

This took about 30 minutes on my system, and leaves me with the following files:

real    30m27.995s
user    79m17.300s
sys     10m38.560s
root@replay02:/usr/src/linux- ls /usr/src/*31338*

Now it’s as simple as installing!

dpkg -i /usr/src/linux-headers-
dpkg -i /usr/src/linux-image-

Grub2 should automatically have updated and found the new kernel!

I hope this worked out for you.

November 19, 2009

Sharedance on OpenBSD 4.4, or 4.6 Howto

Filed under: Server Technology,Unix Administration,Web Hosting — admin @ 4:24 pm

I just found out about sharedance. It looks amazing. I haven’t fully tested it yet, but I am installing it now, and thought that I would share my experiences with it.

First step is to grab ports.tar.gz from

extract into /usr

cd /usr/ports/databases/sharedance
make install
mkdir /data/sessions
useradd -d /data/sessions -s /usr/local/bin/bash sharedance
chown -R /data/sessions sharedance

Add the necessary stuff to /etc/rc.conf.local

sharedanced_flags="--directory=/data/sessions --uid=`id -u sharedance` --daemonize" #sharedance flags

Add the startup script to /etc/rc.local

if [ X"${sharedanced_flags}" != X"NO" -a -x /usr/local/sbin/sharedanced ]; then
echo 'starting sharedance...'; /usr/local/sbin/sharedanced ${sharedanced_flags}

Now let’s try to startup the server and see what happens:

Copy and paste to test our settings

sharedanced_flags="--directory=/data/sessions --uid=`id -u sharedance` --daemonize" #sharedance flags

if [ X"${sharedanced_flags}" != X"NO" -a -x /usr/local/sbin/sharedanced ]; then
echo ‘starting sharedance…’; /usr/local/sbin/sharedanced ${sharedanced_flags}

Now we should start to see sessions flying in!

# ls
001edf5da8d18e03294a0bef64db1c60 3cdd3cb0dcd8c63d4b0afd8d7909c16f 814dce610e0a3a2538414dc8e7aad3ae c50af33ac412115401a2ac858ef913c2
00ac9103e418edb613a671ddff036a25 3d6d943bd531ef871681d1662dc6270d 81e0b8d9e5c79aa136ebc9058d87f753 c51caf63b678bbe6fc49d50d68fe56e0
033aa2d8bf72b94da58e95902156dc24 3dc2a1ed8a96161427f4360dc5f5c129 831fe15e21aa21dbebad685476368028 c5593b34010f9493d3217df8b3420239
0476651594f6a6190fdddd5adc56513f 3e06310caf3e2ef196d064b7af90582f 83b3a0e2eb0d7c03e981a80cf659772c c5c61dcc71a584eb63369743a32d63b4
05c92224ece3411bb0a3ec27863ea347 3fb4dea4ea7641b220269c768a4920f3 83e270e9efa9a5f823d22b94186430ab c6adf606b7ff82afff5b4a6fce0fb890
05fb3f07e422c538ed267f2041f229e2 3fd9eab54c416715c1fd99752a0f3351 84df07b05fe3189cbbea0ae946ceb843 c6ee1d1d6ff3613998bd296f941c9db2
06519bdce1ac395913dd23ffed1002bf 3ffbaef2c507ddfb76bbf46fbdf32167 851785879ad35c3f6615f14cfb7a806f c70574b49a4917aa20508f37a1ae50c4
06c81e70202b864b0895847022d1715a 4018f199d3a7186d008217ef788e9ce6 85490157e4a44d4cd2bd7b0600de2877 c7a4dc2ffd555eabf04d4e8fd6ea0cf8
079a30c35a2947d317e3c833a8d3325e 40b205a685678009fcf1bc434edf7afa 855f44a679f5ca13fecc83680666bffe c8ef6c5bf98f4027300cc72967f26121
07f4ed3dd2683b3ca1c81a16b1440363 40b93755f39a6474a2f295cf3c208962 85e7ff111f56ed0e33a2fea0a02c069c c968558f44298ec1a1ac34b33e1962bb
0980b72761b136af1236fe43487e446c 40c899104112267e03ca7a6bc8c370b0 86128ccdc4cfe0bd08c16ecb3de30c24 ca62d52ea41cb45cd94f2d56749047f6
0a66f613410e1fdb0483bd0eb8f9d1cd 40d02458229a4cab0b4b23ddfe2f019a 863d3799630549e4ecc1e756e1db4bf6 cc0003b0215aae77700a55d96d489a51
0b15ee94e850bc18d1978cf80337a274 4199aeedf821fbf48a53fa06736af5e9 86a3426c3731983ffaa72d31175478da ccfc5ada77df706feaa6ee006e2bc64d
0beac9dec32e412a6d0d802f4c0ae8d0 41b70e1224550fcaf95e414d3f8337a6 873c3d41cb310c64814e3f25c6c6ce73 cd01497f8d6877a67599394c010d8a50
0c69b4162502ae2e9e1001f20a5a72cb 4324da6624fcc2b3bfd2241082ac2e69 8741ac5b8136184424495454c50c9d39 ce2b2bd02b29c04aee1cce9e447b707d
0d24b4c31fa9bef69b41a778660ec04f 432944723392d737c917d2d9cb0f6192 8771bfbfaec46c8286a19540ac198a4a ce898b71bcc6c90ecd7828637d260bd0
0d4580d01d8cbd8f7b9350a1a2a17a89 45da09fe7eee1b885999d88c3b3967d9 877c985c6a403a805052e678929295a2 ceac5f41c902a89bfd27d3508b903d7e
0d7b4d3873055690730ee931530fdf30 45da9e390bbe331c866f62117190d707 8833d957a287714b806df3aa5eb86a14 cf2fe75a711bcc7a2e0bce4a4b72bbc3
0da2970092019bbfe5a1679dc05502c7 45e41cc5dd4b90e506f04b9019dd5e55 88c47114b3f71c4be490096ab4a50bd8 cfbbd96e3c74da98d448e86efb82f164
0e5a70cd126d43ecb5787de1e8afcf1b 4646bf3c4af6b77ce20499030a1ed4d0 894438f074a9a2c98ea1bd6af6683f82 cfcf2cd796a92ba7e50aa060f747a7fa
0ec03366892da6dbc9d6fdd6ed9e5e9b 48bb5039203e532abdc5f506b26eee34 8a8f83a076687d6a1f2d4a566c8c3141 cfd197d7477d1213526847ec921e3d6c
0ee71d5c28915d1173e899487335a11d 48fb02b71f186c33c9f11fc7a3d35b5e 8aa94c210f0136b0454a9f3465b56df9 d05babd923187210abcc791a336427a2
0f2a1a174d2b4bcd5fc96617273facfb 491715ffaf8903871b0985f95df6029c 8b17ebebfecf2819ecb8fbdf7f5dfabf d26725da5a6f65ee5e30daf2e4ac87d7
0f6eb10f87fc021d87ee7cf027690035 493e3961e44eee9280d03f6cc184cf14 8bd62827e7ad205e4c0aa124fc13a67e d3191968baed188ea81797a4c200e89b
0f9baff788293fbfe9513fe9a6b96c12 498d7ddadaed5d3d619526e9178f6891 8c56ab1bfd1c11fe07b43bc92cf51ed3 d37e4c3d2ed8450a91dba764c7900b03
1046a1bfb6b84b317a18a8f13f052ebe 4b1f8cc67276c34bf6dc4775a1b87a5d 8c74de13ba8c71b39df665a88b699403 d37e6b44531779633815348d20377332
10b2f9793dc0b2fd03f27f2072a953c4 4b2c05bb7c148e870b50dc9c6506b035 8d07f4b82fa5b040afb965e08811c494 d3f433130238be83cbf53c6b086d663d
112ef98e8b72035be52750f6c7756842 4c9f290a38ee3077026b255de6479c31 8d587ffdba8766051311974647dc1b8b d599af007dc4d0489b57da351e60e8df
1190d874fd580bbb21e94b538fd8f9dd 4d59cb6badbeed1e0bb82282cf2e9868 8e22dbe94e2afbb908aeb11c3adcf8e2 d5ac8eb6974fe941765e60714fdd126c
12119c8588cf09b9b9a0f38da4831cef 4d703d8350f5f05d6f50aebad33e50d2 8e950076a79adc26a79dca69033bdf8d d66e00575ea0a0f7cbbac7f6a08b74e5
122a2b0a76e68c93d951f05128fbad18 4f55d1c5554823ddbcda16687094e3dc 8edb798e568641f9a1c406f669bae651 d76101b243fb513330375024de87ec1c
12508661d6fad03d673eb8c3ae9e3153 4fd284746f6afdab5fe7b4fa03ffbf78 8f7f6d16ee336deb224cccd624492d9b d76fcf0e7d7f8ddb5a4f50a4775e2679
12540f56caf9350c9be0703cb5860f36 4ff79a4a69b192a3b0223c3f1c67ff3e 8f86349cb890dedb02f0d3662bf36e6a d797e249ec56f08240bd5ac3e4f88dfd
12a9336e3e00df763f232e5271d7b628 504c4799a5f3d905c5f506dc8c5bcfe9 9001f7fb16b58824c2c59b35e9e29c62 d9db512115f1ef29fa14c27f60f8ca56
12aeeb8fadd87a69b932cac2cfa56b9e 50eee4621a055d10226baf27c510eaba 90238c9a0529e84149858dc4d3cae15c d9efe16d965629b37ec6b08a5b2a0422
12bed8909062dfc3928d1eae10920f92 51cc90889fb4afec426aa48fb39f3efb 9070bf70553fe3e10a60891a42b28d16 da395b3ad88750ec17463c614f6315bd
1359adb01bdc65a5c59c537ed7c7178c 5250845bd1aeea11aa242ea797dd8350 90d9083b9be3254edaca685142c09b3e db52e5b87129567d1fce7a1969075828
13e3ad71c4825d968ec1141f78573aab 5256f1933528441eab02c9bfbdbd7b19 90ec8cc03b9b583d90a9a21b5a3a6ddb dc30ddfa8d46f409195fefa025bf24c1
1441cbee7126238d5d2b925604840e7b 5288a3a0ea4bb154034cc6db605fd781 914cdb0e08cc41f4ddb47de52e689777 dc5f9c776bb354bb7ea4bb3e7e8cd774
1464dff10323fc531cb85b3dc753c3d7 52cf97b9403c8f6db2352c4c2d8766cc 917f8c91f24d653be7bf288869a8235d dc60b150d56b5053cf3f58434f887a93
14cc6c7eeb24e46280c39c728f3c5209 538bb3eb2ee5fbc2f6fc41b933dcaa47 91c7668f914d5fde2f997d9b7d148a2b dcbe39f2e2b19a37d6e34e94f8a03f7e
14ce97dd2a401adbac78e8afaeba9394 544179e8a84b1c1c7a4016c09bb0c8d7 922b27b363065bbd33c9ad7077543336 dccf4bddb8c414f32563633dfc795efc
153f603ede2fba8027c4bc4bcc7d7de7 54ab43500a3065be2b4be0e56d884431 92861a3b27b08ecb26cc2703bd1c6d80 dd0af6a59d6bb46ef569a3ba53e18a0c
15f02765a5e2a7304f8d09e6fd4680db 55357f038cfa2a2111d39bf85fc8e1c5 9292aebc9a3c8fff8fae7aca768c7c65 dd1ff4f30d973b197f5b6be99cd90ef8
1643dc012e773fdc958b18772cb7a0fd 5575acf47e7136be13904d17cbdde7df 9353c488e11ea4a6f34e15fd400295a2 ddbcacfbebe9567b4b24493987aef7e0
172507353b3e50cd85063193e57f4b31 560dc69961e17c9e7aec56efd54592a1 9665b317a971a8fba55a87d133f76a0b de67a791e638a8dc2edaf08689166dfe
185a202939d8cb7b736ef877d34aaf00 563125796844d92f95c1ed9cb54a7d91 966a49f9f30e0b839b57ec07cacc6e81 dea3a2b4c83390753e3f2ff2c344d188
1a99c88a9077c13efda71faa8f50d74e 571395947eadde4abb2c2a345bc0e1d9 96e3b6f63a6c69986d19bbd479638215 decf1c0192fb9ee532bfdf1cb9416ef6
1aa0f3c275fb60f40b9371b0d857a1f4 596d9bdef491911f18b298424ddbf58c 9787336bf9d081f4caa811f8353f7340 deeced7d2d3c426dee61e60672ee3a50
1b27431c5f1737349ad5e140924b8a69 59d07845b020f526f54479926765d804 97d35e888eb9688b1f6da0d42273bf4a df150b45796b10bb8bc110c670fa9bc8
1ba5f9b8715cc23ac19e7434769c6696 59d3b3bee0b78302571e25fcc62c27e1 989e0612e82919b8908c7aa46a26edbc df345b3351b6df05bd059be9a9cb2ea5
1bc292a9c6fe12046f3f7ac75d5dfddd 59e743d53d48807e3b6f5991cf41eb06 98b2a94047030f0abd8f6ac89aa6bfc3 df93ae0521b06819b442473c73e992bc
1bc45f933262092576fab48198f35fa5 59f2520b28b6c23519793c5451090aad 98f5ef89a54f3ea65d20130d9abe2f82 e09f180fb8c16c183fc55787cc97bbed
1bd0dfea4d1252f5277e25515ec45a7e 5a3a13a2aa39b4a804baf16db7f66f95 99280334868ee3032819a26a1600f723 e0d1d1d4d8967f89e668b8929f76c65d
1c13572093eb1433481f2584f90c331f 5aaffe94ac2d17bbe3f8f158fea42ec6 9a4e32541908fda8b88debf96ce14679 e267186c0f088a884b0044a64669a5e8
1c16868d78fd1feb6b033533b571465c 5b6d8a968e03eb6b34d65606c34b9aee 9b0bd36ef752f43da7bc5db86980fb7f e306f8b2c17404b64055acdf24a8610b
1d3f97e4b47698b4f167557f9a6efbbd 5b84b1f80dacad44a802c23a202c1833 9ccc5b272bcfeba28903fbaaee5bef82 e31ada7de97efb9854c2ebc32e396cea
1d8a3dc63ccd8740444ab5d628994acf 5b8ace311e8568c3a6000c1cd4af8bd8 9da1bc83ce91073387344d94d62ab588 e3ca074bca3449c0d7c16388ff554bb2
1e256c4c4604f7991a951c87328911f3 5c398a63a48895097edf6a802f7fc7b2 9dd2242d3b1e7ea345076ffcaed7e697 e42bd1305fab7f08e4e2124403d5243a
1e3cde9fb08fa9f1a1edec32fb7699df 5c4f3f3c2f7475df291b42b4bcdb6574 9ddd3e084b734a862d8b38fa585a379d e444af5ff8f8fdafb85aa7e7556c0cd7
1e4ce54412ee2512fa91bd0912fb8c3d 5c9833068dbbfd4506a86877109cf3c1 9e18b5e61b8d8e514bc31543a0f238c7 e54b1f4f5ca3fbceaed4717674e7905f
1fa981e2f5066e94e475447cec9b8eeb 5d65eca052c9a4efc4e8243ddb2eed84 9e25920b0a91c8ae292b7c0139caa0a2 e5ab36230422c480f62cca52973dee34
2003adceaf78a3a88b8ee0c418529306 5d9ded0c7899b1b749a6598a65a15cf2 9e617843a88ef0af374947060e9e74ac e66843b155225f4ecfa3e9d0e1b932f0
20e36a396c30c8a5f0266223b39ca2c0 5dbcc2bf4537a98ecd63861bd3dd5141 9fc917f809048283e695e17357fea707 e7b7d6f2b04fb09c779ecc0be21b2bd8
2124ebe405bf1dee64170cda12e93173 5e224a6ae38d9b799ab59b1153239563 9ff73d1c75fbbbbf015eb2971355f5c6 e7ebe045afe18f4856967a241572e226
227df9b3ffd91c1657557af74e2d375f 5fdb957e65e4c2cb2fe43386336b5cfd a0390cfb7c5a06551b9005de70d88228 e86ec421cf2f9d261be5766e49e97fff
236282461bbd213c7aa100df5f933427 60134a92ee1772d47e7c096a479b1b85 a066b22f6e91097bc67ccd3b0ef675e7 e93c4702f516b91bc5a315a5dca84b6b
23cede97d2ea840d4a2648eab9e29b49 604e0d30ed8eaa437439284dd3b47e50 a137a4ecc576c838e96a274e2066c06a e949afa837b59dc0d5a7eb29d08d7210
2418e16a827c0ef01c5ed14f8d6138f6 6083c5d37ece3403b606b1efbbb03be5 a1760f57d8f1e6fc2a11f0f438eaf5ec e961fc7fc5e4850ca40fff320646bd23
2448c46a9cc0b3b9ceae7e89dd0ebc46 60e76286eeb26d1236d06b72c77918c1 a4b305457e7a4e717912e2fd51bb74fd e99ba22a764b31a6997ccf3aa7259ea8
24b98f5105b1521ab6da2d8a354e5806 61bb16c54b6f1c217bbb2d122dd6ba08 a56941d55b63144c29a0fe7da79e9123 e9e25a1ede0c152d3259b042e96a5f4c
24ef70171b4a5dffcf10b6f7818313aa 62937e71ae5566884cbdc984a8ad4156 a594ed47a4de91dffe4778e83ddc584d ea9b3e698623d1e206f3725fc3fcb120
253f1874750b14792af380f79ff31c0a 629c07530536d701fc266826f3cfdf14 a5f5bd514b042e6ad8ed1fe9ef039630 eb1f8373208aefae20356f9a9276190b
25a3938ade3c8a843f9a00f367c7c955 62ffd79d2866365f4cb6bc4201e14d75 a6de53b408e1256c59d1c59dcbbae10b eb4a3fe5451679b5816d189209e305e7
25a91c14c272a868947c640ebe318e90 65c1acd75003b18228adad66bdc60546 a8f82f2ad0274fec83f4c2aa5f65986e ec1f524cef0c6c6a9be5d9ec8c8335d6
25efcde2f2fdb2180e142adc9b8210a5 660c8f895fb0592de5b10c5aecbc0afa a99edb21e9b41a9fc2e6a9d21ca9dcbe ec5790667a6168b0bdc229c6f580347b
264fdfd38be0262d6273d22a10be8a65 661fc6060012b4cc359729d38455b327 a9fcb93148c9a84bb44b2a8648291fcf ec82cd6045b2a8ac954d6b6d52e1540e
2737c1c0d5e0955705086b289a6c07fd 670250e7f2a47264c3447b85344679cb aa2ebc08a20c77cde35197973133d4ab edb33ca16036ab1076bb12013b3799c7
275aea7925ada3d1064442cdd70c85ae 67a95e4017c68d6165ab140c037c8c38 aadd7ee32896b9d462048437ef6362ab edcb088759aace567b105c431ec8f5b9
282c0c541a6e4dba72229d5a45ec5f15 68de695132ddd80d07e18357cdc59875 abdfb4f4cb70d24fd065185f787afa81 ee59d0b44d292f2d10e7334c6a365f5c
2845e38ca606d92bbae7703933473d3e 69ce500213c2d3532219fdc461a6f5b1 abf13e218f9ac6770e130f2cdf8df6d0 ee5b377fa8cf4ed6aa8869e79d79f787
28bd5b1550289d8e1e2b009bb5839169 6caa0e5b391e1ba729387137629c4bb1 abf57ab88fc8fcaca090ec25a278aa0d ee7120c9e3dd62bda0f0ca03fd905ad3
2a80b23c369b2e8e2a9dd2ab9ed52539 6cac3fbac016f58b554c9c42bec563b8 ad23b6d91e74af64529a8a547005e745 ef44dba4c4712ff5a66e4625c7c6c4af
2adf79d6a98425ce1641e3e02b778fe2 6eac4c632d6c1e232a869c3f176e5763 ae94717e8fcd455de0d63c47953cdb51 f02a17a85ceb7996ae4f0185f4023143
2aed851c26f4c4ba54a63d57abedef4b 700429bcbfafd3a3def489a427568d66 ae9d5d497d8b7bf93c93ff769040fc6c f096bbbbd5d8ce8684eb7074bdcea9e3
2c1ff6f7d8356bf4c585e11ab7d01c79 706d2fee6062ccd2d6a468cbe5076b71 aec0e3f388491bcf424c49f063f43cb2 f0f5271615b2f05b229922ff35ad40d5
2c9b8ad03467ab0307e15376c5075798 71198db33dcaff531c9074063aac7a96 af6195347b60139eaadde2ef86e7eb4c f177d6e27e279206a1c83a8a34491dea
2cf71ddf4c69bbfb162ab546b5c3c226 71b064ad7bf71131c44363d9e92cb8df b01defee71f5a549083edeb60de31798 f23396a600bc031ff53fc1b4efef98e8
2db0ab9f95c3182fb44d2700bcf0c315 71e34875ae3d53f7647d8e2783459ceb b0405f9208938fe297e083e5822ae027 f2b7b0e41a0e79b42b7c9ee9711a9492
2f6f580668741b451bf0f3fcaafa54dd 71ed6dd1cf2635fad7a7fb806be17149 b0521abca3f040680591d76166b57552 f2e6b062afa197f60ea434772926a7ce
2fd126dc777bc39af26f0608b1bb162b 72365be2a589f28e7b80e45be1ce39d9 b0cc3e62388621745090c6ea096b05b5 f332f00a2dc274bd735468882a43bb72
2ff12fea157a550b462e5aba7705d20f 72dc77d9739f96adf0b5ee19016aded9 b0d3c66fd989ea12e6fd6a6d5dd94aab f3929a72c0abea5e31b320413dbc9c05
307327b5c490c6707069d61ce58c970e 7341d1416ddaa1b26b42f318fed63e35 b1a3f6f8068994d588a80b6f5014d508 f3a64145296ad92137dd66adf2399b67
30815c48f9106da400b78acc7b76c793 73df37c6da99fd95f17bc16f475f0a62 b1a742b502fb5f2de02e4dbef2acecd4 f4bfec2d7ad5a4d67e40e83409e2ee1f
3357f6e86ed44b089478863434367aa3 74bad0c8ae412877d7b6b0f26b89c743 b23aeaeb8e744e32ee873ee5ebc0dbdc f5a7da23e5b7d602949cf935dafa9e96
342643c2a9d0238bd57786b1ab0f840d 76c0022b61008d9d81debdcd53a806b7 b2dc3811485266c5ea74cc58863698f7 f5e09e0f9699217e56332af2a857e225
345ee73be042c6bb8981a692d2c21253 76caf0f0ea1638270404e8c73f17a74a b4c3d3001c28cad2e0bb41575019d2f2 f6aaeeaf54a5c415e7f391ed392b055d
34717b30367c2d48783350eaa92034ee 771f09935ff51e9a9d19df4eac3d5ca9 b4f6c63bad9de2ab63e626a547ad9d70 f73fbf4b58880a0af04205d35e85bc6e
34e9db147a388b66cd4d9fd3f8fcc1d7 7725d7dc50d8e48dcaff5cb5d06392c5 b557e6cfa0b1428be262dd09bfb22c4b f8046bda69e4ec68ecd00cbb4930817c
35271bc783bee496173b6d752a708d67 77b171827904bbfbb5b012889406eeeb b5a81d482c0b02114a3f4502cc60cb53 f819c0df0e65f566dcc60d6daffa1fa2
35415e32ed8c6443f5b41d1cc79a76b1 77ec57fc0f5f887e478ba41c44ef2728 b5afa7a5b016795e47ac63169fc02eda f824052c4db119db29df42c8b651860d
364fd7755545d46b6cf5fd0aef8ec77e 782c37debea6762fdcacebcc4eb9e818 b7219ee96c86a164e539e3473a5a3c7c f869859c2bd5598277a2baa9d922745e
36685d2416ec26a5292eebfa4e402272 7837228ae924b204a9aa194afa2fd875 b85ceb0ea1492422e2cf4719a93b45fa f87e4c6fb1438626c460f6696bd71f71
36837990a6517b7626dec18e7644890f 78c6297b5b91c4c0fecdadc721fe539c b882b1ebcafb94abf84398a4df06f701 f8fdd974ef498c6dd27a23794033fae7
376af8a3beb25eead3812c02099bea13 78ed78c03d0e409300fbf83da33d88d0 ba4122d50bd27e7fca6f5f66ca03aba5 f9a59dccc80e674858930541886de9fe
3852f87da5f6c1bc1dfdff086f62a937 79369fc4109548195f02c99695c8369c bb2343243a2c9ab6405c9881e4a2c61f fb4d7bde5b00135d6adb89e7572e81fe
38920e4dfdf3bfc3b6ad4bf3752fe465 7af964c5bbdcf42090e739f2c05602b1 bb94ee02b5974b2b4668eea7f08108f2 fb7c4a60177160bbfe3bd25d70dabdf0
38c3602f2a2b3f70ec715b2766d87c34 7c05425dbd712d3b9d347ac4f8a1e093 bd5d6f85a04457c9ae2e4a20ddc4a151 fb86abbc9a9796614d94474ef72c19d7
38f71668a4176be23a68984c72d5d79d 7c290c1293be108483c9de0b62353953 bd64fa75d4e0e89e343083c9e5c31aa1 fc710f8ed2d8e90c74113170cd014bd7
39a6b926c85bd5dbc86f702454825961 7c5bd456af2ee4b703e04e4acad2d0aa bec0a4af16ed0eb7f51bcf4e1b84eca5 fd27b8e76030ea91120b32bf02c5a5aa
39de878de77a64cf6c6045d27cac8a6f 7ccb241082b7e8176ae30ccf5959cd3c bf1689a87825484deaeb08b9f5dcd451 fd30dd3b5e204ef986998856096b1ad8
39e1c20ffd5771a017cee8e5a369b492 7d1d8339d8b27142bfd4b53cdb648b7c bfaadc9b462345b0047be0c6063d2417 fd5fd8222804092ead097005ffc10e9c
39f25cd0182a062b5f9dcf90c25d44f0 7de9ec00aa5d13d95a8c720cc3bfa850 c0d63e8c43f3dc1f8cce0feba388778d fdeadda9aacce44b90a6547767041735
3a240c067d2f8bac27621db322ded861 7e8302d161272bc1524a85e26bad6c79 c1a9829feccc6298a8f4c641e2115c73 fe4eebb5da4be1139ea4cd7c19b63c1b
3a27e4d503fb0eeda4bb18625ac8ab30 7ef0adb20251ad82d51741ce78fa3235 c2557cf1f22b627751e35f7e0240e31d fe557c6d762ac781d7029f518834f1fa
3bbc0f9d01ddfc2c29265dfd4e7af497 7f15397bdfacec3fa4e2b174c26a39f0 c2f4d0e3eb875ecab1c1940543fe7de2 fee9c9a0842fa23016623bcbad29fc35
3be245ca03a1a74a3817b3db22487c9f 7f9339dbc82783eac467c4e76eee2f6f c41899d1eaa9113aa2934f0a941fd710 ff1ed616bd63e5b6e5677752113b2bd9
3c0e03f707bf8cbecaab263e1dbd60a4 7fb51bd339cb14134c163aa667a80b7b c46354de9b77861b9d2f5f09e1bd2d84

I hope this doc helps you out

June 23, 2009

Upgrade a running Ubuntu installation

Filed under: Server Technology,Unix Administration — admin @ 12:41 pm

This is what I had to do to upgrade a running installation of Ubuntu 7 to Ubuntu 8 on the fly.

mv /etc/apt/sources.list /etc/apt/sources.list-bak
vi /etc/apt/sources.list

Put the following lines in your sources.list file, save, and quit

#deb hardy main
deb hardy main restricted
deb-src hardy main restricted
deb hardy-updates main restricted
deb-src hardy-updates main restricted
deb hardy universe
deb-src hardy universe
deb hardy-updates universe
deb-src hardy-updates universe
deb hardy multiverse
deb-src hardy multiverse
deb hardy-updates multiverse
deb-src hardy-updates multiverse
deb hardy-security main restricted
deb-src hardy-security main restricted
deb hardy-security universe
deb-src hardy-security universe
deb hardy-security multiverse
deb-src hardy-security multiverse

Run the following,

apt-get update
apt-get dist-upgrade

Follow the prompts, and wallah! You're done!

April 28, 2009

Compile Bind 9 on Ubuntu / Debian

Filed under: Server Technology,Unix Administration,Web Hosting — admin @ 1:09 pm

Quick, and dirty:

apt-get install libssl-dev
./configure --prefix=/opt/bind9 --with-openssl=yes --sysconfdir=/etc/bind --with-randomdev=/dev/urandom
make && make install

Setup the named.conf, options, loggin, and zones


include "/etc/bind/named.logging";

include "/etc/bind/named.options";

        zone "." {
                type hint;
                file "root.cache";

include "/etc/bind/named.master";

include "/etc/bind/named.reverse";


logging {
        channel "querylog" {
          file "/var/log/query.log";
          print-time yes;
        channel default_log {
          file "/var/log/named.log";
          print-time yes;
        category queries { querylog; };
        category default { default_log; default_debug; };
        category lame-servers { null; };


acl "toddsmithorg_networks"  {; };
acl "client_networks" {; };
options {
        directory "/var/named";
        pid-file "/var/run/";
        allow-recursion { toddsmithorg_networks; client_networks; };
        version "no thankyou";
        notify no;
        listen-on port 53 {
        allow-transfer {


zone "" IN {
        type master;
        file "";

Setup your init script

#! /bin/sh


case "$1" in
        echo -n "Starting named... "
        $NAMED_ROOT/sbin/named -u named -c /etc/bind/named.conf && echo OK
        echo -n "Stopping named... "
        kill -15 `cat /var/run/` && echo OK
        $0 stop  &&  $0 start
        echo "Usage: $0 {start|stop|restart|reload}"
        exit 1
exit 0

This should get you started

April 23, 2009

Compile a Linux Kernel on Cent OS

Filed under: Server Technology,Unix Administration,Web Hosting — admin @ 10:22 pm

The CentOS Way

Install the development utils, libs and headers

yum install gcc gcc-c++ kernel-devel ncurses-devel rpm-build

Grab a new kernel

tar zxvf linux-
cd !$

Make sure you enable support for at least the hardware in the machine you’re compiling the kernel on (safe bet). You can use the lspci command to figure out what that is

[root@c1024 linux-]# lspci 
00:00.0 Host bridge: Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller (rev 10)
00:02.0 VGA compatible controller: Intel Corporation 82G33/G31 Express Integrated Graphics Controller (rev 10)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 01)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 01)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 01)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)
00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01)
00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01)
00:1f.2 IDE interface: Intel Corporation 82801GB/GR/GH (ICH7 Family) SATA IDE Controller (rev 01)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E PCI Express Fast Ethernet controller (rev 01)
[root@c1024 linux-]#

Create your kernel config. (If you already have one, just create a new file called .config and put your kernel configuration in it.

make menuconfig


make config

Once you have completed your kernel configuration, you can build the kernel and create an RPM for installation on other hosts. I have a Core2Quad CPU in this system, so I’ll set the number of jobs to 5 -j5

make -j5 rpm

After it has built (without errors) you need to install the kernel from RPM, do a directory listing to see what the name of the file that was built is:

ls /usr/src/redhat/RPMS/`uname -m`
cd !$
rpm -ivh kernel-

Okay, now create an initial ramdisk for the kernel (initrd)

mkinitrd /boot/initrd-

Now edit your /boot/grub/menu.lst to include the new kernel and you’re all set!


April 18, 2009

Configure XenServer 5.0 Free for Software RAID 1

Filed under: Server Technology,Unix Administration — admin @ 4:35 pm

I used the notes from some guy on the Citrix forums. I wish that I had his name so I could give him credit but it’s not here on the stuff I printed out.

On with the show.

To make this work, you need to drives in your system. The second drive must be identical or larger than the first, and you must have installed XenServer to the first drive without selecting the second drive as part of the storage pool.

Install XenServer as usual. Do not select any extra drives as storage pools.

After installation, boot up, and login into console 3 (Alt-F3) as root

type fdisk -l to list the partitions:

Most likely your disks are represented by SCSI device names under linux / XenServer 5.0

in that case your boot disk would be /dev/sda,

To copy the partition table from /dev/sda to /dev/sdb you can use dd

dd if=/dev/sda of=/dev/sdb bs=512 count=1

Now set the partition table up on /dev/sdb the way it should be for Linux RAID. This means setting the partition types to 0xfd.

I used the following command:

echo -e "\nt\n1\nfd\nt\n3\nfd\nw\nx" | fdisk /dev/sdb

That tells says to fdisk, “tag partition 1 as type 0xfd, tag partition 3 as type 0xfd”

Check to make sure the /dev/md? devices are present

[ -e /dev/md0 ] || mknod /dev/md0 b 9 0
[ -e /dev/md1 ] || mknod /dev/md1 b 9 1

Startup the degraded RAID devices

mdadm --create /dev/md0 --level=1 --raid-devices=2 missing /dev/sdb1
mdadm --create /dev/md1 --level=1 --raid-devices=2 missing /dev/sdb3

The following procedure is directly from the other guys notes. I’ve modified the commands to what I think works a little better.

pvcreate /dev/md1
volume_group=`vgscan | grep VG | awk -F \" '{print $2}'`
vgextend $volume_group /dev/md1
pvmove /dev/sda3 /dev/md1
# If this is a fresh install, then there won't be any data to move
vgreduce $volume_group /dev/sda3

Now we’re ready to copy the filesystem over to the RAID device /dev/md0

mkfs.ext3 /dev/md0
cd / && mount /dev/md0 /mnt && rsync -a --progress --exclude=/sys --exclude=/proc --exclude=/dev/shm --exclude=/dev/pts / /mnt
mkdir /mnt/sys
mkdir /mnt/proc
sed -r -i 's,LABEL=root-\w+ ,/dev/md0 ,g' /mnt/etc/fstab

Now let’s setup initrd

mkdir /root/initrd && cd /root/initrd
zcat /boot/initrd-`uname -r`.img | cpio -i && \
cp /lib/modules/`uname -r`/kernel/drivers/md/raid1.ko lib

Now we have to edit the init file

q="echo Waiting for driver initialization."
sed -r -i "s,^${q}$,\n\necho Loading raid1.ko module\ninsmod /lib/raid1.ko\n${q}\n,g" init
q="resume /var/swap/swap.001"
sed -r -i "s,^${q}$,${q}\necho Running raidautorun\nraidautorun /dev/md0\nraidautorun /dev/md1,g" init
r=`grep mkroot /root/initrd/init`
sed -r -i "s|^${r}$|${r/sda1/md0}|g" init

Now we’ll copy the initial ramdisk to the /boot on the new RAID

find . -print | cpio -o -c | gzip -c > /boot/initrd-`uname -r`.img
sed -r -i 's,LABEL=root-\w+ ,/dev/md0 ,g' /mnt/etc/fstab
sed -r -i 's,LABEL=root-\w+ ,/dev/md0 ,g' /etc/fstab

And setup the boot loader

sed -r -i 's,root=LABEL=root-\w+ ,root=/dev/md0 ,g' /mnt/boot/extlinux.conf
sed -r -i 's,root=LABEL=root-\w+ ,root=/dev/md0 ,g' /boot/extlinux.conf
cat /usr/lib/syslinux/mbr.bin > /dev/sdb
cd /mnt && extlinux -i boot/
extlinux -i boot/

If you’ve done this remotely, you can try the following.

cp /mnt/boot/extlinux.conf /boot/
cp /mnt/boot/initrd-`uname -r`.img /boot

Unmount /dev/md0, sync, and reboot

cd ; umount /mnt || umount /dev/md0

First we tag the partitions as type Linux raid, then we have to add /dev/sda to the RAID.

echo -e "\nt\n1\nfd\nt\n3\nfd\nw\nx" | fdisk /dev/sda
mdadm -a /dev/md0 /dev/sda1
mdadm -a /dev/md1 /dev/sda3


The first time I did this procedure I got stuck because my rsync didn’t copy /proc and /sys like I asked it not to. So I had to add the step of creating those two directories so they could be mounted at boot.

After messing around with it a little, I came up with this command line to boot XenServer 5 from extlinux.

mboot.c32 /boot/xen.gz dom0_mem=752M --- /boot/vmlinuz-2.6-xen root=/dev/md0  single --- /boot/initrd-2.6-xen.img

April 17, 2009

Intel AMT bios support

Filed under: Device Configuration,Server Technology — admin @ 12:51 pm

Intel AMT, allows enhanced hardware-based isolation and recovery for embedded systems that go offline, and the Intel® Rapid Recover Technology, which allows embedded devices to recover data and return the system to an operational status in the event of hard drive failure or massive data corruption.

Intel VT-d Bios Support

Filed under: Device Configuration,Server Technology — admin @ 12:50 pm

A technology in the Intel Q35 chipset; Intel VT-d, provides advanced remote management capabilities for I/O devices. The technology enables partitioning of I/O devices to virtual machines to distribute system resources and protect assets. Intel VT-d will improve performance by increasing the bandwidth and lowering the latency attributed to software virtualization. Industrial automation applications and network appliances are two key segments that could benefit from this technology.

March 21, 2009

Sendmail and smrsh nightmares

Filed under: Server Technology — admin @ 7:52 pm

I spent a good hour or almost at least trying to figure this out. What a pain….

Basically, I was trying to setup the ability for Ubersmith to receive mails to the alias that they have you create during installation. For most installations this should probably be pretty straight forward:

But I kept getting this error in my mail.log file:

Mar 22 01:37:38 support smrsh: uid 25: attempt to use “php -q -f /vhosts/support.domain.dom/htdocs/cron/gateway.php support.domain.dom 1″ (stat failed)
Mar 22 01:37:38 support sm-mta[22733]: n2M1aRGF022722: to=”|php -q -f /vhosts/support.domain.dom/htdocs/cron/gateway.php support.domain.dom 1″, ctladdr= (25/0), delay=00:00:36, xdelay=00:00:00, mailer=prog, pri=13679, dsn=5.0.0, stat=Service unavailable
Mar 22 01:37:38 support sm-mta[22733]: n2M1aRGF022722: n2M1bcGG022733: DSN: Service unavailable

Here’s our mail alias:

support: “|php -q -f /vhosts/support.domain.dom/htdocs/cron/gateway.php support.domain.dom 1″

So the usual solution would be to do the following:

cd /etc/mail
ln -s /path/to/php php

However, that wasn’t working…. Most likely because my php executable is not in some search path for smrsh.

Finally I discovered this /usr/adm/sm.bin!

root@support:/usr/adm/sm.bin# strings `which smrsh` | grep usr

Well, what have we here? /usr/adm/sm.bin looks a little foreign to me.
Obviously the second line is my hard-coded path, which it looks like smrsh thought it was on a sun platform during compile time, but whatever….

So let’s have a look at the docs… They read…

If your platform doesn’t have a default SMRSH_CMDDIR setting, you will
next need to create the directory /usr/adm/sm.bin and populate
it with the programs that your site feels are allowable for sendmail
to execute. This directory is explicitly specified in the source
code for smrsh, so changing this directory must be accompanied with
a change in smrsh.c.

Let me try that. It’s worth a shot.

mkdir -p /usr/adm/sm.bin
cd !$
ln -s /opt/bin/php
ls -aFl

root@support:/usr/adm/sm.bin# ls -aFl
total 0
drwxr-xr-x 2 root root 72 Mar 21 18:39 ./
drwxr-xr-x 3 root root 72 Mar 21 18:38 ../
lrwxrwxrwx 1 root root 24 Mar 21 18:39 php -> /opt/bin/php*

Now my mail.log looks a little bit more like expected….

Mar 22 02:47:44 support sm-mta[23613]: n2M2jvox023571: to=”|php -q -f /vhosts/support.domain.dom/htdocs/cron/gateway.php support.domain.dom 1″, ctladdr= (25/0), delay=00:01:12, xdelay=00:00:01, mailer=prog, pri=5357, dsn=2.0.0, stat=Sent

I hope you found this helpful

March 17, 2009

Linux iSCSI target compile HOWTO

Filed under: Server Technology — admin @ 5:27 pm

This will probably work just fine on other linux distributions as well such as Fedora, CentOS, and even Slackware. These notes are from my installation on Ubuntu Server 8.10 (Intrepid Ibex) amd64. Btw, this server will act an an iSCSI Target for Xen Virtualization.


  • All major server distributions support iSCSI
  • iSCSI is based on open standards
  • iSCSI is often a requirement for people setting up virtual machines
  • iSCSI is the most inexpensive way to build a SAN

The question is now do I go with LIO or IET?

EIT appears to me to be the most mature software. I’ll use it.

So I download it from sourceforge: iscsitarget-04.17.tar.gz

I want to build this on a solid fresh base, and so I’ll do an apt-get update and an apt-get upgrade to make sure I’ve got all of the latest software, libraries, and header files.

Turns out that on this installation of Ubuntu Server, I don’t have “make” installed.

I’ll use apt-get install build-essential to update my system with all the goodies that I’ll need to build the system. Stuff like gcc, make, binutils, g++ and so forth.

I extract the iscsitarget to /usr/src, and cd /usr/src/iscsitarget-0.4.17, and issue the make command.

I get an error right off the bat:

chap.c:20:25: error: openssl/sha.h: No such file or directory
chap.c:21:25: error: openssl/md5.h: No such file or directory
chap.c: In function ‘chap_calc_digest_md5’:

Looks like I need the openssl development headers installed. Simply: apt-get install libssl-dev

Let’s try make again. Okay another error, but we’ve made some progress:

make -C /lib/modules/2.6.27-7-server/build SUBDIRS=/usr/src/iscsitarget-0.4.17/kernel modules
make: *** /lib/modules/2.6.27-7-server/build: No such file or directory. Stop.
make: *** [kernel] Error 2

Let’s try again: apt-get install kernel-package linux-libc-dev linux-source linux-headers-`uname -r`

Is it there now? /lib/modules/$(uname -r)/build

Yes! apt-get is so cool!

For Redhat/CentOS based OSs try yum -y install gcc openssl-devel kernel-devel

Try again: make clean && make

root@opennas-kc01:/usr/src/iscsitarget-0.4.17# make clean && make
make -C usr clean
make[1]: Entering directory `/usr/src/iscsitarget-0.4.17/usr’
rm -f *.o ietd ietadm
make[1]: Leaving directory `/usr/src/iscsitarget-0.4.17/usr’
make -C /lib/modules/2.6.27-7-server/build SUBDIRS=/usr/src/iscsitarget-0.4.17/kernel clean
make[1]: Entering directory `/usr/src/linux-headers-2.6.27-7-server’
CLEAN /usr/src/iscsitarget-0.4.17/kernel/.tmp_versions
CLEAN /usr/src/iscsitarget-0.4.17/kernel/Module.symvers
make[1]: Leaving directory `/usr/src/linux-headers-2.6.27-7-server’
make -C usr
make[1]: Entering directory `/usr/src/iscsitarget-0.4.17/usr’
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o ietd.o ietd.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o iscsid.o iscsid.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o conn.o conn.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o session.o session.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o target.o target.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o message.o message.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o ctldev.o ctldev.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o log.o log.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o chap.o chap.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o event.o event.c
event.c: In function ‘handle_iscsi_events’:
event.c:86: warning: format ‘%#lx’ expects type ‘long unsigned int’, but argument 4 has type ‘long long unsigned int’
event.c:91: warning: format ‘%#lx’ expects type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o param.o param.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o plain.o plain.c
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o isns.o isns.c
cc ietd.o iscsid.o conn.o session.o target.o message.o ctldev.o log.o chap.o event.o param.o plain.o isns.o -o ietd -lcrypto
cc -O2 -fno-inline -Wall -Wstrict-prototypes -g -I../include -D_GNU_SOURCE -c -o ietadm.o ietadm.c
cc ietadm.o param.o -o ietadm
make[1]: Leaving directory `/usr/src/iscsitarget-0.4.17/usr’
make -C /lib/modules/2.6.27-7-server/build SUBDIRS=/usr/src/iscsitarget-0.4.17/kernel modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.27-7-server’
CC [M] /usr/src/iscsitarget-0.4.17/kernel/tio.o
CC [M] /usr/src/iscsitarget-0.4.17/kernel/iscsi.o
CC [M] /usr/src/iscsitarget-0.4.17/kernel/nthread.o
CC [M] /usr/src/iscsitarget-0.4.17/kernel/wthread.o
CC [M] /usr/src/iscsitarget-0.4.17/kernel/config.o
CC [M] /usr/src/iscsitarget-0.4.17/kernel/digest.o
CC [M] /usr/src/iscsitarget-0.4.17/kernel/conn.o
CC [M] /usr/src/iscsitarget-0.4.17/kernel/session.o
CC [M] /usr/src/iscsitarget-0.4.17/kernel/target.o
CC [M] /usr/src/iscsitarget-0.4.17/kernel/volume.o
CC [M] /usr/src/iscsitarget-0.4.17/kernel/iotype.o
CC [M] /usr/src/iscsitarget-0.4.17/kernel/file-io.o
CC [M] /usr/src/iscsitarget-0.4.17/kernel/null-io.o
CC [M] /usr/src/iscsitarget-0.4.17/kernel/target_disk.o
CC [M] /usr/src/iscsitarget-0.4.17/kernel/event.o
CC [M] /usr/src/iscsitarget-0.4.17/kernel/param.o
CC [M] /usr/src/iscsitarget-0.4.17/kernel/block-io.o
LD [M] /usr/src/iscsitarget-0.4.17/kernel/iscsi_trgt.o
Building modules, stage 2.
MODPOST 1 modules
CC /usr/src/iscsitarget-0.4.17/kernel/iscsi_trgt.mod.o
LD [M] /usr/src/iscsitarget-0.4.17/kernel/iscsi_trgt.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.27-7-server’

root@opennas-kc01:/usr/src/iscsitarget-0.4.17# make install
`usr/ietd’ -> `/usr/sbin/ietd’
`usr/ietadm’ -> `/usr/sbin/ietadm’
`etc/initd/initd.debian’ -> `/etc/init.d/iscsi-target’
`etc/ietd.conf’ -> `/etc/ietd.conf’
`etc/initiators.allow’ -> `/etc/initiators.allow’
`etc/initiators.deny’ -> `/etc/initiators.deny’
`doc/manpages/ietadm.8′ -> `/usr/share/man/man8/ietadm.8′
`doc/manpages/ietd.8′ -> `/usr/share/man/man8/ietd.8′
`doc/manpages/ietd.conf.5′ -> `/usr/share/man/man5/ietd.conf.5′
install: creating directory `/usr/share/doc/iscsitarget’
`ChangeLog’ -> `/usr/share/doc/iscsitarget/ChangeLog’
`COPYING’ -> `/usr/share/doc/iscsitarget/COPYING’
`README’ -> `/usr/share/doc/iscsitarget/README’
`README.vmware’ -> `/usr/share/doc/iscsitarget/README.vmware’
install: creating directory `/lib/modules/2.6.27-7-server/kernel/iscsi’
`kernel/iscsi_trgt.ko’ -> `/lib/modules/2.6.27-7-server/kernel/iscsi/iscsi_trgt.ko’
Running depmod

I run the start command: /etc/init.d/iscsi-target start && tail /var/log/messages

And I see good stuff:

Mar 17 00:09:22 opennas-kc01 kernel: [15876.392301] iSCSI Enterprise Target Software – version 0.4.15
Mar 17 00:09:22 opennas-kc01 kernel: [15876.392404] iscsi_trgt: Registered io type fileio
Mar 17 00:09:22 opennas-kc01 kernel: [15876.392407] iscsi_trgt: Registered io type blockio
Mar 17 00:09:22 opennas-kc01 kernel: [15876.392410] iscsi_trgt: Registered io type nullio


man ietd.conf

From the ietd.conf manpage:

/etc/ietd.conf contains configuration information for the ietd (8) command. This is the place, where you configure your iSCSI
targets and daemon defaults.

Only lines starting with ‘#’ are ignored. Putting ’#’ in the middle of a line is disallowed. A line may be extended across multi‐
ple lines by making the last character a backslash.

The “Yes” and “No” for parameter values are case sensitive. The parameter names are case insensitive.

The file consists of a global part and zero or more “Target” stanzas. Everything until the first target definition belongs to the
global configuration.

Here is an example:

IncomingUser joe secret
OutgoingUser jack secret2

IncomingUser jim othersecret
OutgoingUser james yetanothersecret
Lun 0 Path=/dev/sdc,Type=fileio
Lun 1 Sectors=10000,Type=nullio
Alias Test
HeaderDigest None
DataDigest None
MaxConnections 1
InitialR2T Yes
ImmediateData No
MaxRecvDataSegmentLength 8192
MaxXmitDataSegmentLength 8192
MaxBurstLength 262144
FirstBurstLength 65536
DefaultTime2Wait 2
DefaultTime2Retain 20
MaxOutstandingR2T 8
DataPDUInOrder Yes
DataSequenceInOrder Yes
ErrorRecoveryLevel 0

Stanzas start with the word “Target” and the target name. This name must be a globally unique name, as defined by the iSCSI stan‐
dard : the “iSCSI Qualified Name”. The daemon brings the targets up in the order listed.

In the following example configuration I used an LVM device (/dev/mapper/lvmxen-capacity–root) it could have been any other block device however such as /dev/sdb1.

IncomingUser toddin 012345678901
OutgoingUser toddout 012345678901
Lun 0 Path=/dev/mapper/lvmxen-capacity–root,Type=fileio,ScsiId=Sup3rSCS1D3V1C31

The IncomingUser is used for iSCSI initiator discovery, and outgoing user authenticates the iSCSI target server to the initiator client. Hint, the RFC specifies that the password must be exactly 12 characters.

I hope you found this HOWTO useful.

Older Posts »

Powered by WordPress