Re: Help with rc.local scripts

2012-01-06 Thread keith

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

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



Re: Help with rc.local scripts

2012-01-06 Thread Zé Loff
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



Re: Help with rc.local scripts

2012-01-06 Thread Stuart Henderson
On 2012-01-05, keith ke...@scott-land.net 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

Scripts installed by packages in /etc/rc.d are intended to be started
by adding the name to the pkg_scripts variable in rc.conf.local; see rc.d(8)

 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.

I can't remember if /root/.profile applies to scripts started from
/etc/rc but I would suspect not; try setting these required vars
directly in rc.local.



Re: Help with rc.local scripts

2012-01-06 Thread keith

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



Re: Help with rc.local scripts

2012-01-06 Thread Zé Loff
I haven't tried it myself, so I have no idea if it works, but maybe you can
redirect stdout and stderr to a file... Something along the lines of:
(please note i added the -jar switch as well)

echo  -n ' Graylog2-Server'; java -jar
/usr/local/graylog2-server/graylog2-server.jar 1 somefile 21



On Jan 6, 2012, at 2:06 PM, keith wrote:

 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



Re: Help with rc.local scripts

2012-01-06 Thread Jiri B
On Fri, Jan 06, 2012 at 02:06:28PM +, keith wrote:
 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.

IIRC you can create virtual serial for a VM, then you have to
whitelist the location on the host (stupid VMWare).

If there's netcat/socat on the host you could tunnel it via ssh.

Maybe something like this (untested)

ssh esxi netcat -U /path/to/virtual_serial.sock | \
socat STDIO TCP-LISTEN:5500
telnet localhost 5500

jirib



Re: Help with rc.local scripts

2012-01-06 Thread keith
On 06/01/2012 14:13, Zi Loff wrote:

 I haven't tried it myself, so I have no idea if it works, but maybe 
 you can redirect stdout and stderr to a file... Something along the 
 lines of:
 (please note i added the -jar switch as well)

 echo  -n ' Graylog2-Server'; java -jar 
 /usr/local/graylog2-server/graylog2-server.jar 1 somefile 21



 On Jan 6, 2012, at 2:06 PM, keith wrote:

 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


Thanks, It appears that elasticsearch doesn't have enough time to start. 
I've tried putting a sleep 20 into the rc.local file and although that 
did work I don't get a login prompt on the console, tool it out reduced 
it to 15 seconds and still the same. Removed it completely and the login 
box has returned. Strange.

# cat /usr/local/graylog2-server-0.9.6/somefile
2012-01-06 14:54:07,553 FATAL: org.graylog2.Main - IOException while 
trying to check Index. Make sure that your ElasticSearch server is running.
java.net.ConnectException: Connection refused
 at java.net.PlainSocketImpl.socketConnect(Native Method)
 at 
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:320)
 at 
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:181)
 at 
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:163)
 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:390)
 at java.net.Socket.connect(Socket.java:578)
 at java.net.Socket.connect(Socket.java:527)
 at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
 at sun.net.www.http.HttpClient.openServer(HttpClient.java:384)
 at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
 at sun.net.www.http.HttpClient.init(HttpClient.java:213)
 at sun.net.www.http.HttpClient.New(HttpClient.java:300)
 at sun.net.www.http.HttpClient.New(HttpClient.java:312)
 at 

Re: Help with rc.local scripts

2012-01-06 Thread Zé Loff
If all daemons are *always* meant to be started together, what about creating
a script that starts the them in sequence -- with some 'sleep' and/or
wait-until-the-previous-daemon-becomes-available in the middle -- and then
calling that script from rc.local?


On Jan 6, 2012, at 3:17 PM, keith wrote:

 On 06/01/2012 14:13, Zi Loff wrote:


 I haven't tried it myself, so I have no idea if it works, but maybe you can
redirect stdout and stderr to a file... Something along the lines of:
 (please note i added the -jar switch as well)

 echo  -n ' Graylog2-Server'; java -jar
/usr/local/graylog2-server/graylog2-server.jar 1 somefile 21



 On Jan 6, 2012, at 2:06 PM, keith wrote:

 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


 Thanks, It appears that elasticsearch doesn't have enough time to start.
I've tried putting a sleep 20 into the rc.local file and although that did
work I don't get a login prompt on the console, tool it out reduced it to 15
seconds and still the same. Removed it completely and the login box has
returned. Strange.

 # cat /usr/local/graylog2-server-0.9.6/somefile
 2012-01-06 14:54:07,553 FATAL: org.graylog2.Main - IOException while trying
