OpenIDM Startup as a Service w/ different config

Tagged: ,

This topic has 8 replies, 3 voices, and was last updated 6 years, 3 months ago by Mike Jang.

  • Author
    Posts
  • #2995
     Brad Tumy
    Participant

    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!

    #3001
     Mike Jang
    Spectator

    Hi Brad,

    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.

    Thanks,
    Mike

    #3005
     Jake Feasel
    Moderator

    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 openidm
    #3006
     Brad Tumy
    Participant

    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.

    #3007
     Brad Tumy
    Participant

    Jake,

    Just confirmed that approach is not working for me. I get this error when starting up openidm:

    Unrecognized option: -p

    #3008
     Jake Feasel
    Moderator

    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.

    Thanks,
    Jake

    #3012
     Brad Tumy
    Participant

    Thanks Jake! I’ll give this approach a shot.

    #3113
     Mike Jang
    Spectator

    Hi,

    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

    Thanks,
    Mike

    #3264
     Mike Jang
    Spectator

    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.

    Thanks,
    Mike

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

©2021 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?