Re: groovyserv 0.7 issue

6 views
Skip to first unread message

Yasuharu Nakano

unread,
May 19, 2011, 11:04:40 PM5/19/11
to Soell, Oliver, groov...@googlegroups.com
Hi Oliver,

I've noticed just now that this is not on the mailing list. I appended
the address groov...@googlegroups.com to CC.
There are threads written by Japanese, but surely it's okay in English.

http://groups.google.com/group/groovyserv/topics

> The malloc/free fix worked great for me, thanks again!

It's good!

> I have a couple things to report:
> 1. There seems to be some weirdness when running groovyclient under sudo.
> GroovyClient will try to start up the groovy server as root using
> ~/.groovy/groovyserv in the initial user's directory, and it was not
> starting up properly. The way I have fixed this is just by setting HOME to
> root's home. I use this bash function to set everything if groovyclient
> exists, and if you are running as root. I just call set_groovy at the
> beginning of any script and then use $GROOVY instead of groovy or
> groovyclient.
> set_groovy() {
>   GROOVYCLIENT=$(type -P groovyclient)
>   if [ $? -eq 0 ] ; then
>     if [ $(id -u) -eq 0 ] ; then
>       # this could be better - get from /etc/passwd
>       HOME=/root
>     fi
>     GROOVY="${GROOVYCLIENT} -Cq"
>   else
>     GROOVY=groovy
>   fi
> }
>
> I also noticed that if you have a root groovyserv process running, a regular
> user cannot run groovyclient and have their own groovy process running. I
> didn't test this much at all so it may be a configuration problem on my
> side. I'd think that this would be a valuable feature, however.

Wow, I had never run groovyserv with sudo!
I tried it and summarized some points as follows:

Current behavior:
- After user_1 started groovyserver, user_1 uses
/home/user_1/.groovy/groovyserv directory as user_1.
- If user_1 uses sudo command, root(user_1) uses
/home/user_1/.groovy/groovyserv directory as root.
- If user_2 uses sudo command, root(user_2) uses
/home/user_2/.groovy/groovyserv directory as root. The environment is
separated from user_1.

Your expectation(?):
- After user_1 started groovyserver, user_1 uses
/home/user_1/.groovy/groovyserv directory as user_1.
- If user_1 uses sudo command, root(user_1) uses
"/root/.groovy/groovyserv" directory as root.
- If user_2 uses sudo command, root(user_2) uses
"/root/.groovy/groovyserv" directory as root. The environment is same
as root and sudo-ed user_1.

Is it right?

IMO, the sudo is the temporary way of changing an account, so I wonder
"current behavior" is better. How about this point?
If you mentioned not about such specification but just about a caused
error, please let me know the detail of the issue. I'm worrying about
"it was not starting up properly."


> 2. Here is a specfile for an RPM that we are using. It should probably
> include a sub-package for the one ruby script, but in our case, we just
> delete it in order not to have the ruby dependency. The "source" directory
> is the unzipped groovyserv-0.8-SNAPSHOT-linux-amd64-bin.zip which is the
> result of "mvn package". I suppose the mvn package should really be part of
> this rpmbuild but I didn't do that. Also, please note that this spec file is
> for x86_64 only but could relatively easily be made platform independent.
> Please use whatever of this you like.

Excellent! I could create the GroovyServ's rpm file!
I'd like to introduce the spec on the document page of GroovyServ's
site. Thanks!


Cheers,
Yasuharu


