Scripts not working on cron - always asking for password

2007-09-21 Thread Daniel Alheiros
Hi

I'm having problems trying to setup my schedulled tasks. Sorry if it's
something Linux related, as I'm not a Linux expert...

I created a scripts.conf file (for my slave server) containing:
user=solr
solr_hostname=10.133.132.159
solr_port=8080
rsyncd_port=20280
data_dir=/var/solr2-v1.2.0/home/data
webapp_name=solr
master_host=10.133.132.159
master_data_dir=/var/solr3-v1.2.0/home/data
master_status_dir=/var/solr3-v1.2.0/home/logs

I have two solr instances running on the same machine, each one has its own
data dir.

My cron configuration is:
# master
2 5 * * * /var/solr3-v1.2.0/home/bin/snapcleaner -D 1
2 4 * * * /var/solr3-v1.2.0/home/bin/optimize
# slave
*/5 * * * * 
/var/solr2-v1.2.0/home/bin/snappuller;/var/solr2-v1.2.0/home/bin/snapinstall
er
*/9 * * * * /var/solr3-v1.2.0/home/bin/snapcleaner -N 2

It's pretty weird for me because it always asks me for a password when I run
any of them manually (and after passwords are provided they work properly).
Where should I add this password in order to avoid it? I couldn't find it in
the documentation. When I try to run manually the snappuller it asks for
password 5 times when it has a new snapshot to get and 2 times when it
doesn't have a new snapshot.

Here goes the error log in the snappuller.log file:
2007/09/21 13:00:01 started by solr
2007/09/21 13:00:01 command: /var/solr2-v1.2.0/home/bin/snappuller
2007/09/21 13:00:01 failed to ssh to master 10.133.132.159

My OS is a RHEL.

Regards,
Daniel

On 20/9/07 07:14, Yu-Hui Jin [EMAIL PROTECTED] wrote:

 Thanks, it works now.
 
 
 regards,
 -Hui
 
 
 On 9/19/07, Pieter Berkel [EMAIL PROTECTED]  wrote:
 
 If you don't need to pass any command line arguments to snapshooter,
 remove
 (or comment out) this line from solrconfig.xml:
 
 arr name=args strarg1/str strarg2/str /arr
 
 By the same token, if you're not setting environment variables either,
 remove the following line as well:
 
 arr name=env strMYVAR=val1/str /arr
 
 Once you alter / remove those two lines, snapshooter should function as
 expected.
 
 cheers,
 Piete
 
 
 
 On 20/09/2007, Yu-Hui Jin [EMAIL PROTECTED] wrote:
 
 Hi, Pieter,
 
 Thanks!  Now the exception is gone. However, There's no snapshot file
 created in the data directory. Strangely, the snapshooter.log seems to
 complete successfully.  Any idea what else I'm missing?
 
 $ cat var/SolrHome/solr/logs/snapshooter.log
 2007/09/19 20:16:17 started by solruser
 2007/09/19 20:16:17 command: /var/SolrHome/solr/bin/snapshooter arg1
 arg2
 2007/09/19 20:16:17 taking snapshot
 var/SolrHome/solr/data/snapshot.20070919201617
 2007/09/19 20:16:17 ended (elapsed time: 0 sec)
 
 Thanks,
 
 -Hui
 
 
 
 
 On 9/19/07, Pieter Berkel [EMAIL PROTECTED] wrote:
 
 See this recent thread for some helpful info:
 
 
 http://www.nabble.com/solr-doesn%27t-find-exe-in-postCommit-event-tf4264879.
 html#a12167792
 
 
 You'll probably want to configure your exe with an absolute path
 rather
 than
 the dir:
 
   str name=exe/var/SolrHome/solr/bin/snapshooter/str
   str name=dir./str
 
 In order to get the snapshooter working correctly.
 
 cheers,
 Piete
 
 
 
 On 20/09/2007, Yu-Hui Jin [EMAIL PROTECTED] wrote:
 
 Hi, there,
 
 I used an absolute path for the dir param in the solrconfig.xml as
 below:
 
 listener event=postCommit class=solr.RunExecutableListener
   str name=exesnapshooter/str
   str name=dir/var/SolrHome/solr/bin/str
   bool name=waittrue/bool
   arr name=args strarg1/str strarg2/str /arr
   arr name=env strMYVAR=val1/str /arr
 /listener
 
 However, I got snapshooter: not found  exception thrown in
 catalina.out.
 I don't see why this doesn't work. Anything I'm missing?
 
 
 Many thanks,
 
 -Hui
 
 
 
 
 
 --
 Regards,
 
 -Hui
 
 
 
 


