2015-07-19 00:27:41 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.ServiceProcess;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Jackett.Service
|
|
|
|
|
{
|
|
|
|
|
public partial class Service : ServiceBase
|
|
|
|
|
{
|
|
|
|
|
public Service()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnStart(string[] args)
|
|
|
|
|
{
|
2017-11-08 14:45:21 +00:00
|
|
|
|
Engine.BuildContainer(new WebApi2Module());
|
2017-11-08 15:06:13 +00:00
|
|
|
|
Engine.Logger.Info("Service starting");
|
2015-07-22 22:00:52 +00:00
|
|
|
|
Engine.Server.Initalize();
|
2015-07-19 13:22:50 +00:00
|
|
|
|
Engine.Server.Start();
|
|
|
|
|
Engine.Logger.Info("Service started");
|
2015-07-19 00:27:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnStop()
|
|
|
|
|
{
|
2015-07-19 13:22:50 +00:00
|
|
|
|
Engine.Logger.Info("Service stopping");
|
|
|
|
|
Engine.Server.Stop();
|
2015-07-19 00:27:41 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|