7 Replies Latest reply on Apr 26, 2019 4:05 PM by myluism

    How to create a service to automatically startup WLS Forms and Reports 12c

    myluism

      Hi all.

       

      I have installed Oracle Forms and Reports 12c on an Oracle Linux Box:

       

      [weblogic@ArtFMW1 scripts]$ uname -a

      Linux ArtFMW1 4.14.35-1818.3.3.el7uek.x86_64 #2 SMP Mon Sep 24 14:45:01 PDT 2018 x86_64 x86_64 x86_64 GNU/Linux

      [weblogic@ArtFMW1 scripts]$ cat /etc/oracle-release

      Oracle Linux Server release 7.6

      [weblogic@ArtFMW1 scripts]$

       

      I have already my startup and shutdown scripts working properly. All i want is to create a service using using Oracle Linux 7 systemd.

       

      I came across this note on MOS: Automatic Stop of Database (dbshut) not working in OL 7 with systemd (Doc ID 2229679.1). This is however for starting the database service.

      [Unit]

      Description=The Oracle Database Service

      After=network.target

      [Service]

      Type=forking

      # Type=oneshot

      RemainAfterExit=yes

      KillMode=none

      # Set this to something larger if it has an impact

      TimeoutStopSec=0

      ExecStart=/u01/app/oracle/product/12.1.0.2/dbhome_1/bin/dbora start

      ExecStop=/u01/app/oracle/product/12.1.0.2/dbhome_1/bin/dbora stop

      [Install]

      # Puts wants directive for the other units in the relationship

      WantedBy=default.target

       

       

      systemctl enable dbora.service

       

       

      systemctl daemon-reload

       

       

      systemctl start dbora.service

       

      Can i just use this as a basis for my FMW F&R 12c?

       

      I'm only familiar with older procedure (/sbin/chkconfig).

       

      Thanks in advance !!!.

        • 2. Re: How to create a service to automatically startup WLS Forms and Reports 12c
          myluism

          Thanks Michael.

           

          I have already created the scripts and are working correctly.

           

          My issue here is to create a Linux Service using Oracle Linux 7 systemd.

           

          I'm about to use this as a template:

           

          [Unit]

          Description=The Oracle Database Service

          After=network.target

          [Service]

          Type=forking

          # Type=oneshot

          RemainAfterExit=yes

          KillMode=none

          # Set this to something larger if it has an impact

          TimeoutStopSec=0

          ExecStart=/u01/app/oracle/product/12.1.0.2/dbhome_1/bin/dbora start

          ExecStop=/u01/app/oracle/product/12.1.0.2/dbhome_1/bin/dbora stop

          [Install]

          # Puts wants directive for the other units in the relationship

          WantedBy=default.target

           

          I guess somebody has done this before....!!!

          • 5. Re: How to create a service to automatically startup WLS Forms and Reports 12c
            myluism

            I have created this:

             

            [root@ArtFMW1 /]# find . -name ofmw.service -print

            ./etc/systemd/system/multi-user.target.wants/ofmw.service

            ./etc/systemd/system/ofmw.service

            [root@ArtFMW1 /]# cd /etc/systemd/system/

            [root@ArtFMW1 system]# cat ofmw.service

            [Unit]

             

            Description=Oracle Fusion Middleware Forms and Reports 12c

            Wants=network.target

            After=network.target

             

            [Service]

            Type=simple

            User=weblogic

            Group=oinstall

            Environment=OPENDS_JAVA_HOME="/u01/app/oracle/jdk1.8.0_201"

             

             

            ExecStart=/home/weblogic/scripts/startup_WLS_FR.sh

            ExecStop=/home/weblogic/scripts/stop_WLS_FR.sh

             

            StandardOutput=syslog

             

            [Install]

            WantedBy=multi-user.target

             

             

            [root@ArtFMW1 system]

             

            I have rebooted the machine, but nothing happens.

             

            Obviously this is not the right place for this issue.... Anyway, if someone can give an advise, a log to check or something...

             

            Thanks !!!

            • 6. Re: How to create a service to automatically startup WLS Forms and Reports 12c
              myluism

              [root@ArtFMW1 system]# systemctl status ofmw.service

              ● ofmw.service - Oracle Fusion Middleware Forms and Reports 12c

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

                 Active: failed (Result: exit-code) since vie 2019-04-12 08:19:13 -04; 4 days ago

                Process: 4958 ExecStop=/home/weblogic/scripts/stop_WLS_FR.sh (code=exited, status=203/EXEC)

                Process: 4934 ExecStart=/home/weblogic/scripts/startup_WLS_FR.sh (code=exited, status=203/EXEC)

              Main PID: 4934 (code=exited, status=203/EXEC)

               

               

              abr 12 08:19:12 ArtFMW1 systemd[1]: Started Oracle Fusion Middleware Forms and Reports 12c.

              abr 12 08:19:13 ArtFMW1 systemd[1]: ofmw.service: main process exited, code=exited, status=203/EXEC

              abr 12 08:19:13 ArtFMW1 systemd[1]: ofmw.service: control process exited, code=exited status=203

              abr 12 08:19:13 ArtFMW1 systemd[1]: Unit ofmw.service entered failed state.

              abr 12 08:19:13 ArtFMW1 systemd[1]: ofmw.service failed.

              [root@ArtFMW1 system]#

              • 7. Re: How to create a service to automatically startup WLS Forms and Reports 12c
                myluism

                I was finally able to solve the problem.

                 

                This is the final version of service:

                 

                [root@ArtFMW1 ~]# cat /etc/systemd/system/ofmw.service

                [Unit]

                Description=Oracle Fusion Middleware Forms and Reports 12c

                 

                After=syslog.target network.target

                 

                [Service]

                Type=simple

                RemainAfterExit=yes

                User=weblogic

                Group=oinstall

                Restart=no

                 

                ExecStart=/bin/bash /home/weblogic/scripts/startup_WLS_FR.sh

                ExecStop=/bin/bash /home/weblogic/scripts/stop_WLS_FR.sh

                 

                StandardOutput=syslog

                 

                [Install]

                WantedBy=multi-user.target

                 

                [root@ArtFMW1 ~]

                 

                And the script: (only startup shown):

                [root@ArtFMW1 ~]# cat /home/weblogic/scripts/startup_WLS_FR.sh

                #!/bin/bash

                #

                # Define specific environment variables

                #

                export ORACLE_BASE=/u01/app/oracle

                export ORACLE_HOME=$ORACLE_BASE/product/12.2.1

                export MW_HOME=$ORACLE_BASE/product/12.2.1

                export WLS_HOME=$MW_HOME/wlserver

                export WL_HOME=$WLS_HOME

                export DOMAIN_BASE=$ORACLE_HOME/user_projects/domains

                export DOMAIN_HOME=$DOMAIN_BASE/frsdomain

                export OHS_INST=$DOMAIN_HOME/config/fmwconfig/components/OHS/instances/ohs1

                # Start Fusion Middleware Servers and Components

                 

                # Start NodeManager

                nohup $DOMAIN_HOME/bin/startNodeManager.sh > /dev/null 2>&1 &

                 

                # Start WebLogic Domain

                nohup $DOMAIN_HOME/bin/startWebLogic.sh > /dev/null 2>&1 &

                sleep 60

                 

                # Start the managed Servers

                nohup $DOMAIN_HOME/bin/startManagedWebLogic.sh WLS_FORMS > /dev/null 2>&1 &

                nohup $DOMAIN_HOME/bin/startManagedWebLogic.sh WLS_REPORTS > /dev/null 2>&1 &

                 

                # Start the web tier.

                $DOMAIN_HOME/bin/startComponent.sh ohs1

                sleep 15

                $DOMAIN_HOME/bin/startComponent.sh rep_server1

                [root@ArtFMW1 ~]#

                 

                In case it helps somebody out there !!!