[rancid] Ubuntu 8.04 LTS, rancid, and Expect 5.43.0-14

Chris Gauthier cgauthier at mapscu.com
Fri Aug 29 20:55:04 UTC 2008

Hi all,


In trying to track down what was ultimately a typing problem in front of
the keyboard, I've developed a set of steps to include the expect patch
in Ubuntu 8.04 LTS (Server Ed)'s expect package.  I've also tried to
submit this to the maintainer of the package, so we shall see what


A handy page I referred to for compiling packages:



Here are the steps:


1)      paco at test:~$ sudo apt-get install build-essential fakeroot

2)      paco at test:~$ cd /usr/src/

3)      paco at test:/usr/src$ sudo apt-get source expect

4)      paco at test:/usr/src$ cd expect-5.43.0/

5)      paco at test:/usr/src/expect-5.43.0$ sudo patch <

a.       Patch contents:

--- exp_chan.c.bak      2008-08-29 11:46:51.000000000 -0700

+++ exp_chan.c  2008-08-29 12:14:28.000000000 -0700

@@ -200,6 +200,11 @@

      * nonblocking, the read will never block.



+       /* Added next line as a patch to make rancid work. There is a
know bug

+        * with expect and rancid.

+        * See http://www.shrubbery.net/rancid/EXPECTBUG for details.

+        */

+       fcntl(esPtr->fdin, F_SETFL, O_NONBLOCK); /* patched line for
rancid */

     bytesRead = read(esPtr->fdin, buf, (size_t) toRead);

     /*printf("ExpInputProc: read(%d,,) =

     if (bytesRead > -1) {

6)      paco at test:/usr/src/expect-5.43.0$ cd ..

7)      paco at test:/usr/src$ sudo apt-get build-dep expect

a.       Just say "yes" when it wants to install a ton of dependencies.
You need this for compiling.

8)      paco at test$ sudo dpkg-buildpackage -rfakeroot -b

a.       This step could take a while, depending on your processor speed
and memory for compiling.

b.      Don't worry about the package signature errors at the end.
You're not the maintainer anyway. ;-)

9)      paco at test:/usr/src$ sudo /usr/bin/dpkg -i

a.       Your actual filename may differ, depending on architecture.
Adapt and move on.

(Reading database ... 46139 files and directories currently installed.)

Preparing to replace expect 5.43.0-14 (using expect_5.43.0-14_amd64.deb)

Unpacking replacement expect ...

Setting up expect (5.43.0-14) ...


Processing triggers for libc6 ...

ldconfig deferred processing now taking place

10)   That's it!  You're package is installed with a patched version of


Chris Gauthier, CCNA

Network Administrator

Marion and Polks Schools Credit Union


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20080829/39661c32/attachment.html 

More information about the Rancid-discuss mailing list