Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jun 2015 16:21:10 -0400
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        George Neville-Neil <gnn@neville-neil.com>,  Craig Rodrigues <rodrigc@FreeBSD.org>
Cc:        "freebsd-testing@freebsd.org" <freebsd-testing@freebsd.org>,  "freebsd-java@freebsd.org" <freebsd-java@freebsd.org>
Subject:   Re: Requests for Help: add FreeBSD procstat support to akuma library for Jenkins
Message-ID:  <558C62B6.6030004@FreeBSD.org>
In-Reply-To: <8CA148D7-81AF-41F8-AA41-9D7700B27242@neville-neil.com>
References:  <CAG=rPVc=L9pOuXD5KSLtbPA=X=wOhBbFbHgQy%2BZVjCLU6Z6wVQ@mail.gmail.com> <8CA148D7-81AF-41F8-AA41-9D7700B27242@neville-neil.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------050100070703040600000203
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 06/25/2015 15:49, George Neville-Neil wrote:
> 
> 
> On 18 Jun 2015, at 11:05, Craig Rodrigues wrote:
> 
>> Hi,
>> 
>> When setting up Jenkins, if you install new plugins, there is a 
>> checkbox:
>> 
>> Restart Jenkins when installation is complete and no jobs are 
>> running
>> 
>> This checkbox allows you to restart Jenkins automatically when 
>> new plugins are installed.  This feature works on OS X, Linux, 
>> and Solaris, but not FreeBSD.
>> 
>> I tracked down the problem on FreeBSD.  It turns out in this
>> file in the Jenkins core Jenkins: 
>> https://github.com/kohsuke/hudson/blob/master/core/src/main/java/hudson/lifecycle/UnixLifecycle.java
>>
>>
>>
>>
>>
>> 
the akuma library ( https://github.com/kohsuke/akuma/ ) is used
>> to figure out what command-line arguments were passed to the Java
>> VM that is running Jenkins. This allows Jenkins to restart the VM
>> with the same command-line arguments.
>> 
>> The akuma library has platform specific code for OS X, Linux, and
>> Solaris, but not FreeBSD.
>> 
>> I am a bit overstretched with multiple things at this point. I 
>> was wondering if someone with Java coding experience can help 
>> with the following.
>> 
>> (1)  Take the akuma library from 
>> https://github.com/kohsuke/akuma/
>> 
>> (2)  Implement FreeBSD support in akuma, by having it execute 
>> "procstat -c" to figure out the command-line arguments for a 
>> process.
>> 
>> (3)  Make sure that all tests in akuma pass
>> 
>> (4)  Send a GitHub pull request to incorporate the change 
>> upstream.
>> 
>> 
> I do not code in Java but also didnt' see a followup to this.  Has
>  anyone taken it upon themselves to fix this problem?  If so, 
> please speak up.

You can try the attached trivial patch.  Note it requires procfs(5).

Jung-uk Kim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJVjGK2AAoJEHyflib82/FGCVUH/1+C1Ax2LTAEKJ80CQIJp6Of
O7XrWjpolXhCpG1mq5ApFUWgBoFjMH6zn8xyNjJ4epWruBzlHuqROYU7waaE5DLn
cYZZWJ4sIYnDWcb/H78SBKfCPc8RSPCstI5AenfEZ0NDJmKEglWBixeVr8YTKgCc
BeMC9vdrCYodfoh548p3P9Obed8/51rlz+VaykLhFYrQPJ60Ni4nGPZOL88oztTb
h1GZbWUpoJANzk+Jfuyca6ZlLvNwulg2KF8yGvq/GsnoqGy33wmtHlZhz4rDWNWG
LDdbAjHzU/I/eWqMOBNAFTZPbfvcMg1TN4NPkYMj2c2yfTQ+9PjVS2gYobq4o9c=
=fUk2
-----END PGP SIGNATURE-----

--------------050100070703040600000203
Content-Type: text/x-patch;
 name="JavaVMArguments.java.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename="JavaVMArguments.java.diff"

--- src/main/java/com/sun/akuma/JavaVMArguments.java.orig	2015-06-25 16:0=
7:08.868860000 -0400
+++ src/main/java/com/sun/akuma/JavaVMArguments.java	2015-06-25 16:14:33.=
030581000 -0400
@@ -100,7 +100,7 @@
      */
     public static JavaVMArguments of(int pid) throws IOException {
         String os =3D System.getProperty("os.name");
-        if("Linux".equals(os))
+        if("Linux".equals(os) || "FreeBSD".equals(os))
             return ofLinux(pid);
         if("SunOS".equals(os))
             return ofSolaris(pid);

--------------050100070703040600000203--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?558C62B6.6030004>