2011/5/20 Soell, Oliver <oso...@austin.utexas.edu>:
> The malloc/free fix worked great for me, thanks again!
> I have a couple things to report:
> 1. There seems to be some weirdness when running groovyclient under sudo.
> GroovyClient will try to start up the groovy server as root using
> ~/.groovy/groovyserv in the initial user's directory, and it was not
> starting up properly. The way I have fixed this is just by setting HOME to
> root's home. I use this bash function to set everything if groovyclient
> exists, and if you are running as root. I just call set_groovy at the
> beginning of any script and then use $GROOVY instead of groovy or
> groovyclient.
> set_groovy() {
>   GROOVYCLIENT=$(type -P groovyclient)
>   if [ $? -eq 0 ] ; then
>     if [ $(id -u) -eq 0 ] ; then
>       # this could be better - get from /etc/passwd
>       HOME=/root
>     fi
>     GROOVY="${GROOVYCLIENT} -Cq"
>   else
>     GROOVY=groovy
>   fi
> }
>
> I also noticed that if you have a root groovyserv process running, a regular
> user cannot run groovyclient and have their own groovy process running. I
> didn't test this much at all so it may be a configuration problem on my
> side. I'd think that this would be a valuable feature, however.
>
> 2. Here is a specfile for an RPM that we are using. It should probably
> include a sub-package for the one ruby script, but in our case, we just
> delete it in order not to have the ruby dependency. The "source" directory
> is the unzipped groovyserv-0.8-SNAPSHOT-linux-amd64-bin.zip which is the
> result of "mvn package". I suppose the mvn package should really be part of
> this rpmbuild but I didn't do that. Also, please note that this spec file is
> for x86_64 only but could relatively easily be made platform independent.
> Please use whatever of this you like.
> Thanks again!
> cheers,
> -o
>
> Summary: GroovyServ, a process server for Groovy
> Name: groovyserv
> Version: 0.8
> Release: 0
> License: Apache License, Version 2.0
> Group: Development/Languages
> Provides: groovyserv
> Requires: java >= 1.6.0.21
> Requires: groovy >= 1.7.0
> Source0: groovyserv-0.8-SNAPSHOT
> BuildArch: x86_64
> BuildRoot: %{_tmppath}/%{name}-%{version}-root
>
> %description
> Provides the GroovyServ mechanism for faster groovy execution.
>
> %prep
>
> %build
>
> %install
> mkdir -p $RPM_BUILD_ROOT/opt $RPM_BUILD_ROOT/usr/local/bin
> cp -Rp %{SOURCE0} $RPM_BUILD_ROOT/opt/groovyserv
> for file in groovyserver groovyclient ; do
>   ln -s /opt/groovyserv/bin/$file $RPM_BUILD_ROOT/usr/local/bin
> done
> #we're not interested in the ruby client
> rm $RPM_BUILD_ROOT/opt/groovyserv/bin/groovyclient.rb
> #required since our sources are in svn
> find $RPM_BUILD_ROOT -name .svn -type d | while read svndir ; do rm -rf
> $svndir ; done
>
> %clean
> rm -Rf $RPM_BUILD_ROOT
>
> %post
>
> %files
> %defattr(-,root,root)
>
> /opt/groovyserv
> /usr/local/bin/groovyserver
> /usr/local/bin/groovyclient
>
> %changelog
> * Thu May 19 2011 - oso...@austin.utexas.edu
> - Updated to 0.8-SNAPSHOT to include malloc/free fix
>
> * Mon May 2 2011 - oso...@austin.utexas.edu
> - Initial version
>
>
>
>
> Oliver Soell <oso...@austin.utexas.edu>
> Senior Software Engineer, 512.232.8304
> The University of Texas at Austin, ITS Applications
> On May 18, 2011, at 11:01 PM, Yasuharu Nakano wrote:
>
> Hi Oliver,
>
> Thank you for your using GroovyServ!
>
> Just at the day before yesterday, I've found the problem about malloc
> and free on the groovyclient. I've fixed for it and pushed the commit
> to github.
> If you can build the groovyserv by yourself, please try to build and
> run the script. If not, I'll send you it.
>
> Cheers,
> Yasuharu
>
>
>
--
Yasuharu NAKANO / nobeans

Yasuharu Nakano

unread,
Jun 20, 2011, 3:08:17 AM6/20/11
to Soell, Oliver, groov...@googlegroups.com
Hi Oliver,

I'd like to include your contributed spec file, which has your mail
address as change log, into groovyserv repository.
Is there any problem? If you want to delete the mail addresses, I'll
do it before push to GitHub.

Now the spec file was updated by my colleague as follows: (it will be
modified more, later)
----------------------------------------------------------


Summary: GroovyServ, a process server for Groovy
Name: groovyserv
Version: 0.8
Release: 0
License: Apache License, Version 2.0
Group: Development/Languages
Provides: groovyserv

#Requires: java >= 1.6.0.21
Requires: jdk >= 1.6.0.21


Requires: groovy >= 1.7.0
Source0: groovyserv-0.8

BuildArch: x86_64
BuildRoot: %{_tmppath}/%{name}-%{version}-root

Packager: Kazuhisa Hara <kazu...@gmail.com>

%description
Provides the GroovyServ mechanism for faster groovy execution.

%prep

%build

%install
mkdir -p $RPM_BUILD_ROOT/opt $RPM_BUILD_ROOT/usr/local/bin
cp -Rp %{SOURCE0} $RPM_BUILD_ROOT/opt/groovyserv
for file in groovyserver groovyclient ; do
ln -s /opt/groovyserv/bin/$file $RPM_BUILD_ROOT/usr/local/bin
done
#we're not interested in the ruby client
rm $RPM_BUILD_ROOT/opt/groovyserv/bin/groovyclient.rb


#required since our sources are in svn
find $RPM_BUILD_ROOT -name .svn -type d | while read svndir ; do rm
-rf $svndir ; done

%clean
rm -Rf $RPM_BUILD_ROOT

%post

%files
%defattr(-,root,root)

/opt/groovyserv
/usr/local/bin/groovyserver
/usr/local/bin/groovyclient

%changelog
* Fri Jun 17 2011 Kazuhisa Hara <kazu...@gmail.com>
- Updated to 0.8-release

* Fri May 20 2011 Kazuhisa Hara <kazu...@gmail.com>
- Necessary dependencies "Java" from the "JDK" was introduced.

* Thu May 19 2011 - oso...@austin.utexas.edu
- Updated to 0.8-SNAPSHOT to include malloc/free fix

* Mon May 2 2011 - oso...@austin.utexas.edu
- Initial version

----------------------------------------------------------

Regards,
Yasuharu


2011/5/20 Yasuharu Nakano <yn...@jggug.org>:

Yasuharu Nakano

unread,
Jul 1, 2011, 7:52:24 PM7/1/11
to Soell, Oliver, groov...@googlegroups.com
Thanks! I'm looking forward to your "multiple RPMs".

Cheers,


--
Yasuharu NAKANO / nobeans

2011/7/2 Soell, Oliver <oso...@austin.utexas.edu>:
> Sorry I haven't got back to you on this. You are welcome to use my email
> address. If I get around to it (probably not for a while due to current
> priorities) I may improve it to create multiple RPMs (one for the ruby
> client).
> cheers,
> -o


> Oliver Soell <oso...@austin.utexas.edu>
> Senior Software Engineer, 512.232.8304
> The University of Texas at Austin, ITS Applications

Reply all
Reply to author
Forward
0 new messages