Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I created one console application using mono that contains one while(true) loop that continuously log to a text file. And I called from a shell script from init.d. It's working fine and log correctly. But the system take more time to login. How I can solve this


I googled about mono service in Linux I found mono-service2 ServiceName.exe etc. I tried to call this in console and in shell script etc but that not worked to me. Finally I created one console application its working but it slow down the OS login (About 15 minutes)


I found
mono-service2 -l:service.lock --debug Program.exe
and run the above in terminal. the commands are exucuted well but no output

How I can create a better daemon using C#

Thanks in advance to your help....
Posted
Updated 21-Jul-12 0:04am
v2

This seems a hard way to do things when you could just use the syslog[^] and associated functions. It is usually more efficient to use native C/C++ code under Unix/Linux for this type of activity.
 
Share this answer
 
 
Share this answer
 
Comments
Arun Kumar K S 21-Jul-12 6:05am    
I found
mono-service2 -l:service.lock --debug Program.exe
and run the above in terminal. the commands are exucuted well but no output
Mehdi Gholam 21-Jul-12 6:13am    
Services usually do not have any output to the console, they usually generate log files.
Arun Kumar K S 21-Jul-12 7:12am    
Yes I written code in start() method to log into a file

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