Gosu not working under root (Linux 64-bit RH)

802 views
Skip to first unread message

Colin Hoad

unread,
Oct 2, 2013, 6:11:27 PM10/2/13
to gosu...@googlegroups.com
Hi,
 
I am trying to get Gosu up and running on a Linux 64-bit Red Hat server. I have followed the instructions, and edited the ~/.bashrc as instructed. When I run "gosu -version" under my own user account, I get the version number returned - as expected. However, when I sudo -su to root, I get the following:
 
[root@WHML30627 bin]# gosu -version
/usr/gosu/gosu-0.8.6.1-C/bin/gosu: line 4: dirname: command not found
/usr/gosu/gosu-0.8.6.1-C/bin/gosu: line 14: dirname: command not found
/usr/gosu/gosu-0.8.6.1-C/bin/gosu: line 15: readlink: command not found
ls: /../jars: No such file or directory
Exception in thread "main" java.lang.NoClassDefFoundError: gw/lang/shell/Gosu
Caused by: java.lang.ClassNotFoundException: gw.lang.shell.Gosu
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: gw.lang.shell.Gosu.  Program will exit.
 
Can anyone explain why root isn't happy running Gosu? I can run "java -version" when sudo'd to root, no problem. I have exactly the same entries in my ~/.bashrc for root as I have for my own user, so I don't understand why root isn't running Gosu.
 
Root's Bash profile:
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
export JAVA_HOME=/usr/java/jdk1.6.0_35
export GOSU_HOME=/usr/gosu/gosu-0.8.6.1-C
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin:$GOSU_HOME/bin
# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
 
My user's bash profile:
# .bashrc
export JAVA_HOME=/usr/java/jdk1.6.0_35
export GOSU_HOME=/usr/gosu/gosu-0.8.6.1-C
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin:$GOSU_HOME/bin

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
# User specific aliases and functions
 
 
Any ideas?
 
Thanks,
Colin

Brian Chang

unread,
Oct 2, 2013, 6:23:47 PM10/2/13
to gosu...@googlegroups.com
Seems like dirname and readlink aren't on your PATH for root.  Are you able to su to root, and run dirname and readlink manually from your command line?

If not, run the following, beginning as non-root, for more confirmation:
which dirname
which readlink
echo $PATH
sudo su - root
echo $PATH



--
You received this message because you are subscribed to the Google Groups "gosu-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gosu-lang+...@googlegroups.com.
To post to this group, send email to gosu...@googlegroups.com.
Visit this group at http://groups.google.com/group/gosu-lang.
For more options, visit https://groups.google.com/groups/opt_out.



--
Brian
bcha...@gmail.com

Colin Hoad

unread,
Oct 2, 2013, 7:17:33 PM10/2/13
to gosu...@googlegroups.com
Thank you very much, Brian - for some reason, root had "usr/bin" in its $PATH rather than "/usr/bin". As soon as I added "/usr/bin" to the $PATH it was happy running Gosu!

Thanks again,
Colin
Reply all
Reply to author
Forward
0 new messages