Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Mono C# Linux
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 20-Jul-12 23:15pm
Edited 21-Jul-12 0:04am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
Arun Kumar K S at 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 at 21-Jul-12 6:13am
   
Services usually do not have any output to the console, they usually generate log files.
Arun Kumar K S at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 398
1 CPallini 333
2 George Jonsson 270
3 OriginalGriff 159
4 Prasad Khandekar 135
0 OriginalGriff 4,613
1 CPallini 3,340
2 Sergey Alexandrovich Kryukov 2,771
3 George Jonsson 2,254
4 Gihan Liyanage 2,020


Advertise | Privacy | Mobile
Web04 | 2.8.140905.1 | Last Updated 21 Jul 2012
Copyright © CodeProject, 1999-2014
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