You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by youhaodeyi <yo...@gmail.com> on 2009/11/23 07:33:42 UTC

How can I let servicemix running at background?

when I run bin/servicemix, it will block the current shell and the log will
be shown in the current console. How can I start servicemix in the
background? I want to set it to a OS service and starts when OS starts.

thanks,

Zhao Yi
-- 
View this message in context: http://old.nabble.com/How-can-I-let-servicemix-running-at-background--tp26473351p26473351.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How can I let servicemix running at background?

Posted by Dmitry Ulanov <du...@gmail.com>.
   1. nohup bin/servicemix &
   2. or use Java Service Wrapper (http://wrapper.tanukisoftware.org)


On Mon, Nov 23, 2009 at 9:33 AM, youhaodeyi <yo...@gmail.com> wrote:

>
> when I run bin/servicemix, it will block the current shell and the log will
> be shown in the current console. How can I start servicemix in the
> background? I want to set it to a OS service and starts when OS starts.
>
> thanks,
>
> Zhao Yi
> --
> View this message in context:
> http://old.nabble.com/How-can-I-let-servicemix-running-at-background--tp26473351p26473351.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>

Re: How can I let servicemix running at background?

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Isnt there a Java Wrapper project (also used by Mule) to let it run
automatic on various platforms, also Windows
http://wrapper.tanukisoftware.org/doc/english/download.jsp


On Mon, Nov 23, 2009 at 9:33 AM, Stuart Roe <st...@ovic.co.uk> wrote:
> Anybody aware of a reliable way for getting servicemix running as a windows
> service?
>
> Stuart
>
> -----Original Message-----
> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
> Sent: 23 November 2009 07:50
> To: users@servicemix.apache.org
> Subject: Re: How can I let servicemix running at background?
>
> Hi,
>
> I guess that you are on Unix as you use the bin/servicemix launcher.
>
> first, you can run:
>
> nohup $SERVICEMIX_HOME/bin/servicemix &
>
> ServiceMix will be run in background and you can detach your terminal.
>
> To manage the start/stop of ServiceMix using system runlevel, if you are on
> a System V unix (like Linux), first you need to create a init script in the
> /etc/init.d directory. This script should looks like:
>
> #!/bin/sh
> ### BEGIN INIT INFO
> # Provides: servicemix
> # Required-Start: $remote-fs $syslog
> # Required-Stop:  $remote-fs $syslog
> # Default-Start:  3 4 5
> # Default-Stop:   1
> # Short-Description: Apache ServiceMix ESB ### END INIT INFO set -e #
> /etc/init.d/servicemix: start and stop the Apache ServiceMix ESB umask 022
> SMX_HOME=/opt/apache-servicemix-3.3.1
> SMX_USER=servicemix
> . /lib/lsb/init-functions
> case "$1" in
>    start)
>       log_daemon_msg "Starting Apache ServiceMix ESB" "servicemix"
>       /bin/su -p -s /bin/sh $SMX_USER -c $SMX_HOME/bin/servicemix &
>       cat $! > /var/run/servicemix.pid
>    ;;
>    stop)
>       log_daemon_msg "Stopping Apache ServiceMix ESB" "servicemix"
>       if [ -f /var/run/servicemix.pid ]; then
>        read pid < /var/run/servicemix.pid
>        kill -9 $pid
>       fi
>    ;;
>    restart)
>        $0 stop
>        $0 start
>    ;;
>    *)
>       log_action_msg "Usage: /etc/init.d/servicemix {start|stop|restart}"
>       exit 1
> esac
> exit 0
>
> After, you make the link on the runlevel that you want (ln -s
> /etc/init.d/servicemix /etc/rc3.d/S20servicemix, ln -s
> /etc/init.d/servicemix /etc/rc0.d/K20servicemix, ln -s
> /etc/init.d/servicemix /etc/rc6.d/K20servicemix) or you can use the
> update-rc script provided by your system.
>
> Regards
> JB
>
> youhaodeyi wrote:
>> when I run bin/servicemix, it will block the current shell and the log
>> will be shown in the current console. How can I start servicemix in
>> the background? I want to set it to a OS service and starts when OS
> starts.
>>
>> thanks,
>>
>> Zhao Yi
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: How can I let servicemix running at background?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Stuart,

sorry, I'm not aware a lot on windows :)

I think that you can register the servicemix.bat script as a windows 
service. For example, Weblogic provide a script to register the launcher 
script as a windows service (svc). I can check in this script how it's made.

