2017-11-13 08:38:38 +00:00
|
|
|
|
using Jackett.Common.Models.Config;
|
2015-07-19 00:27:41 +00:00
|
|
|
|
using System.ServiceProcess;
|
2018-03-10 08:05:56 +00:00
|
|
|
|
using Jackett.Common;
|
2015-07-19 00:27:41 +00:00
|
|
|
|
|
|
|
|
|
namespace Jackett.Service
|
|
|
|
|
{
|
|
|
|
|
public partial class Service : ServiceBase
|
|
|
|
|
{
|
|
|
|
|
public Service()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnStart(string[] args)
|
|
|
|
|
{
|
2017-11-13 08:38:38 +00:00
|
|
|
|
Engine.BuildContainer(new RuntimeSettings(), 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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|