[Mono-osx] mono-service2 issues for Pause and Continue signals

srinin srinivas.nangunoori at ironmountain.com
Tue Mar 22 02:02:03 EDT 2011


Hi All,

I have a simple windows service application that just puts the console
output when ever service receives stop, start or pause and continue signals. 

I am able to run the service in Mac using mono-service2. i am able to see
console outputs for start and stop not for the Pause and Continue...
signals. I want to know whether mono-service has any issues in mac????

My code is,


static class Program
    {
        /// 
        /// The main entry point for the application.
        /// 
        static void Main()
        {
            ServiceBase[] ServicesToRun;
            ServicesToRun = new ServiceBase[] 
			{ 
				new Service1() 
			};
            ServiceBase.Run(ServicesToRun);
        }
    }

 public partial class Service1 : ServiceBase
    {
        public Service1()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            Console.WriteLine("Start............");
        }
        
        protected override void OnStop()
        {
            Console.WriteLine("Stop............");
        }

        protected override void OnPause()
        {
            Console.WriteLine("Pause............");
        }

        protected override void OnContinue()
        {
            Console.WriteLine("Continue............");
        }
    }


I am running the service with following commands

mono-service2 --debug 
>> it prints start on console

And for Pause
kill -USR1 `cat /tmp/myservicename.lock`
>>But no console output
And for continue
kill -USR2 `cat /tmp/myservicename.lock`
>>no console output
And for stop
kill `cat /tmp/myservicename.lock`
>>it prints stop on console

And also i observe whenever i stop the service cpu usage is increased to
greater thn > 99%

Kindly help me in solving this issue

Regards
Srini




--
View this message in context: http://mono.1490590.n4.nabble.com/mono-service2-issues-for-Pause-and-Continue-signals-tp3395602p3395602.html
Sent from the Mono - OSX mailing list archive at Nabble.com.


More information about the Mono-osx mailing list