On 06/01/2012 11:46, Zi Loff wrote:
On Jan 6, 2012, at 11:34 AM, keith wrote:
On 05/01/2012 16:43, keith wrote:
Hi, I have build a graylog2 server with obsd 5.0 x64 but can't figure out how
to get the some of the programs to auto start, They all start when run as root
but only the mogod one starts up at boot time. Can anyone help ?
if [ -x /etc/rc.d/mongod ]; then
echo -n ' MongoDB'; /etc/rc.d/mongod start
fi
if [ -x /usr/local/elasticsearch/bin/elasticsearch ]; then
echo -n ' Elasticsearch'; /usr/local/elasticsearch/bin/elasticsearch&
fi
if [ -x /usr/local/graylog2-server/graylog2-server.jar ]; then
echo -n ' Graylog2-Server'; java
/usr/local/graylog2-server/graylog2-server.jar
fi
if [ -x /usr/local/graylog2-server/graylog2-server.jar ]; then
echo -n ' Graylog2-Web'; /usr/local/graylog2-web-interface/script/rails server
-e production&
fi
I've edited the /root/.profile and have added the path to java to PATH and
also set JAVA_HOME.
Thanks
Keith
Taking advice for Zi and Otto I've moved on a little... The MongoDB and Elastic
Search are starting but Java / Graylog2-server and the Ruby /
Graylog2-Web-Interface still won't start.
The current rc.local file looks like....
if [ -x /etc/rc.d/mongod ]; then
echo -n ' MongoDB'; /etc/rc.d/mongod start
fi
export JAVA_HOME=/usr/local/jre-1.7.0/
echo -n ' Run Elasticsearch:'
sh /usr/local/elasticsearch/bin/elasticsearch&
echo -n ' Run Graylog2-Server:'
cd /usr/local/graylog2-server/
/usr/local/jre-1.7.0/bin/java /usr/local/graylog2-server/graylog2-
server.jar
Isn't the -jar option missing here?
../java -jar /usr/local...
echo -n ' Run Graylog2-Web:'
cd /usr/local/graylog2-web-interface/
/usr/local/graylog2-web-interface/script/rails server -e production&
And below is the text that appears at boot time.
starting network daemons : sshd sendmail inetd.
MongoDB mongod Run Elasticsearch: Run Graylog2-Server:Error: Could
not find main class .usr.local.graylog2-server.graylog2-server.jar
Exception in thread "main" java.land.NoClassDefFoundError: .
usr.local.graylog2-server.graylog2-server.jar
Then there's about 10 lines of java errors text then..
Run Graylog2-Web:starting local daemons:env: ruby: No such file or
directory cron.
When I log into the server as root and run the following as root then
both the server and web-interface start fine.
echo -n 'Graylog2-Server'
cd /usr/local/graylog2-server/
java -jar graylog2-server.jar&
echo -n 'Graylog2-Web'
cd /usr/local/graylog2-web-interface/
script/rails server -e production&
Any help would be appreciated.
Thanks
Keith
Thank you, that's made a difference. The Graylog2-Server isn't starting
but the error has changed... Unfortunately the console scrolls so
quickly I can't see what the error is !!! Earlier today I tried to get a
serial console working but it didn't work earlier today when I tried.
Probably because this OSDB box is a virtual server running in VMware.
I think / hope the errors are to do with the root profile.
Thanks
Keith