When run as a service, InEngine runs scheduled commands in the background and actively listens for commands to be queued.
The server can be run in a variety of ways.
Running the server from the CommandLine is useful for debugging or local development:
inengine.exe -sIt can also be run on Mac and Linux with Mono via a shell wrapper script:
./inengine -sThe server can be run in Global.asax.cs:
using System.Web;
using InEngine.Core;
namespace MyWebApp
{
public class Global : HttpApplication
{
public ServerHost ServerHost { get; set; }
protected void Application_Start()
{
var settings = InEngineSettings.Make();
ServerHost = new ServerHost() {
MailSettings = settings.Mail,
QueueSettings = settings.Queue,
};
}
protected void Application_End()
{
ServerHost.Dispose();
}
}
}Run the Install.ps1 PowerShell script in the InEngine directory to install the InEngine as a service. The script needs to be run as an administrator. The script will register the service at the location where the script is run - i.e. put the files where you want them installed before running the installation script.
ps Install.ps1Simply run the Uninstall.ps1 script with elevated permissions to remove the service.
ps Uninstall.ps1Supervisor is a process control system for Linux. It has extensive documentation, but the following should be enough to get started.
This command installs Supervisor on Ubuntu:
sudo apt-get install supervisorSupervisor configuration files are stored in the /etc/supervisor/conf.d directory. Multiple files can be created in this directory to specify different programs, or multiple instances of the same program, for Supervisor to monitor. Copy this sample config into a file called /etc/supervisor/conf.d/inengine-scheduler.conf.
[program:inengine]
process_name=%(program_name)s_%(process_num)02d
directory=/path/to/inengine
command=mono inengine.exe -s
autostart=true
autorestart=true
user=InEngine
numprocs=1
redirect_stderr=true
stdout_logfile=./inengine.logWhenever a configuration change happens to files in the Supervisor config files, Supervisor needs to be instructed to reload its configuration.
sudo supervisorctl reread
sudo supervisorctl updateNow, simply start the server workers with the supervisorctl program:
sudo supervisorctl start inengine:*Install Docker first, then pull the ethanhann/inengine image:
docker pull ethanhann/inengine:latestNow run InEngine in server mode:
docker run --rm -i ethanhann/inengine:latest -s