You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by samliu <vi...@gmail.com> on 2013/04/30 15:12:54 UTC

Change Karaf data folder location when running it as Windows Service

Hi,

Does anyone know how I can move the data folder to somewhere else while
running Karaf as a Windows service?

The longer story is that I was able to change the location of the data cache
folder to somewhere else by modifying the karaf.bat file and running it in
cmd window. However, when I used wrapper to wrap karaf as a Windows service,
and ran it in that way, the data cache folder went back to its default
location.

Thanks!

Sam



--
View this message in context: http://karaf.922171.n3.nabble.com/Change-Karaf-data-folder-location-when-running-it-as-Windows-Service-tp4028534.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.

Re: Change Karaf data folder location when running it as Windows Service

Posted by samliu <vi...@gmail.com>.
Yes, I tried with an absolute path for wrapper.logfile, but it still didn't
work... I have KARAF_DATA set up as an environment variable in Windows 7.
All the data folders in karaf were moved to the location I wanted.

Also, I found that by setting wrapper.console.format blank won't disable the
console log output, which would generate the wrapper.log file in the karaf
installation directory. However, I did find any another wrapper.log file in
the karaf data folder, which however contains less info than the one in the
karaf installation directory.

Hope these observations can help solve the issue if it is one :)

Thanks!

 



--
View this message in context: http://karaf.922171.n3.nabble.com/Change-Karaf-data-folder-location-when-running-it-as-Windows-Service-tp4028534p4028542.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.

Re: Change Karaf data folder location when running it as Windows Service

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

nice catch.

It should work if you update the karaf-wrapper.conf file:

wrapper.logfile=%KARAF_DATA%\log\wrapper.log

Did you try to use an absolute path here instead of the KARAF_DATA variable:

wrapper.logfile="c:\path\to\wrapper.log"

?

Is KARAF_DATA define in the first section of the karaf-wraper.conf file, 
like this:

set.default.KARAF_DATA=${karaf.data}

?

Regards
JB

On 04/30/2013 06:33 PM, samliu wrote:
> I was able to move the data folder of Karaf to somewhere else by modifying
> the KARAF_DATA, however, a wrapper.log file will be generated in the Karaf
> installation directory once running karaf as a windows service. I modified
> the wrapper.logfile in wrapper.conf, but it didn't work. Any suggestion?
>
> Thanks!!
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Change-Karaf-data-folder-location-when-running-it-as-Windows-Service-tp4028534p4028540.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>

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

Re: Change Karaf data folder location when running it as Windows Service

Posted by samliu <vi...@gmail.com>.
I was able to move the data folder of Karaf to somewhere else by modifying
the KARAF_DATA, however, a wrapper.log file will be generated in the Karaf
installation directory once running karaf as a windows service. I modified
the wrapper.logfile in wrapper.conf, but it didn't work. Any suggestion?

Thanks!!



--
View this message in context: http://karaf.922171.n3.nabble.com/Change-Karaf-data-folder-location-when-running-it-as-Windows-Service-tp4028534p4028540.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.

Re: Change Karaf data folder location when running it as Windows Service

Posted by samliu <vi...@gmail.com>.
Thanks for the note! That's very helpful. I modified the KARAF_DATA so that
it is just the data folder that will be moved. 



--
View this message in context: http://karaf.922171.n3.nabble.com/Change-Karaf-data-folder-location-when-running-it-as-Windows-Service-tp4028534p4028536.html
Sent from the Karaf - Dev mailing list archive at Nabble.com.

Re: Change Karaf data folder location when running it as Windows Service

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

you can update the wrapper.conf to define a different KARAF_BASE, the 
data folder will be relative to the KARAF_BASE variable.

Is it OK for you ?

Regards
JB

On 04/30/2013 03:12 PM, samliu wrote:
> Hi,
>
> Does anyone know how I can move the data folder to somewhere else while
> running Karaf as a Windows service?
>
> The longer story is that I was able to change the location of the data cache
> folder to somewhere else by modifying the karaf.bat file and running it in
> cmd window. However, when I used wrapper to wrap karaf as a Windows service,
> and ran it in that way, the data cache folder went back to its default
> location.
>
> Thanks!
>
> Sam
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Change-Karaf-data-folder-location-when-running-it-as-Windows-Service-tp4028534.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>

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