[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] it is possible to load config.ini from a different location other than -configuration ?

Hi Thomas,

I did try it.

The storage actually was created in the /var/lib/myapp, great. but there also was created an error.log:

!ENTRY org.eclipse.osgi 4 0 2016-02-03 17:33:15.968
!MESSAGE Could not find bundle: org.eclipse.equinox.console
!STACK 0
org.osgi.framework.BundleException: Could not find bundle: org.eclipse.equinox.console
    at org.eclipse.core.runtime.internal.adaptor.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:58)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:331)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:231)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.main(EclipseStarter.java:208)

 So it seems that it was not possible to find and open the config.ini at /etc/myapp

I will do some debug again and let you know..

thanks a lot,

Cristiano

On 03/02/2016 17:04, Thomas Watson wrote:
You should be able to set the osgi.sharedConfiguration.area property.

java -Dosgi.sharedConfiguration.area=/etc/myapp -jar org.eclipse.osgi.jar -configuration /var/lib/myapp/

If I recall correctly that should treat the shared configuration directory as read-only and load the config.ini from there for the shared config settings, but then the framework should use the /var/lib/myapp/ folder for its persist storage area, as well as merge in a config.ini from there if it exists.  If you were using the standard Framework launching API you would pass the osgi.sharedConfiguration.area setting in the framework configuration map.

Tom





From:        Cristiano Gavião <cvgaviao@xxxxxxxxx>
To:        equinox-dev@xxxxxxxxxxx
Date:        02/03/2016 01:24 PM
Subject:        Re: [equinox-dev] it is possible to load config.ini from a different location other than -configuration ?
Sent by:        equinox-dev-bounces@xxxxxxxxxxx




Hi,

Yep, I've tried to debug the source code using it now... But didn't help

In order to load the config.ini, equinox uses the PROP_CONFIG_AREA variable to compose config.ini location.

If I use the FRAMEWORK_STORAGE pointing to a different location other than the -configuration args, equinox will set the PROP_CONFIG_AREA to its value.

// Initializes the Location objects for the LocationManager.
        // set the osgi storage area if it exists
        String osgiStorage = equinoxConfig.getConfiguration(Constants.FRAMEWORK_STORAGE);
        if (osgiStorage != null)
            equinoxConfig.setConfiguration(PROP_CONFIG_AREA, osgiStorage);

------
try {
            location = new URL(configArea.getURL().toExternalForm() + CONFIG_FILE);
        } catch (MalformedURLException e) {
            // its ok.  This should never happen
        }



And what will happen is that the config.ini will not be found :(


so seems not to be possible to do what I want in current version... unless there is something that I'm missing...

thanks

On 03/02/2016 15:38, Raymond Auge wrote:
Have you tried to osgi framework properties?
e.g.

https://osgi.org/javadoc/r5/core/org/osgi/framework/Constants.html#FRAMEWORK_STORAGE

I think the eclipse launcher supports those as system properties.

Sincerely,
- Ray

On Wed, Feb 3, 2016 at 1:13 PM, Cristiano Gavião <cvgaviao@xxxxxxxxx> wrote:
Hello,

I'm trying to set Equinox to run as a linux systemd service.

I set the service to launch using java -jar org.eclipse.osgi -configuration /etc/myapp.

The idea was to install config.ini (set as conffile) at /etc/myapp and let the configuration data to be created at /var/lib/myapp directory.

I tried many configurations combination but it always try to create storage directories relative to where config.ini file is, which gives some errors due the fact that user which is starting it do not had permissions to create directories inside /etc dir.

one alternative that comes to mind was to create a symlimk in etc/myapp/config.ini  pointinf to var/lib/myapp/config.ini.

anyway, I would be grateful for any opinion.

thanks,

Cristiano
_______________________________________________
equinox-dev mailing list

equinox-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

https://dev.eclipse.org/mailman/listinfo/equinox-dev



--

Raymond Augé (@rotty3000)
Senior Software Architect Liferay, Inc. (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance (@OSGiAlliance)


_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev



_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/equinox-dev