Wednesday, July 11, 2012

Sidestep bugs by running multiple versions of BusyBox on ESXi 5

I recently discovered that ESXi 5 uses BusyBox 1.9.1 which includes a bug in nohup.  Christoph Gysin identified the issue and released a patch 4 years ago:

http://lists.busybox.net/pipermail/busybox/2008-January/064029.html

/bin # nohup

BusyBox v1.19.3 (2012-01-13 00:47:40 UTC) multi-call binary.



Usage: nohup PROG ARGS



Run PROG immune to hangups, with output to a non-tty


Alas, I don't want to straight out replace my busybox on my VMware server, as I have no idea what else will break.

Unfortunately I really needed nohup to work properly, as my scripts would be running for too  long to trust that my session wouldn't close.   Furthermore, walking over to the machine and plugging in a monitor to access the console sounded like a hassle.  I could probably have just written it into a script and kicked it off with cron, but in the end, I decided to fix nohup.

The first thing I tried was scp over my version of nohup from coreutils to the ESXi box.  Alas, the whole idea of busybox is to simply the myrid of prerequisites that a modern linux system requires:

/bin # nohup2

nohup2: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by nohup2)


But the same idea with busybox works great.

/bin # busybox-1.19.3 nohup

BusyBox v1.19.3 (2012-01-13 00:47:40 UTC) multi-call binary.



Usage: nohup PROG ARGS



Run PROG immune to hangups, with output to a non-tty






You can see the broken and working versions here:

/vmfs/volumes/4f3e8959-c92ca33c-dc7c-00215e26146e # /bin/busybox nohup esxtop -b -d 3 -n 28800 >output1.csv &

/vmfs/volumes/4f3e8959-c92ca33c-dc7c-00215e26146e # nohup: appending to nohup.out



/vmfs/volumes/4f3e8959-c92ca33c-dc7c-00215e26146e # /bin/busybox-1.19.3 nohup esxtop -b -d 3 -n 28800 >output2.csv & 

/vmfs/volumes/4f3e8959-c92ca33c-dc7c-00215e26146e # ls -l

-rw-r--r--    1 root     root                  0 Jul 11 15:53 output1.csv

-rw-r--r--    1 root     root             159368 Jul 11 15:54 output2.csv





Now I just changed the sym link for nohup

/bin # rm nohup

/bin # ln -s /bin/busybox-1.19.3 nohup

/bin # ls -l nohup

lrwxrwxrwx    1 root     root                 19 Jul 11 15:55 nohup -> /bin/busybox-1.19.3


And we're in business with a working nohup, and everything else stock.

6 comments:

  1. Hi Chris,

    Thank's for this post! I searched for a while why my files was always empty!

    Can you point me where I can find the busybox binaries you are using?

    Than you,

    Eric

    ReplyDelete
  2. The binaries I used where the busybox binaries which were in the yum repositories for the fedora install I was using at the time. It was version 1.19.3. You could download from here and compile http://www.busybox.net/downloads/ but I personally would just install whatever version of busybox is in the repositories for your favorite linux distribution, and copy that over.

    ReplyDelete
  3. Gurgaon is business hub and is easily connected with the capital city of Delhi. Being regarded as the proclaimed business hub, Gurgaon is also a late night party hub for people who swear by the call centre or BPO environment of working. Escort services is Gurgaon are a rage among teens and business class people who just wish to have fun along with their already existing serious life. Escorts Service in Gurgaon

    ReplyDelete
  4. MAJOR168 is open for football betting today. There are many big camps together BTi SBOBET IBCBET CMD365 if you are looking for a football betting website. Do not miss this site, there is football, there are all sports in the world. คาสิโนออนไลน์. Betting is available 24 hours a day with the best odds per pair in Thailand. Guaranteed automatic deposit and withdrawal system 10 seconds.

    Live sports betting Online football betting Good price with every football match open for today online football betting SAGAME88 There are many big camps together, SBOBET IBCBET BTi CMD365, the only website complete in online football betting คาสิโนออนไลน์. There is every sport on the planet in here. With the automatic deposit and withdrawal system for 10 seconds, we have a live football system to watch every night.


    We offer a wide variety of services. Called him the only player to finish with everything else does not have to go to the web preview ufabet as online. Online casinos Baccarat online Online betting games, Slot online, and with new technology, you can play ufabet via mobile phone today. Mobile Baccarat, play online via the website


    Ufabet1688 of us again the way we are websites directly, not through a General Services, where customers will know it absolutely was extremely really no cheating possible on-site gambling online, it is ufabet1688 of us will hit prices.

    ReplyDelete
  5. UEFA BET , or UFABET, is a comprehensive online betting service website without any agents or agents. Which has a wide variety of games and sports to choose from Including many types of online casinos, UFABET can be considered as an online gambling site that most people prefer to use. Because with a website design that is easy to use and does not need to understand a lot In addition, this website also supports many languages, including Chinese, Hong Kong, Thai, English, so most users, both new and old, choose to switch to the service with สมัคร ufa Bet more. The best online gambling sites in Asia.

    ReplyDelete
  6. Internet slots (Slot Online) is actually the launch of a gambling machine. Slot machine As said before above Used to make electronic games called web based slots, due to the development era, people have left turned to gamble with one another by computers. Will draw slot games to make web based gambling games Via the web network system Which players are able to play through the slot plan or will perform Slots through the service provider's website Which online slots games are on hand in the kind of playing guidelines. It is similar to playing on a slot machine. Both realistic pictures as well as sounds are at the same time thrilling as they go to lounge in the casino ever.บาคาร่า
    ufa
    ufabet
    แทงบอล
    แทงบอล
    แทงบอล

    ReplyDelete