http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal 
views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on 
it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.



Re: Scripts not working on cron - always asking for password

2007-09-21 Thread Thorsten Scherler
On Fri, 2007-09-21 at 13:02 +0100, Daniel Alheiros wrote:
 Hi
 
 I'm having problems trying to setup my schedulled tasks. Sorry if it's
 something Linux related, as I'm not a Linux expert...
 
 I created a scripts.conf file (for my slave server) containing:
 user=solr
 solr_hostname=10.133.132.159
 solr_port=8080
 rsyncd_port=20280
 data_dir=/var/solr2-v1.2.0/home/data
 webapp_name=solr
 master_host=10.133.132.159
 master_data_dir=/var/solr3-v1.2.0/home/data
 master_status_dir=/var/solr3-v1.2.0/home/logs
 
 I have two solr instances running on the same machine, each one has its own
 data dir.
 
 My cron configuration is:
 # master
 2 5 * * * /var/solr3-v1.2.0/home/bin/snapcleaner -D 1
 2 4 * * * /var/solr3-v1.2.0/home/bin/optimize
 # slave
 */5 * * * * 
 /var/solr2-v1.2.0/home/bin/snappuller;/var/solr2-v1.2.0/home/bin/snapinstall
 er
 */9 * * * * /var/solr3-v1.2.0/home/bin/snapcleaner -N 2
 
 It's pretty weird for me because it always asks me for a password when I run
 any of them manually (and after passwords are provided they work properly).

Well you just gave the answer. Make sure the user that is executing the
cron has sufficient rights. The cron job will not be able to have a
dialog.

The prude force method is:

sudo chown USER:USER /var/solr3-v1.2.0

That should do the job.

salu2

 Where should I add this password in order to avoid it? I couldn't find it in
 the documentation. When I try to run manually the snappuller it asks for
 password 5 times when it has a new snapshot to get and 2 times when it
 doesn't have a new snapshot.
 
 Here goes the error log in the snappuller.log file:
 2007/09/21 13:00:01 started by solr
 2007/09/21 13:00:01 command: /var/solr2-v1.2.0/home/bin/snappuller
 2007/09/21 13:00:01 failed to ssh to master 10.133.132.159
 
 My OS is a RHEL.
 
 Regards,
 Daniel
 
 On 20/9/07 07:14, Yu-Hui Jin [EMAIL PROTECTED] wrote:
 
  Thanks, it works now.
  
  
  regards,
  -Hui
  
  
  On 9/19/07, Pieter Berkel [EMAIL PROTECTED]  wrote:
  
  If you don't need to pass any command line arguments to snapshooter,
  remove
  (or comment out) this line from solrconfig.xml:
  
  arr name=args strarg1/str strarg2/str /arr
  
  By the same token, if you're not setting environment variables either,
  remove the following line as well:
  
  arr name=env strMYVAR=val1/str /arr
  
  Once you alter / remove those two lines, snapshooter should function as
  expected.
  
  cheers,
  Piete
  
  
  
  On 20/09/2007, Yu-Hui Jin [EMAIL PROTECTED] wrote:
  
  Hi, Pieter,
  
  Thanks!  Now the exception is gone. However, There's no snapshot file
  created in the data directory. Strangely, the snapshooter.log seems to
  complete successfully.  Any idea what else I'm missing?
  
  $ cat var/SolrHome/solr/logs/snapshooter.log
  2007/09/19 20:16:17 started by solruser
  2007/09/19 20:16:17 command: /var/SolrHome/solr/bin/snapshooter arg1
  arg2
  2007/09/19 20:16:17 taking snapshot
  var/SolrHome/solr/data/snapshot.20070919201617
  2007/09/19 20:16:17 ended (elapsed time: 0 sec)
  
  Thanks,
  
  -Hui
  
  
  
  
  On 9/19/07, Pieter Berkel [EMAIL PROTECTED] wrote:
  
  See this recent thread for some helpful info:
  
  
  http://www.nabble.com/solr-doesn%27t-find-exe-in-postCommit-event-tf4264879.
  html#a12167792
  
  
  You'll probably want to configure your exe with an absolute path
  rather
  than
  the dir:
  
