File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 3030 <ItemGroup >
3131 <Reference Include =" System.ServiceProcess" />
3232 <Reference Include =" System.Configuration.Install" />
33+ <Reference Include =" Mono.Posix" />
3334 </ItemGroup >
3435 <ItemGroup >
3536 <None Update =" Install.ps1" >
Original file line number Diff line number Diff line change 11using System ;
22using System . IO ;
33using System . ServiceProcess ;
4+ using Mono . Unix ;
5+ using Mono . Unix . Native ;
46
57namespace InEngine
68{
@@ -20,7 +22,19 @@ static void Main(string[] args)
2022 public static void RunScheduler ( )
2123 {
2224 var isRunningUnderMono = Type . GetType ( "Mono.Runtime" ) != null ;
23- if ( ! Environment . UserInteractive && ! isRunningUnderMono )
25+
26+ if ( isRunningUnderMono ) {
27+ var serverHost = new ServerHost ( ) ;
28+ serverHost . Start ( ) ;
29+ Console . WriteLine ( "CTRL+C to exit." ) ;
30+ UnixSignal . WaitAny ( new [ ] {
31+ new UnixSignal ( Signum . SIGINT ) ,
32+ new UnixSignal ( Signum . SIGTERM ) ,
33+ new UnixSignal ( Signum . SIGQUIT ) ,
34+ new UnixSignal ( Signum . SIGHUP )
35+ } ) ;
36+ }
37+ else if ( ! Environment . UserInteractive && ! isRunningUnderMono )
2438 {
2539 // Set current working directory as services use the system directory by default.
2640 Directory . SetCurrentDirectory ( AppDomain . CurrentDomain . BaseDirectory ) ;
You can’t perform that action at this time.
0 commit comments