Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

I am trying to run one mono application as service. When I start from terminal
using the following method
service MyTestApp start

It strts as servive I can view its log porcess etc and prints
Starting MyTestApp

and wait the app in terminal not showing Started MyTestApp and I can possible to type next command only when I press Ctrl+C. How I can solve this

how to execute the next line after starting mono application in shell script.

my sample script is given below


Bash
#!/bin/sh
#/etc/init.d/MyTestApp


APP_NAME="MyTestApp"

case "$1" in
  start)


        echo "Starting $APP_NAME"
	mono MyTestApp.exe
 	echo "Started $APP_NAME"
       
    ;;
  stop)

       
    ;;
  *)
    echo "Usage: /etc/init.d/$APP_NAME {start|stop}"
    exit 1
    ;;
esac

exit 0 
Posted

1 solution

I don't know about Mono, but in normal Linux/UNIX you would just put the program to run in the background by appending the & to the call thus:
PERL
mono MyTestApp.exe &

However this may well mean that the mono process runs in the background but the other process does not. A few tests should tell you which.
 
Share this answer
 
Comments
Arun Kumar K S 25-Jul-12 9:20am    
is this execute this line echo "Started $APP_NAME"
Richard MacCutchan 25-Jul-12 10:26am    
I assume so, what happens when you try it?
Arun Kumar K S 26-Jul-12 22:39pm    
thanks..................

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900