str name=exe/var/SolrHome/solr/bin/snapshooter/str
str name=dir./str
  
  In order to get the snapshooter working correctly.
  
  cheers,
  Piete
  
  
  
  On 20/09/2007, Yu-Hui Jin [EMAIL PROTECTED] wrote:
  
  Hi, there,
  
  I used an absolute path for the dir param in the solrconfig.xml as
  below:
  
  listener event=postCommit class=solr.RunExecutableListener
str name=exesnapshooter/str
str name=dir/var/SolrHome/solr/bin/str
bool name=waittrue/bool
arr name=args strarg1/str strarg2/str /arr
arr name=env strMYVAR=val1/str /arr
  /listener
  
  However, I got snapshooter: not found  exception thrown in
  catalina.out.
  I don't see why this doesn't work. Anything I'm missing?
  
  
  Many thanks,
  
  -Hui
  
  
  
  
  
  --
  Regards,
  
  -Hui
  
  
  
  
 
 
 http://www.bbc.co.uk/
 This e-mail (and any attachments) is confidential and may contain personal 
 views which are not the views of the BBC unless specifically stated.
 If you have received it in error, please delete it from your system.
 Do not use, copy or disclose the information in any way nor act in reliance 
 on it and notify the sender immediately.
 Please note that the BBC monitors e-mails sent or received.
 Further communication will signify your consent to this.
   
-- 
Thorsten Scherler thorsten.at.apache.org
Open Source Java  consulting, training and solutions



Re: Scripts not working on cron - always asking for password

2007-09-21 Thread Daniel Alheiros
Hi Thorsten,

Thanks for your answer, but I've done it before and it still didn't work. I
was running everything before as root and it didn't work either.

Now I've created a solr user, part of the root group, changed the ownership
of all solr stuff, and changed file permissions to 775 (so any user on the
root group should be able to do anything on any files)

Any other suggestion?

Regards,
Daniel

