locally from custom pwd not able to acces config-file


I find this a bit weird:

In my project I download the tar.gz of release 3.1.10 and make an RPM-package of it.

The complete RPM-instalation sets custom db-path to /var/lib/orientdb/data and log path to /var/log/orientdb/
The rest of orientdb is put in /opt/orientdb/orientdb-3.1.10

in the .bashrc file I have created $ORIENTDB_HOME="/opt/orientdb/orientdb-3.1.10" ORIENTDB_BIN="$ORIENTDB_HOME/bin" ORIENTDB_CONFIG="$ORIENTDB_HOME/config"


The server is up and running with systemd.
On https port 2480 and binary ssl port 2434

So far so good and here comes the funny part

If I stand at home dir /opt/orientdb/ and want to access /opt/orientdb/orientdb-3.1.10/bin/ I can do it since it’s in my path:

    $ pwd

    OrientDB console v.3.1.10 - Veloce (build 8921c4c075030f2c351cca85a3047aaed44f464c, branch 3.1.x)
    Type 'help' to display all the supported commands.
    orientdb> pwd

    Current path: /opt/orientdb
    orientdb> connect remote:localhost:2434 root
    Enter password:
    orientdb {server=remote:localhost:2434}> set server user u123456 YmvgdOty6+6T1k/IRBEy0flFSi11H+Oe *

    Error: com.orientechnologies.orient.core.exception.OConfigurationException: Cannot access to file ../config/orientdb-server-config.xml

    orientdb {server=remote:localhost:2434}> exit

Now if I want to add server user it won’t let me since it tries to go up one level and then find config/orientdb-server-config.xml file which it of course wont since my pwd is /opt/orientdb

If I go to $ORIENTDB_HOME/bin of course it works perfectly but I would want to be the “orientdb” user and invoke the “” wherever from.

I have also found that if I edit the $ORIENTDB_HOME/bin/ file I can sneak in the “cd $ORIENTDB_HOME/bin” under “export $ORIENTDB_HOME” and then upon invoking the sub-process is using /opt/orientdb/orientdb-3.1.10/bin and when I exit i am still in /opt/orientdb.

Setup now is as follows:
Server config xml resides in /etc/orient
This works fine and the script is adjusted accordingly to point out /etc/orient/orientdb-server-config.xml.

orientdb> set server user test_user test_pass *
Error can not access …/config/orientdb-server-config.xml

I want the config-file to be moved out of the ORIENTDB_HOME since I RPM package it and I want the config to stay the same after upgrades of minor releases.

I have an ugly workaround now that works (still gives illegal access warning as usual)
$ cd /opt/orientdb/3.1.12/config
$ ln -s /etc/orient/orientdb-server-config.xml ./orientdb-server-config.xml

$ cd /opt/orientdb/3.1.12/bin
$ ./
orientdb> connect remote:localhost:2434/testdb user
Enter password:
orientdb> set server user testuser testUserPass *

This gives me “server user set correctly” but my RPM packaging makes sure the symlink is created in $ORIENTDB_HOME/config so it works for now.

The possibility to store config-files and database dirs outside of $ORIENTDB_HOME is important and I think it is transparent enough as you clearly see in $ORIENTDB_HOME/bin/ that you can point out an absolute path to the config-file but the does not seem to point out the config file. It does point out the ORIENTDB_HOME though.