Regards
JB

Stuart Roe wrote:
> Anybody aware of a reliable way for getting servicemix running as a windows
> service?
> 
> Stuart 
> 
> -----Original Message-----
> From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
> Sent: 23 November 2009 07:50
> To: users@servicemix.apache.org
> Subject: Re: How can I let servicemix running at background?
> 
> Hi,
> 
> I guess that you are on Unix as you use the bin/servicemix launcher.
> 
> first, you can run:
> 
> nohup $SERVICEMIX_HOME/bin/servicemix &
> 
> ServiceMix will be run in background and you can detach your terminal.
> 
> To manage the start/stop of ServiceMix using system runlevel, if you are on
> a System V unix (like Linux), first you need to create a init script in the
> /etc/init.d directory. This script should looks like:
> 
> #!/bin/sh
> ### BEGIN INIT INFO
> # Provides: servicemix
> # Required-Start: $remote-fs $syslog
> # Required-Stop:  $remote-fs $syslog
> # Default-Start:  3 4 5
> # Default-Stop:   1
> # Short-Description: Apache ServiceMix ESB ### END INIT INFO set -e #
> /etc/init.d/servicemix: start and stop the Apache ServiceMix ESB umask 022
> SMX_HOME=/opt/apache-servicemix-3.3.1
> SMX_USER=servicemix
> . /lib/lsb/init-functions
> case "$1" in
>     start)
>        log_daemon_msg "Starting Apache ServiceMix ESB" "servicemix"
>        /bin/su -p -s /bin/sh $SMX_USER -c $SMX_HOME/bin/servicemix &
>        cat $! > /var/run/servicemix.pid
>     ;;
>     stop)
>        log_daemon_msg "Stopping Apache ServiceMix ESB" "servicemix"
>        if [ -f /var/run/servicemix.pid ]; then
> 	read pid < /var/run/servicemix.pid
> 	kill -9 $pid
>        fi
>     ;;
>     restart)
> 	$0 stop
> 	$0 start
>     ;;
>     *)
>        log_action_msg "Usage: /etc/init.d/servicemix {start|stop|restart}"
>        exit 1
> esac
> exit 0
> 
> After, you make the link on the runlevel that you want (ln -s
> /etc/init.d/servicemix /etc/rc3.d/S20servicemix, ln -s
> /etc/init.d/servicemix /etc/rc0.d/K20servicemix, ln -s
> /etc/init.d/servicemix /etc/rc6.d/K20servicemix) or you can use the
> update-rc script provided by your system.
> 
> Regards
> JB
> 
> youhaodeyi wrote:
>> when I run bin/servicemix, it will block the current shell and the log 
>> will be shown in the current console. How can I start servicemix in 
>> the background? I want to set it to a OS service and starts when OS
> starts.
>> thanks,
>>
>> Zhao Yi
> 

RE: How can I let servicemix running at background?

Posted by Stuart Roe <st...@ovic.co.uk>.
Anybody aware of a reliable way for getting servicemix running as a windows
service?

Stuart 

-----Original Message-----
From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
Sent: 23 November 2009 07:50
To: users@servicemix.apache.org
Subject: Re: How can I let servicemix running at background?

Hi,

I guess that you are on Unix as you use the bin/servicemix launcher.

first, you can run:

nohup $SERVICEMIX_HOME/bin/servicemix &

ServiceMix will be run in background and you can detach your terminal.

To manage the start/stop of ServiceMix using system runlevel, if you are on
a System V unix (like Linux), first you need to create a init script in the
/etc/init.d directory. This script should looks like:

#!/bin/sh
### BEGIN INIT INFO
# Provides: servicemix
# Required-Start: $remote-fs $syslog
# Required-Stop:  $remote-fs $syslog
# Default-Start:  3 4 5
# Default-Stop:   1
# Short-Description: Apache ServiceMix ESB ### END INIT INFO set -e #
/etc/init.d/servicemix: start and stop the Apache ServiceMix ESB umask 022
SMX_HOME=/opt/apache-servicemix-3.3.1
SMX_USER=servicemix
. /lib/lsb/init-functions
case "$1" in
    start)
       log_daemon_msg "Starting Apache ServiceMix ESB" "servicemix"
       /bin/su -p -s /bin/sh $SMX_USER -c $SMX_HOME/bin/servicemix &
       cat $! > /var/run/servicemix.pid
    ;;
    stop)
       log_daemon_msg "Stopping Apache ServiceMix ESB" "servicemix"
       if [ -f /var/run/servicemix.pid ]; then
	read pid < /var/run/servicemix.pid
	kill -9 $pid
       fi
    ;;
    restart)
	$0 stop
	$0 start
    ;;
    *)
       log_action_msg "Usage: /etc/init.d/servicemix {start|stop|restart}"
       exit 1