On 21/9/07 13:12, Thorsten Scherler
[EMAIL PROTECTED] wrote:

 On Fri, 2007-09-21 at 13:02 +0100, Daniel Alheiros wrote:
 Hi
 
 I'm having problems trying to setup my schedulled tasks. Sorry if it's
 something Linux related, as I'm not a Linux expert...
 
 I created a scripts.conf file (for my slave server) containing:
 user=solr
 solr_hostname=10.133.132.159
 solr_port=8080
 rsyncd_port=20280
 data_dir=/var/solr2-v1.2.0/home/data
 webapp_name=solr
 master_host=10.133.132.159
 master_data_dir=/var/solr3-v1.2.0/home/data
 master_status_dir=/var/solr3-v1.2.0/home/logs
 
 I have two solr instances running on the same machine, each one has its own
 data dir.
 
 My cron configuration is:
 # master
 2 5 * * * /var/solr3-v1.2.0/home/bin/snapcleaner -D 1
 2 4 * * * /var/solr3-v1.2.0/home/bin/optimize
 # slave
 */5 * * * * 
 /var/solr2-v1.2.0/home/bin/snappuller;/var/solr2-v1.2.0/home/bin/snapinstall
 er
 */9 * * * * /var/solr3-v1.2.0/home/bin/snapcleaner -N 2
 
 It's pretty weird for me because it always asks me for a password when I run
 any of them manually (and after passwords are provided they work properly).
 
 Well you just gave the answer. Make sure the user that is executing the
 cron has sufficient rights. The cron job will not be able to have a
 dialog.
 
 The prude force method is:
 
 sudo chown USER:USER /var/solr3-v1.2.0
 
 That should do the job.
 
 salu2
 
 Where should I add this password in order to avoid it? I couldn't find it in
 the documentation. When I try to run manually the snappuller it asks for
 password 5 times when it has a new snapshot to get and 2 times when it
 doesn't have a new snapshot.
 
 Here goes the error log in the snappuller.log file:
 2007/09/21 13:00:01 started by solr
 2007/09/21 13:00:01 command: /var/solr2-v1.2.0/home/bin/snappuller
 2007/09/21 13:00:01 failed to ssh to master 10.133.132.159
 
 My OS is a RHEL.
 
 Regards,
 Daniel
 
 On 20/9/07 07:14, Yu-Hui Jin [EMAIL PROTECTED] wrote:
 
 Thanks, it works now.
 
 
 regards,
 -Hui
 
 
 On 9/19/07, Pieter Berkel [EMAIL PROTECTED]  wrote:
 
 If you don't need to pass any command line arguments to snapshooter,
 remove
 (or comment out) this line from solrconfig.xml:
 
 arr name=args strarg1/str strarg2/str /arr
 
 By the same token, if you're not setting environment variables either,
 remove the following line as well:
 
 arr name=env strMYVAR=val1/str /arr
 
 Once you alter / remove those two lines, snapshooter should function as
 expected.
 
 cheers,
 Piete
 
 
 
 On 20/09/2007, Yu-Hui Jin [EMAIL PROTECTED] wrote:
 
 Hi, Pieter,
 
 Thanks!  Now the exception is gone. However, There's no snapshot file
 created in the data directory. Strangely, the snapshooter.log seems to
 complete successfully.  Any idea what else I'm missing?
 
 $ cat var/SolrHome/solr/logs/snapshooter.log
 2007/09/19 20:16:17 started by solruser
 2007/09/19 20:16:17 command: /var/SolrHome/solr/bin/snapshooter arg1
 arg2
 2007/09/19 20:16:17 taking snapshot
 var/SolrHome/solr/data/snapshot.20070919201617
 2007/09/19 20:16:17 ended (elapsed time: 0 sec)
 
 Thanks,
 
 -Hui
 
 
 
 
 On 9/19/07, Pieter Berkel [EMAIL PROTECTED] wrote:
 
 See this recent thread for some helpful info:
 
 
 http://www.nabble.com/solr-doesn%27t-find-exe-in-postCommit-event-tf426487
 9.
 html#a12167792
 
 
 You'll probably want to configure your exe with an absolute path
 rather
 than
 the dir:
 
   str name=exe/var/SolrHome/solr/bin/snapshooter/str
   str name=dir./str
 
 In order to get the snapshooter working correctly.
 
 cheers,
 Piete
 
 
 
 On 20/09/2007, Yu-Hui Jin [EMAIL PROTECTED] wrote:
 
 Hi, there,
 
 I used an absolute path for the dir param in the solrconfig.xml as
 below:
 
 listener event=postCommit class=solr.RunExecutableListener
   str name=exesnapshooter/str
   str name=dir/var/SolrHome/solr/bin/str
   bool name=waittrue/bool
   arr name=args strarg1/str strarg2/str /arr
   arr name=env strMYVAR=val1/str /arr
 /listener
 
 However, I got snapshooter: not found  exception thrown in
 catalina.out.
 I don't see why this doesn't work. Anything I'm missing?
 
 
 Many thanks,
 
 -Hui
 
 
 
 
 
 --
 Regards,
 
 -Hui
 
 
 
 
 
 
 http://www.bbc.co.uk/
 This e-mail (and any attachments) is confidential and may contain personal
 views which are not the views of the BBC unless specifically stated.
 If you have received it in error, please delete it from your system.
 Do not use, copy or disclose the information in any way nor act in reliance
 on it and notify the sender immediately.
 Please note that the BBC monitors e-mails sent or 

Re: Scripts not working on cron - always asking for password

2007-09-21 Thread Mike Klaas

On 21-Sep-07, at 7:44 AM, Daniel Alheiros wrote:


Hi

Problem solved... I had to create a private/public key for my users  
and add

it to the authorized_keys on my server...

I've used instructions on this page, quite simple actually (after  
you know

what you need to do...).

http://www.ece.uci.edu/~chou/ssh-key.html

Shouldn't this kind of information be present on the SOLR  
documentation? I'm
going to write it in my installation procedures, so I can  
contribute it back

to SOLR wiki if you think it's appropriate.


I wouldn't mind listing a brief note and a link, but trying to cover  
too many unix basics will clutter up the documentation.


-Mike