How to add Ofbiz to Solaris 10 services?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to add Ofbiz to Solaris 10 services?

Terence Ng
Hi,

How do I add Ofbiz to Solaris 10 services?  Where can I find the service manifest file?

Regards,
Terence
Reply | Threaded
Open this post in threaded view
|

Re: How to add Ofbiz to Solaris 10 services?

Jacques Le Roux
Administrator
If it differs from Linux, any appreciated answer would go in the wiki at
http://docs.ofbiz.org/display/OFBIZ/How+to+run+OFBiz+as+a+Service

Thanks

Jacques

From: "Terence Ng" <[hidden email]>

>
> Hi,
>
> How do I add Ofbiz to Solaris 10 services?  Where can I find the service
> manifest file?
>
> Regards,
> Terence
> --
> View this message in context: http://n4.nabble.com/How-to-add-Ofbiz-to-Solaris-10-services-tp621455p621455.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|

Re: How to add Ofbiz to Solaris 10 services?

Chris Snow-3
This script is a hack of the ofbiz linux script.  It could do with a
tidy up, but it works and is running on a production Solaris 10 Sparc
Server running ofbiz 4.0.  It may get you started with what you need.

> #!/bin/sh
>
> JAVA_BINARY=/export/home/ofbiz/jdk1.6.0_13/bin/java
> OFBIZ_HOME=/export/home/ofbiz/ofbiz
> OFBIZ_LOG=$OFBIZ_HOME/runtime/logs/console.log
>
> JAVA_VMOPTIONS="-Xms768M -Xmx1024M -Duser.language=en"
> JAVA_ARGS="-jar ${OFBIZ_HOME}/ofbiz.jar"
> OFBIZ_USER=ofbiz
>
> ofbizprocs() {
>     OFBIZ_PROCS=`pgrep -u ${OFBIZ_USER} java`
> }
>
> start() {
>     echo "Starting OFBiz: "
>     ofbizprocs
>     if [ "$OFBIZ_PROCS" != "" ]; then
>         echo "OFBiz is already running..."
>         return 1
>     fi
>
>     # All clear
>     cd $OFBIZ_HOME
>     umask 007
>     /bin/rm -f $OFBIZ_LOG
>     su - ofbiz -c "cd $OFBIZ_HOME && $JAVA_BINARY $JAVA_VMOPTIONS
> $JAVA_ARGS >>$OFBIZ_LOG 2>>$OFBIZ_LOG&"
>     echo "startup return value: " $?
>     return 0
> }
>
> # Stop OFBiz
> stop() {
>     echo -n "Stopping OFBiz: "
>     ofbizprocs
>     if [ "$OFBIZ_PROCS" = "" ]; then
>         echo "OFBiz is not running..."
>         return 1
>     fi
>
>     # All clear
>     cd $OFBIZ_HOME
>     umask 007    
>     su - ofbiz -c "cd $OFBIZ_HOME && $JAVA_BINARY $JAVA_VMOPTIONS
> $JAVA_ARGS -shutdown >>$OFBIZ_LOG"
>     ofbizprocs
>     if [ "$OFBIZ_PROCS" != "" ]; then
>         # Let's try to -TERM
>         /bin/kill -TERM $OFBIZ_PROCS
>     fi
>     ofbizprocs
>     if [ "$OFBIZ_PROCS" != "" ]; then
>         # Let's try it the hard way!
>         /bin/kill -9 $OFBIZ_PROCS
>     fi
>     ofbizprocs
>     if [ "$OFBIZ_PROCS" != "" ]; then
>         echo "Some processes could not be stopped:"
>         echo $OFBIZ_PROCS
>         echo "A possible solution is to try this command once more!"
>         return 1
>     else
>         return 0
>     fi
> }
>
> case "$1" in
>     'start')
>         start
>     ;;
>     'stop')
>         stop
>     ;;
>     'restart')
>         stop
>         start
>     ;;  
>     'status')
>         ofbizprocs
>         if [ "$OFBIZ_PROCS" = "" ]; then
>             echo "OFBiz is stopped"
>             exit 1
>         else
>             echo "OFBiz is running"
>             exit 0
>         fi
>     ;;
>     *)
>         echo "Usage: $0 {start|stop|kill|restart|status|help}"
>         exit 1
>     ;;
> esac
> echo
> exit $?


Jacques Le Roux wrote:

> If it differs from Linux, any appreciated answer would go in the wiki
> at http://docs.ofbiz.org/display/OFBIZ/How+to+run+OFBiz+as+a+Service
>
> Thanks
>
> Jacques
>
> From: "Terence Ng" <[hidden email]>
>>
>> Hi,
>>
>> How do I add Ofbiz to Solaris 10 services?  Where can I find the service
>> manifest file?
>>
>> Regards,
>> Terence
>> --
>> View this message in context:
>> http://n4.nabble.com/How-to-add-Ofbiz-to-Solaris-10-services-tp621455p621455.html 
>>
>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: How to add Ofbiz to Solaris 10 services?