esac
exit 0

After, you make the link on the runlevel that you want (ln -s
/etc/init.d/servicemix /etc/rc3.d/S20servicemix, ln -s
/etc/init.d/servicemix /etc/rc0.d/K20servicemix, ln -s
/etc/init.d/servicemix /etc/rc6.d/K20servicemix) or you can use the
update-rc script provided by your system.

Regards
JB

youhaodeyi wrote:
> when I run bin/servicemix, it will block the current shell and the log 
> will be shown in the current console. How can I start servicemix in 
> the background? I want to set it to a OS service and starts when OS
starts.
> 
> thanks,
> 
> Zhao Yi


Re: How can I let servicemix running at background?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

I guess that you are on Unix as you use the bin/servicemix launcher.

first, you can run:

nohup $SERVICEMIX_HOME/bin/servicemix &

ServiceMix will be run in background and you can detach your terminal.

To manage the start/stop of ServiceMix using system runlevel, if you are 
on a System V unix (like Linux), first you need to create a init script 
in the /etc/init.d directory. This script should looks like:

#!/bin/sh
### BEGIN INIT INFO
# Provides: servicemix
# Required-Start: $remote-fs $syslog
# Required-Stop:  $remote-fs $syslog
# Default-Start:  3 4 5
# Default-Stop:   1
# Short-Description: Apache ServiceMix ESB
### END INIT INFO
set -e
# /etc/init.d/servicemix: start and stop the Apache ServiceMix ESB
umask 022
SMX_HOME=/opt/apache-servicemix-3.3.1
SMX_USER=servicemix
. /lib/lsb/init-functions
case "$1" in
    start)
       log_daemon_msg "Starting Apache ServiceMix ESB" "servicemix"
       /bin/su -p -s /bin/sh $SMX_USER -c $SMX_HOME/bin/servicemix &
       cat $! > /var/run/servicemix.pid
    ;;
    stop)
       log_daemon_msg "Stopping Apache ServiceMix ESB" "servicemix"
       if [ -f /var/run/servicemix.pid ]; then
	read pid < /var/run/servicemix.pid
	kill -9 $pid
       fi
    ;;
    restart)
	$0 stop
	$0 start
    ;;
    *)
       log_action_msg "Usage: /etc/init.d/servicemix {start|stop|restart}"
       exit 1
esac
exit 0

After, you make the link on the runlevel that you want (ln -s 
/etc/init.d/servicemix /etc/rc3.d/S20servicemix, ln -s 
/etc/init.d/servicemix /etc/rc0.d/K20servicemix, ln -s 
/etc/init.d/servicemix /etc/rc6.d/K20servicemix) or you can use the 
update-rc script provided by your system.

Regards
JB

youhaodeyi wrote:
> when I run bin/servicemix, it will block the current shell and the log will
> be shown in the current console. How can I start servicemix in the
> background? I want to set it to a OS service and starts when OS starts.
> 
> thanks,
> 
> Zhao Yi

Re: How can I let servicemix running at background?

Posted by Gert Vanthienen <ge...@gmail.com>.
L.S.,

You can find more detailed information about configuring the wrapper
on http://servicemix.apache.org/configure-servicemix-as-a-windows-service.html.
 If you're using Ubuntu Server (or another distro that supports
Upstart) you can also have a look at
http://servicemix.apache.org/using-upstart-to-run-servicemix-on-ubuntu.html.

For ServiceMix 3.x, you still have to do the configuration manually.
For ServiceMix 4 and higher, you can also install the wrapper features
and use it to configure the wrapper scripts.

Regards,

Gert Vanthienen
------------------------
Open Source SOA: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/



2009/11/23 youhaodeyi <yo...@gmail.com>:
>
> when I run bin/servicemix, it will block the current shell and the log will
> be shown in the current console. How can I start servicemix in the
> background? I want to set it to a OS service and starts when OS starts.
>
> thanks,
>
> Zhao Yi
> --
> View this message in context: http://old.nabble.com/How-can-I-let-servicemix-running-at-background--tp26473351p26473351.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>