Geronimo
  1. Geronimo
  2. GERONIMO-4622

Contribution: Linux service script for Geronimo/WAS CE

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.1.5, 2.2
    • Fix Version/s: 2.1.5, 2.2
    • Component/s: startup/shutdown
    • Security Level: public (Regular issues)
    • Labels:
      None
    • Environment:

      RedHat Enterprise Linux v5.3
      WAS CE 2.1.1.2

      Description

      As per suggestion on WAS CE forum, I am attaching a shell script that can be used for Linux services script in Geronimo/WAS CE.
      For more information please see this thread

      1. gserviceReg_ubuntu.patch
        0.8 kB
        viola.lu
      2. gserviceReg.patch
        9 kB
        viola.lu
      3. wasce-linux-service.sh
        3 kB
        zambak

        Activity

        Hide
        zambak added a comment -

        The script is attached. Following are installation steps and posting from original forum thread (verbatim)
        -------------------------
        Hi

        I decided to share the script (attached) to manage WAS CE as a service on Linux.

        Notes:

        • this script is for RedHat Enterprise Linux (tested using WASCE 2.1.1.2 on RHEL 5.3 using Sun's JDK 1.6 64-bit)
        • the script also uses separate login/account (service account) to run WASCE (you don't want to run it as root do you? Wink
        • implementation of status function uses GShell to connect/disconnect to check if the server is up...If someone has a better idea, feel free to post a reply Happy
        • Kudos to viola.lu who got me started
        • feel free to copy, change, correct, suggest, comment, or do whatever you'd like to the script Happy

        Installation instructions:

        • copy script to /etc/rc.d/init.d and rename to wasce (or whatever you like...just note to change the name of the script in following commands also)
        • check file mode and SELinux context (if you are using SE Linux). Here is what it should look like:

        ls -laZ wasce
        -rwxr-xr-x root root system_u:object_r:initrc_exec_t wasce

        • add the service using following command:

        chkconfig --add wasce

        • set the service to start at certain runlevels

        chkconfig --level 2345 wasce on

        Now you can use service command to manage WAS CE (e.g. service wasce status)

        Cheers!

        zambak
        --------------------------------------

        Show
        zambak added a comment - The script is attached. Following are installation steps and posting from original forum thread (verbatim) ------------------------- Hi I decided to share the script (attached) to manage WAS CE as a service on Linux. Notes: this script is for RedHat Enterprise Linux (tested using WASCE 2.1.1.2 on RHEL 5.3 using Sun's JDK 1.6 64-bit) the script also uses separate login/account (service account) to run WASCE (you don't want to run it as root do you? Wink implementation of status function uses GShell to connect/disconnect to check if the server is up...If someone has a better idea, feel free to post a reply Happy Kudos to viola.lu who got me started feel free to copy, change, correct, suggest, comment, or do whatever you'd like to the script Happy Installation instructions: copy script to /etc/rc.d/init.d and rename to wasce (or whatever you like...just note to change the name of the script in following commands also) check file mode and SELinux context (if you are using SE Linux). Here is what it should look like: ls -laZ wasce -rwxr-xr-x root root system_u:object_r:initrc_exec_t wasce add the service using following command: chkconfig --add wasce set the service to start at certain runlevels chkconfig --level 2345 wasce on Now you can use service command to manage WAS CE (e.g. service wasce status) Cheers! zambak --------------------------------------
        Hide
        viola.lu added a comment -

        This is an imporved script base on Amir Mistric : run g server as a linux service and can run multiple g server services on one PC, and tested on Solaris 10 SP2/AIX 6.1/Redhat 5.2/Suse 10 SP2

        Guide:
        How to get help
        $your_G_server/bin/gserviceReg.sh

        Add service for a server
        $your_G_server/bin/gserviceReg.sh add [$servicename]
        you can create multiple service name for a server
        how to start a server
        $servicename start|status|restart|stop

        how to list server directory mapping service name
        $your_G_server/bin/gserviceReg.sh list [$servicename]

        how to del a service
        $your_G_server/bin/gserviceReg.sh del [$servicename]

        thanks.

        Show
        viola.lu added a comment - This is an imporved script base on Amir Mistric : run g server as a linux service and can run multiple g server services on one PC, and tested on Solaris 10 SP2/AIX 6.1/Redhat 5.2/Suse 10 SP2 Guide: How to get help $your_G_server/bin/gserviceReg.sh Add service for a server $your_G_server/bin/gserviceReg.sh add [$servicename] you can create multiple service name for a server how to start a server $servicename start|status|restart|stop how to list server directory mapping service name $your_G_server/bin/gserviceReg.sh list [$servicename] how to del a service $your_G_server/bin/gserviceReg.sh del [$servicename] thanks.
        Hide
        viola.lu added a comment -

        It also supports PortOffset configuration in G_server/var/config/config-substitutions.properties.

        Show
        viola.lu added a comment - It also supports PortOffset configuration in G_server/var/config/config-substitutions.properties.
        Hide
        viola.lu added a comment -

        Can someone help review and apply this patch?Thanks.

        Show
        viola.lu added a comment - Can someone help review and apply this patch?Thanks.
        Hide
        Ivan added a comment -

        It is a good feature, if no objection, I would try it and commit it trunk.

        Show
        Ivan added a comment - It is a good feature, if no objection, I would try it and commit it trunk.
        Hide
        Ivan added a comment -

        Hi, Viola:
        Here are some suggestions for your information
        1. Add Apache license to the header of the file
        2. Print the help messages like other Geronimo script
        3. If possible, the script could help to register the Geronimo as a service depend on the platform, so that it could auto-start while the OS is booting.
        Does anyone have other comments ?

        Show
        Ivan added a comment - Hi, Viola: Here are some suggestions for your information 1. Add Apache license to the header of the file 2. Print the help messages like other Geronimo script 3. If possible, the script could help to register the Geronimo as a service depend on the platform, so that it could auto-start while the OS is booting. Does anyone have other comments ?
        Hide
        viola.lu added a comment -

        Thanks ivan for your suggestion, and based on it, i updated this patch which can autostart after server boot time on Redhat 5.2, Suse 10 Sp2, Aix 6.1,Solaris 10, and ubuntu (root).
        Pls review and apply it.Thanks.

        Show
        viola.lu added a comment - Thanks ivan for your suggestion, and based on it, i updated this patch which can autostart after server boot time on Redhat 5.2, Suse 10 Sp2, Aix 6.1,Solaris 10, and ubuntu (root). Pls review and apply it.Thanks.
        Hide
        Ivan added a comment -

        Commit changes to trunk At revision: 783176, 2.1.5 At revision: 783178. Thanks Viola.lu for the patch !

        Show
        Ivan added a comment - Commit changes to trunk At revision: 783176, 2.1.5 At revision: 783178. Thanks Viola.lu for the patch !
        Hide
        Ying Tang added a comment -
        Show
        Ying Tang added a comment - This feature is documented here: http://cwiki.apache.org/confluence/display/GMOxDOC22/Running+Geronimo+as+a+Linux+service Any comments?
        Hide
        viola.lu added a comment -

        A patch for ubuntu 9.0.4, pls help review, thanks.

        Show
        viola.lu added a comment - A patch for ubuntu 9.0.4, pls help review, thanks.
        Hide
        viola.lu added a comment -

        pls review thanks.

        Show
        viola.lu added a comment - pls review thanks.
        Hide
        Ivan added a comment -

        Commit the new patch to trunk at rev 800712 and 2.1.5 snapshot At revision: 800716. Thanks !

        Show
        Ivan added a comment - Commit the new patch to trunk at rev 800712 and 2.1.5 snapshot At revision: 800716. Thanks !

          People

          • Assignee:
            Ivan
            Reporter:
            zambak
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development