to check Index. Make sure that your ElasticSearch server is running.
 java.net.ConnectException: Connection refused
 at java.net.PlainSocketImpl.socketConnect(Native Method)
 at
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:320)
 at
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.jav
a:181)
 at
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:163)
 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:390)
 at java.net.Socket.connect(Socket.java:578)
 at java.net.Socket.connect(Socket.java:527)
 at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
 at sun.net.www.http.HttpClient.openServer(HttpClient.java:384)
 at 

Re: Help with rc.local scripts

2012-01-06 Thread keith

On 06/01/2012 14:51, Jiri B wrote:

On Fri, Jan 06, 2012 at 02:06:28PM +, keith wrote:

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.

IIRC you can create virtual serial for a VM, then you have to
whitelist the location on the host (stupid VMWare).

If there's netcat/socat on the host you could tunnel it via ssh.

Maybe something like this (untested)

ssh esxi netcat -U /path/to/virtual_serial.sock | \
socat STDIO TCP-LISTEN:5500
telnet localhost 5500

jirib


Thanks Jirib. I will give this a try later.



Re: Help with rc.local scripts

2012-01-06 Thread Jiri B
On Fri, Jan 06, 2012 at 03:27:25PM +, Zi Loff wrote:
 If all daemons are *always* meant to be started together, what about creating
 a script that starts the them in sequence -- with some 'sleep' and/or
 wait-until-the-previous-daemon-becomes-available in the middle -- and then
 calling that script from rc.local?

Guys, as you have spent so big time with this applications maybe
you could create a port for it :)

Then you would get rc.d framework benefits and you could use rc_pre function
to check if your required daemon is already running.

jirib



Re: Help with rc.local scripts

2012-01-06 Thread keith

On 06/01/2012 15:53, Jiri B wrote:

On Fri, Jan 06, 2012 at 03:27:25PM +, Zi Loff wrote:

If all daemons are *always* meant to be started together, what about creating
a script that starts the them in sequence -- with some 'sleep' and/or
wait-until-the-previous-daemon-becomes-available in the middle -- and then
calling that script from rc.local?

Guys, as you have spent so big time with this applications maybe
you could create a port for it :)

Then you would get rc.d framework benefits and you could use rc_pre function
to check if your required daemon is already running.

jirib


Sorry for all the noise on Misc...  I wouldn't know where to start to 
make a port, but if there was a couple of easy howtos (I couldn't see 
any) then I would give it a go. BUT
When I finally get all this working I'll send my small tutorial on 
how-to get Graylog2 working on OpenBSD to bsdmag.org


Keith



Re: Help with rc.local scripts

2012-01-06 Thread Ingo Schwarze
Hi Keith,

keith wrote on Fri, Jan 06, 2012 at 05:01:08PM +:

 I wouldn't know where to start to make a port,
 but if there was a couple of easy howtos (I couldn't
 see any) then I would give it a go.

http://www.openbsd.org/faq/ports/

 When I finally get all this working I'll send my small tutorial on
 how-to get Graylog2 working on OpenBSD to bsdmag.org

That's fine, but it's more important to design the port such that
not much manual work is required because the port's defaults are
already sane, and to describe what remains to be done manually,
as concisely as possible, in the pkg/README file within the
port itself.

Yours,
  Ingo



Re: Help with rc.local scripts

2012-01-06 Thread Jiri B
 If there's netcat/socat on the host you could tunnel it via ssh.
 
 Maybe something like this (untested)
 
  ssh esxi netcat -U /path/to/virtual_serial.sock | \
  socat STDIO TCP-LISTEN:5500
  telnet localhost 5500
 
 Thanks Jirib. I will give this a try later.

just for the record, this works for me on Ubuntu though I don't
know how to escape `cu' :/ (Tested with VMWare Player where
flashboot VM's serial is defined as unix socket.)

$ socat PTY,link=/tmp/pty,raw,waitslave EXEC:'ssh localhost nc -U 
/tmp/flash50.sock'
$ cu -l /tmp/pty 
Connected.


OpenBSD/i386 (localhost) (tty00)

login:

I'm not really socat specialist, so maybe there are some secret
options :) Does anybody know them?

$ socat - EXEC:'ssh localhost nc -U /tmp/flash50.sock'

Same as above but without need of `cu', but every ^C kicks you
out.

jirib



Help with rc.local scripts

2012-01-05 Thread keith
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



Re: Help with rc.local scripts

2012-01-05 Thread Zé Loff
Aren't you missing a few '' at the end of some of the start commands? I'd say
that's the problem...

On Jan 5, 2012, at 4:43 PM, 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



Re: Help with rc.local scripts

2012-01-05 Thread Otto Moerbeek
On Thu, Jan 05, 2012 at 04:43:30PM +, 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

In general, .jar files are not exectable, so the -x test fails.

-Otto