February 6, 2015 at 8:37 pm #2995
Is it possible to reference a different configuration directory in the start up scripts?
Using OpenIDM’s model to reference different “samples” during startup (e.g. ./startup.sh -p sample/sample1) I have created a directory called “acme” and have stored the ./conf ./tools and ./script directories. I can successfully startup openidm using this directory when I am starting openidm manually (e.g. ./startup.sh -p acme) but can’t quite figure out how to do the same using the startup scripts that openidm has configured in the /etc/init.d/ directory.
Any advice on where to include the “-p acme” option?
Thanks!February 6, 2015 at 11:50 pm #3001
Perhaps you could just copy files from your custom setup to /path/to/openidm?
In my personal opinion (and that’s my personal opinion only), I do think we should address your scenario in some way. In other words, either
1) Set up the create-oepnidm-rc.sh script to support setting up a SysV-style script in /etc/init.d, which points to a custom directory.
2) Provide instructions for how to set that up in the docs.
For that purpose, I’ve set up OPENIDM-2882. Please feel free to edit / modify that JIRA.
MikeFebruary 7, 2015 at 7:19 pm #3005Jake FeaselModerator
When you generate the init.d script (using bin/create-openidm-rc.sh) you can define which options you want to use when starting the OpenIDM service. All you have to do is define the OPENIDM_OPTS environment variable prior to running the script, like so:
export OPENIDM_OPTS="-p acme/ -Dfile.encoding=UTF-8 -Xmx1024m -Xms1024m" ./create-openidm-rc.sh cp openidm /etc/init.d chkconfig --add openidmFebruary 7, 2015 at 9:56 pm #3006
Thanks Mike and Jake.
Jake, I had tried that and it didn’t appear to work. I’ll check my config again and give it another go. I know I didn’t include the trailing slash, perhaps that was my issue.February 7, 2015 at 10:52 pm #3007
Just confirmed that approach is not working for me. I get this error when starting up openidm:
Unrecognized option: -pFebruary 8, 2015 at 7:39 am #3008Jake FeaselModerator
Brad, sorry you are correct. I realize now that I have used this method to set other flags to the java process, but not specifically that parameter. As I dig in a bit deeper to this, I found found a work-around:
Generate the rc script in the normal way (without defining the OPENIDM_OPTS environment variable) then edit the openidm script on line 43, like so:
org.forgerock.commons.launcher.Main -c bin/launcher.json -p acme > logs/server.out 2>&1 &"
Note the addition of -p acme there. Then you can copy it to /etc/init.d and use it as normal. This ought to work – I’ve actually tested it myself this time!
This is something that probably deserves an new ticket on bugster so that we can make it more straightforward.
JakeFebruary 9, 2015 at 3:23 pm #3012
Thanks Jake! I’ll give this approach a shot.February 17, 2015 at 5:42 pm #3113
FYI, I’ve updated https://bugster.forgerock.org/jira/browse/OPENIDM-2882 with Jake’s info, and will make some time to add the procedure to the docs, probably to this section: http://openidm.forgerock.org/doc/bootstrap/integrators-guide/index.html#linux-service
MikeFebruary 27, 2015 at 5:43 pm #3264
Just following up,
I’ve now updated the source for http://openidm.forgerock.org/doc/bootstrap/integrators-guide/index.html#linux-service . The changes that Jake suggested should appear shortly. So I’ve closed OPENIDM-2882.
You must be logged in to reply to this topic.