Pages

Showing posts with label jenkins. Show all posts
Showing posts with label jenkins. Show all posts

Friday, 16 May 2014

Sherlocking Mock based builds

Jenkins is frozen, waiting for something. One useful link is to look at ${JENKINS_URL}/threadDump. That reveals which thread is doing what.

Mine is stuck like this:

waiting for hudson.remoting.Channel@f7f725

Okay, I logged onto the other machine, and yes, it still has an open ssh connection to the guest. So log on to the guest, and look at the open files:

sudo lsof -i 4

Okay, I now know some PIDs: 775 and 790

Let's see the file descriptors:

sudo ls -l /proc/790/fd/

lrwx------ 1 root root 64 May 16 19:51 0 -> /dev/null
lrwx------ 1 root root 64 May 16 19:51 1 -> /dev/null
lr-x------ 1 root root 64 May 16 19:51 10 -> pipe:[7800]
lrwx------ 1 root root 64 May 16 19:51 2 -> /dev/null
lrwx------ 1 root root 64 May 16 19:51 3 -> socket:[7744]
lrwx------ 1 root root 64 May 16 19:51 4 -> socket:[7781]
lrwx------ 1 root root 64 May 16 19:51 5 -> socket:[7791]
lr-x------ 1 root root 64 May 16 19:51 6 -> pipe:[7798]
l-wx------ 1 root root 64 May 16 19:51 7 -> pipe:[7798]

Nice, I guess that pipe is the bad guy, but how do I know, what is that?

sudo lsof  | grep 7800

sshd        790         ubuntu   10r     FIFO                0,8      0t0       7800 pipe
udevd     30043           root    4w     FIFO                0,8      0t0       7800 pipe

All right, that means that I know a new PID...

sudo ls -l /proc/30043/fd/

Okay, that's nice, but what was the command line?

sudo cat /proc/30043/cmdline
udevd --daemon

Nice, now I need to look at mock and udevd.

Friday, 9 March 2012

Lettuce from jenkins

In order to see, that during the development that I deliver business values, I tried out bdd. Technically lettuce is driving mechanize, which is sending request to the deployed application. The whole stuff is controlled by Jenkins. Lettuce threw an error:


.../lettuce/terminal.py", line 82, in get_terminal_size_unix
    return int(cr[1]), int(cr[0])
TypeError: int() argument must be a string or a number, not 'NoneType'



It happened after Jenkins was started from init.d I performed the following patch:


--- lettuce-0.1.34-py2.6.egg/lettuce/terminal.py.orig 2012-03-08 17:47:21.959735489 +0000
+++ lettuce-0.1.34-py2.6.egg/lettuce/terminal.py 2012-03-08 17:48:23.649788786 +0000
@@ -79,4 +79,4 @@
         except:
             cr = (25, 80)


-    return int(cr[1]), int(cr[0])
+    return int(cr[1] or 25), int(cr[0] or 80)
Anyhow, it seems, that it has already been fixed:

Sunday, 4 March 2012

Blink Thinkpad's light as a user

I want to get some feedback from my local jenkins instance, so I decided to ask Jenkins to blink my thinkpad's keyboard light.
I can control the light as root
# echo 255 > /sys/class/leds/tpacpi\:\:thinklight/brightness
# echo 0 > /sys/class/leds/tpacpi\:\:thinklight/brightness
But my Jenkins is running with a root account. This is where udev comes to play.
# udevadm info -q all -p /sys/devices/platform/thinkpad_acpi/leds/tpacpi\:\:thinklight/
P: /devices/platform/thinkpad_acpi/leds/tpacpi::thinklight
E: UDEV_LOG=3
E: DEVPATH=/devices/platform/thinkpad_acpi/leds/tpacpi::thinklight
E: SUBSYSTEM=leds
I tried to do it with the MODE keyword - FAIL:
# cat /etc/udev/rules.d/80-thinklight.rules
SUBSYSTEM=="leds", MODE="0666"
For some reason it did not set the permissions. I think some concepts are not clear enough for me.
So I went on another route, created a shell script to manipulate the permissions
$ cat /sbin/led.sh 
/bin/chmod o+w /sys/devices/platform/thinkpad_acpi/leds/tpacpi\:\:thinklight/brightness
And run it from udev:
$ cat /etc/udev/rules.d/99-thinklight.rules
SUBSYSTEM=="leds", RUN+="/bin/sh /sbin/led.sh"
Ugly, but WORKS