Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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
 

#!/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 25-Jul-12 2:07am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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:
	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.
  Permalink  
Comments
Arun Kumar K S at 25-Jul-12 9:20am
   
is this execute this line echo "Started $APP_NAME"
Richard MacCutchan at 25-Jul-12 10:26am
   
I assume so, what happens when you try it?
Arun Kumar K S at 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)

  Print Answers RSS
0 /\jmot 240
1 Richard Deeming 195
2 Richard MacCutchan 190
3 Zoltán Zörgő 175
4 Peter Leow 160
0 Sergey Alexandrovich Kryukov 9,328
1 OriginalGriff 6,831
2 Peter Leow 4,477
3 Zoltán Zörgő 3,984
4 Richard MacCutchan 2,832


Advertise | Privacy | Mobile
Web04 | 2.8.150129.1 | Last Updated 25 Jul 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100