Symantec Access Management

 View Only
  • 1.  Start Up And Stop Script for WAM UI

    Posted Nov 16, 2017 08:54 AM

    Team,

     

    We recently Upgraded our CA SSO Infrastructure from 12.5 to 12.7. We are looking for Start up and Stop Scripts for WAM UI , something similar to the S98SM scripts for RHEL 7.X. Since in RHEL 7.x we need to use Systemctl and service to write the start up and stop script and not the rc2.d way, it is failing.

     

    We wanted something like:

     

    https://support.ca.com/us/knowledge-base-articles.TEC1171385.html

    https://docops.ca.com/ca-single-sign-on/12-6-01/en/installing/install-a-policy-server/install-policy-server-on-unix/configure-auto-startup 

     

    We tried:

     

    #!/bin/sh - (Optional depending on shell used)
    [Unit]

     

    Description=This Script is used to Start and Stop the Siteminder Policy Server.
    Requires=network.target
    [Service]
    Type=forking
    User=smuser
    ExecStart=/opt/Siteminder/siteminder/adminui/bin/standalone.sh &
    ExecStop=/opt/Siteminder/siteminder/adminui/bin/jboss-cli.sh -c --command=:shutdown  &
    Restart=on-abort
    SuccessExitStatus=0 1
    [Install]
    WantedBy=multi-user.target

     

    And then we removed the ExecStop:

     

    #!/bin/sh - (Optional depending on shell used)
    [Unit]

     

    Description=This Script is used to Start and Stop the Siteminder Policy Server.
    Requires=network.target
    [Service]
    Type=forking
    User=smuser
    ExecStart=/opt/Siteminder/siteminder/adminui/bin/standalone.sh &
    Restart=on-abort
    SuccessExitStatus=0 1
    [Install]
    WantedBy=multi-user.target

     

    The error we are getting is:

     

    Job for S98WAMUI.service failed because the control process exited with error code. See "systemctl status S98WAMUI.service" and "journalctl -xe" for details.

    systemctl -l status S98WAMUI

    ● S98WAMUI.service - S98sm Service

       Loaded: loaded (/etc/systemd/system/S98WAMUI.service; enabled; vendor preset: disabled)

       Active: failed (Result: exit-code) since Tue 2017-11-14 14:22:42 EST; 14s ago

      Process: 31077 ExecStart=/opt/Siteminder/siteminder/adminui/bin/standalone.sh & (code=exited, status=1/FAILURE)

     

    standalone.sh[31077]: to use (default is "standalone.xml")

    standalone.sh[31077]: (Same as -c)

    standalone.sh[31077]: -u <value>, -u=<value>              Set system property

    standalone.sh[31077]: jboss.default.multicast.address to the

    standalone.sh[31077]: given value

    standalone.sh[31077]: -v, -V, --version                   Print version and exit

    systemd[1]: S98WAMUI.service: control process exited, code=exited status=1

    systemd[1]: Failed to start S98sm Service.

    systemd[1]: Unit S98WAMUI.service entered failed state.

    systemd[1]: S98WAMUI.service failed.

     

    Thanks,

    Avinash



  • 2.  Re: Start Up And Stop Script for WAM UI
    Best Answer

    Broadcom Employee
    Posted Dec 04, 2017 06:07 PM

    Hi Avinash,

     

    The short answer is that systemd scripts do not seem to like the & character to background a command.

     

    It works if you create put the command in a shell script, e.g. /usr/local/sbin/adminui-start.sh:

    #!/bin/sh
    /opt/CA/siteminder/adminui/bin/standalone.sh &

     

    chmod +x /usr/local/sbin/adminui-start.sh

     

    And then, in the .service file:

    ExecStart=/usr/local/sbin/adminui-start.sh

     

    The stop command does not need to be put into the background so just remove the & from the end of the line:

    ExecStop=/opt/CA/siteminder/adminui/bin/jboss-cli.sh -c --command=:shutdown 



  • 3.  Re: Start Up And Stop Script for WAM UI

    Posted Mar 22, 2018 05:41 PM

    This is an old thread, but here is a way that I managed to get it working.  Please note that the user is root.  For non-root users, I am running into permission type issues upon start-up, which I have not been able to resolve yet.

    --EDITED 4/12--

    Please see KB000074545 - Auto Start Up And Stop Script for WAM UI

    Auto Start Up And Stop Script for WAM UI - CA Knowledge 

     

    I have updated the solution in the KB as there are a few minor changes.  The solution also works for non-root users.  Below is the new, updated solution.

     

    Follow these steps:
    1.Create a service by creating a new file /etc/systemd/system/NAME.service. Replace 'NAME' with any name that best represents the process you are trying to autostart.
    e.g. adminui.service

     

    2.Add the following content in the file /etc/systemd/system/NAME.service and replace adminui_root with an explicit path to the CA Single Sign-on Admin UI installation directory.
    If using root, the below works.


    [Unit]
    Description=adminui Service
    Requires=network.target
    [Service]
    Type=simple
    User=root
    Group=root
    ExecStart=/bin/ksh adminui_root/bin/standalone.sh
    ExecStop=/bin/ksh adminui_root/bin/jboss-cli.sh -c --command=:shutdown
    Restart=on-failure
    WorkingDirectory=/opt/ca/siteminder/adminui/bin
    [Install]
    WantedBy=multi-user.target

     

    Example:


    [Unit]
    Description=adminui Service
    Requires=network.target

    [Service]
    Type=simple
    User=root
    Group=root

    ExecStart=/bin/ksh /opt/ca/siteminder/adminui/bin/standalone.sh
    ExecStop=/bin/ksh /opt/ca/siteminder/adminui/bin/jboss-cli.sh -c --command=:shutdown
    Restart=on-failure
    WorkingDirectory=/opt/ca/siteminder/adminui/bin

    [Install]
    WantedBy=multi-user.target

     

    If you are using a non-root user, be sure that the user has proper permissions to execute and run the admin ui service and systemd. You will need to replace the User and Group from the example above to match the desired user. For example,


    [Unit]
    Description=adminui Service
    Requires=network.target

    [Service]
    Type=simple
    User=smuser
    Group=smuser

    ExecStart=/bin/ksh /opt/ca/siteminder/adminui/bin/standalone.sh
    ExecStop=/bin/ksh /opt/ca/siteminder/adminui/bin/jboss-cli.sh -c --command=:shutdown
    Restart=on-failure
    WorkingDirectory=/opt/ca/siteminder/adminui/bin

    [Install]
    WantedBy=multi-user.target

     

    3.Run the following commands to start the Policy Server as a service/daemon process. NOTE: Replace NAME with the name provided in step 1.
    systemctl daemon-reload
    systemctl enable NAME
    systemctl start NAME

    e.g.
    systemctl daemon-reload
    systemctl enable adminui
    systemctl start adminui

     

    3a. To disable the service at boot, run the following command:
    systemctl disable NAME

     

    Hope this helps.