#1 2014-02-12 00:00:56

japettyjohn
Member
Registered: 2014-02-11

Startup script not running

I followed the directions to support for Vertica and it generally works great (also used the post on charting and have it feeding to a d3 global).

But it does not effectively run on startup or logon (I've trying both folders) and errors when used until I run the script manually from the console.

I don't see errors on the scripts in the catalina.out - not sure where else to look on this one.

Offline

#2 2014-02-12 16:43:16

Thorsten J. Krause
datenwerke
Registered: 2012-02-15
Website

Re: Startup script not running

Hi,

sorry, I missed your comment on the blogpost. Can you check the configuration in fileserver/etc/scripting/scripting.cf?

The entries scripting.startup.login and scripting.startup.rs control the automatic script-execution on login/startup.
They should either point to
    fileserver/bin/onlogin.rs
    fileserver/bin/onstartup.rs
if you are using a single login/startup script, or to the folders
    fileserver/bin/onlogin.d
    fileserver/bin/onstartup.d

if all the content in these folders should be executed. (The default, if I remember correctly, is pointing to a single script, which in turn executes the folder contents).

Cheers,
Thorsten

Offline

#3 2014-02-12 22:07:35

japettyjohn
Member
Registered: 2014-02-11

Re: Startup script not running

Hey Thorsten,

Thanks for the very quick reply. I thought that was what it would do when I looked at those files. I've included them below and they are the stock files it came loaded with.

The vertica script is bin/onstartup.d/AddVerticaSupport.groovy and is the the sample off the blog post. Again this works fine when run through the console as you detailed there.

I tried also what you mentioned above of having <rs></rs> point to the onstartup.d folder directly intead of the onlogin.rs script, then restarted the server. I am seeing the same phenomena.

scripting.cf:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <scripting>
      <enable>true</enable>
      <restrict>
         <location>bin</location>
      </restrict>
      <startup>
         <login>fileserver/bin/onlogin.rs</login>
         <rs>fileserver/bin/onstartup.rs</rs>
      </startup>
   </scripting>
</configuration>

onlogin.rs:

base = "/fileserver/bin/onlogin.d";
 
GLOBALS.findObjects(base + "/*").each{
 tout.print base + "/" + it.getName() + "..."
 try{
 GLOBALS.exec(base + "/" + it.getName());
 tout.println "OK"
 }catch(Exception e){
 tout.println "ERR"
 }
}

onstartup.rs:

base = "/fileserver/bin/onstartup.d";
 
GLOBALS.findObjects(base + "/*").each{
tout.print base + "/" + it.getName() + "..."
try{
    GLOBALS.exec(base + "/" + it.getName());
    tout.println "OK"
  }catch(Exception e){
    tout.println "ERR"
  }
}

Last edited by japettyjohn (2014-02-12 22:08:48)

Offline

#4 2014-02-13 20:15:51

Thorsten J. Krause
datenwerke
Registered: 2012-02-15
Website

Re: Startup script not running

Hi,

I just tried the instructions and for me it's not working either. So we probably broke something in ReportServer. I'll look into this and let you know.

Cheers,
Thorsten

Offline

#5 2014-02-14 13:33:47

Thorsten J. Krause
datenwerke
Registered: 2012-02-15
Website

Re: Startup script not running

Hi,
I think I found the mistake I made yesterday. Perhaps the solution to you issue is equally simple:
Is it possible, that you logged in, before all the startup scripts were completed?
Try editing the addverticasupport.groovy script and add this line to the very end:

    System.out.println("@@@@@@@@@@@@@@ ADDVERTICA @@@@@@@@@@@@@");

Place the script in the onstartup.d folder, restart tomcat and wait until the console displays (or the logfile contains) the ADDVERTICA line. Only after that login as root and check if vertica is available as a database.

Cheers,
Thorsten

Offline

#6 2014-02-21 04:30:08

japettyjohn
Member
Registered: 2014-02-11

Re: Startup script not running

Well well! I just tried it and it works like a charm.

Thanks for the help!

Offline

Board footer

Powered by FluxBB