You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by cooshal <ku...@gmail.com> on 2019/05/16 12:54:41 UTC

Is it possible to start karaf, execute commands and exit (from script)?

Hi:

I am trying to provision karaf instances, and for that I have installed
service wrapper. For that, currently I have to start the karaf instance and
manually install service wrapper and quit and again start the karaf instance
as a service. [My use case is with Windows]

I was wondering if there is a way to execute these steps via some script. 
For instance, may be using some batch script, I wanted to be able to execute
"create-karaf-note.bat", which unzips my custom karaf distribution (this is
done via powershell), alter some configs (again via powershell), start karaf
(*), execute wrapper:install ... (*), and exit. That way, I have a
ready-to-run karaf instance.

I am confused about the tasks that I have marked in (*). Any tips on this
would be helpful.

Regards,
Cooshal.



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Is it possible to start karaf, execute commands and exit (from script)?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
No problem at all ;) The mailing list is here to help each other ;)

And I'm happy you have your custom distro ;)

Let me know if you need anything.

Regards
JB

On 16/05/2019 16:04, cooshal wrote:
> oh, my bad ! should have looked there carefully. ;)
> 
> Thanks.
> 
> Now, I can generate a custom karaf distribution with my desired config
> values with minimal manual intervention.
> 
> Regards,
> Cooshal.
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Is it possible to start karaf, execute commands and exit (from script)?

Posted by cooshal <ku...@gmail.com>.
oh, my bad ! should have looked there carefully. ;)

Thanks.

Now, I can generate a custom karaf distribution with my desired config
values with minimal manual intervention.

Regards,
Cooshal.



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Is it possible to start karaf, execute commands and exit (from script)?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
By the way, you can see the tip in the documentation:

http://karaf.apache.org/manual/latest/#_service_wrapper

see the NOTE in the installation section.

Regards
JB

On 16/05/2019 15:10, cooshal wrote:
> Hi JB:
> 
> thank you for the tip.
> 
> I will try this out.
> 
> Regards,
> Cooshal.
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Is it possible to start karaf, execute commands and exit (from script)?

Posted by cooshal <ku...@gmail.com>.
Hi JB:

thank you for the tip.

I will try this out.

Regards,
Cooshal.



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Is it possible to start karaf, execute commands and exit (from script)?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Cooshal,

There's simply way to install the wrapper without starting the instance.
You just have to do:

bin/shell wrapper:install

Regards
JB

On 16/05/2019 14:54, cooshal wrote:
> Hi:
> 
> I am trying to provision karaf instances, and for that I have installed
> service wrapper. For that, currently I have to start the karaf instance and
> manually install service wrapper and quit and again start the karaf instance
> as a service. [My use case is with Windows]
> 
> I was wondering if there is a way to execute these steps via some script. 
> For instance, may be using some batch script, I wanted to be able to execute
> "create-karaf-note.bat", which unzips my custom karaf distribution (this is
> done via powershell), alter some configs (again via powershell), start karaf
> (*), execute wrapper:install ... (*), and exit. That way, I have a
> ready-to-run karaf instance.
> 
> I am confused about the tasks that I have marked in (*). Any tips on this
> would be helpful.
> 
> Regards,
> Cooshal.
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com