Quantcast

Running a jenkins slave node on ubuntu as a service

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Running a jenkins slave node on ubuntu as a service

imker25
This post has NOT been accepted by the mailing list yet.
Hi guys,
im pretty new to java and jenkins and also new to this list (I'm a C# guy). But I have a question.

At the moment I try to start a jenkins node as a background service on a ubuntu machine. For that I have written a littel init script jenkins.node.sh that works pretty fine as long as the user that runs jenkins $juser in my script is root. But when I switch the user to my builduser (as shown in the jenkins.node.sh) I get following exception when starting the node in my logfile and the node is not connected to the master:

Jul 26, 2012 9:52:03 PM hudson.remoting.jnlp.Main$CuiListener status
Information: Connected
Jul 26, 2012 9:52:03 PM hudson.remoting.SynchronousCommandTransport$ReaderThread run
Schwerwiegend: I/O error in channel channel
java.io.IOException: Unexpected termination of the channel
	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:50)
Caused by: java.io.EOFException
	at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2571)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1315)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
	at hudson.remoting.Command.readFrom(Command.java:90)
	at hudson.remoting.ClassicCommandTransport.read(ClassicCommandTransport.java:59)
	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48)

Jul 26, 2012 9:52:03 PM hudson.remoting.jnlp.Main$CuiListener status
Information: Terminated

Well, for sure this is a permission problem. But what permision do I need to set for waht user?

Im running Jenkins ver. 1.475 on my master. My slave is a Ubuntu 12.04 server amd64 with openjdk-7-jre-headless.

And this is what I get when I try to start it from comandline without my script:
root@willi:/# su -s /bin/bash nantgen -c "java -jar /opt/jenkins/slave/slave.jar -jnlpUrl http://nelson/jenkins/computer/willi/slave-agent.jnlp"
Jul 26, 2012 10:00:27 PM hudson.remoting.jnlp.Main$CuiListener <init>
Information: Hudson agent is running in headless mode.
Jul 26, 2012 10:00:27 PM hudson.remoting.jnlp.Main$CuiListener status
Information: Locating server among [http://nelson/jenkins/, http://localhost:8080/jenkins/]
Jul 26, 2012 10:00:27 PM hudson.remoting.jnlp.Main$CuiListener status
Information: Connecting to nelson:41203
Jul 26, 2012 10:00:27 PM hudson.remoting.jnlp.Main$CuiListener status
Information: Handshaking
Jul 26, 2012 10:00:27 PM hudson.remoting.jnlp.Main$CuiListener status
Information: Connected
Jul 26, 2012 10:00:27 PM hudson.remoting.SynchronousCommandTransport$ReaderThread run
Schwerwiegend: I/O error in channel channel
java.io.IOException: Unexpected termination of the channel
	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:50)
Caused by: java.io.EOFException
	at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2571)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1315)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
	at hudson.remoting.Command.readFrom(Command.java:90)
	at hudson.remoting.ClassicCommandTransport.read(ClassicCommandTransport.java:59)
	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48)

Jul 26, 2012 10:00:27 PM hudson.remoting.jnlp.Main$CuiListener status
Information: Terminated
It's the same exception.

I hope you can help me.

Best regards
imker
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Running a jenkins slave node on ubuntu as a service

imker25
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Well, just after writing this post and thinking about it, I found out whats wrong.

The buildusers needs write access to the workspace, configered for this slave. My fault
Loading...