Jacques Le Roux
Administrator
Thanks Chris,

I have uploaded at http://docs.ofbiz.org/display/OFBIZ/How+to+run+OFBiz+as+a+Service

Jacques

From: "Christopher Snow" <[hidden email]>

> This script is a hack of the ofbiz linux script.  It could do with a
> tidy up, but it works and is running on a production Solaris 10 Sparc
> Server running ofbiz 4.0.  It may get you started with what you need.
>
>> #!/bin/sh
>>
>> JAVA_BINARY=/export/home/ofbiz/jdk1.6.0_13/bin/java
>> OFBIZ_HOME=/export/home/ofbiz/ofbiz
>> OFBIZ_LOG=$OFBIZ_HOME/runtime/logs/console.log
>>
>> JAVA_VMOPTIONS="-Xms768M -Xmx1024M -Duser.language=en"
>> JAVA_ARGS="-jar ${OFBIZ_HOME}/ofbiz.jar"
>> OFBIZ_USER=ofbiz
>>
>> ofbizprocs() {
>>     OFBIZ_PROCS=`pgrep -u ${OFBIZ_USER} java`
>> }
>>
>> start() {
>>     echo "Starting OFBiz: "
>>     ofbizprocs
>>     if [ "$OFBIZ_PROCS" != "" ]; then
>>         echo "OFBiz is already running..."
>>         return 1
>>     fi
>>
>>     # All clear
>>     cd $OFBIZ_HOME
>>     umask 007
>>     /bin/rm -f $OFBIZ_LOG
>>     su - ofbiz -c "cd $OFBIZ_HOME && $JAVA_BINARY $JAVA_VMOPTIONS
>> $JAVA_ARGS >>$OFBIZ_LOG 2>>$OFBIZ_LOG&"
>>     echo "startup return value: " $?
>>     return 0
>> }
>>
>> # Stop OFBiz
>> stop() {
>>     echo -n "Stopping OFBiz: "
>>     ofbizprocs
>>     if [ "$OFBIZ_PROCS" = "" ]; then
>>         echo "OFBiz is not running..."
>>         return 1
>>     fi
>>
>>     # All clear
>>     cd $OFBIZ_HOME
>>     umask 007    
>>     su - ofbiz -c "cd $OFBIZ_HOME && $JAVA_BINARY $JAVA_VMOPTIONS
>> $JAVA_ARGS -shutdown >>$OFBIZ_LOG"
>>     ofbizprocs
>>     if [ "$OFBIZ_PROCS" != "" ]; then
>>         # Let's try to -TERM
>>         /bin/kill -TERM $OFBIZ_PROCS
>>     fi
>>     ofbizprocs
>>     if [ "$OFBIZ_PROCS" != "" ]; then
>>         # Let's try it the hard way!
>>         /bin/kill -9 $OFBIZ_PROCS
>>     fi
>>     ofbizprocs
>>     if [ "$OFBIZ_PROCS" != "" ]; then
>>         echo "Some processes could not be stopped:"
>>         echo $OFBIZ_PROCS
>>         echo "A possible solution is to try this command once more!"
>>         return 1
>>     else
>>         return 0
>>     fi
>> }
>>
>> case "$1" in
>>     'start')
>>         start
>>     ;;
>>     'stop')
>>         stop
>>     ;;
>>     'restart')
>>         stop
>>         start
>>     ;;  
>>     'status')
>>         ofbizprocs
>>         if [ "$OFBIZ_PROCS" = "" ]; then
>>             echo "OFBiz is stopped"
>>             exit 1
>>         else
>>             echo "OFBiz is running"
>>             exit 0
>>         fi
>>     ;;
>>     *)
>>         echo "Usage: $0 {start|stop|kill|restart|status|help}"
>>         exit 1
>>     ;;
>> esac
>> echo
>> exit $?
>
>
> Jacques Le Roux wrote:
>> If it differs from Linux, any appreciated answer would go in the wiki
>> at http://docs.ofbiz.org/display/OFBIZ/How+to+run+OFBiz+as+a+Service
>>
>> Thanks
>>
>> Jacques
>>
>> From: "Terence Ng" <[hidden email]>
>>>
>>> Hi,
>>>
>>> How do I add Ofbiz to Solaris 10 services?  Where can I find the service
>>> manifest file?
>>>
>>> Regards,
>>> Terence
>>> --
>>> View this message in context:
>>> http://n4.nabble.com/How-to-add-Ofbiz-to-Solaris-10-services-tp621455p621455.html 
>>>
>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>
>>
>