There are few interface that's control service host behavior:
- ServiceControl,
- ServiceShutdown,
- ServiceRecoveryConfigurator
It's better to implement them in service proxy than call to service configurator like this:
x.Service<ServiceProxy>(s =>
{
s.ConstructUsing(name => new ServiceProxy(serviceType));
s.WhenStarted(StartService);
s.WhenStopped(tc => tc.Stop());
s.WhenShutdown(tc => tc.Stop());
});