CLOUDSTACK-5473: Fixed the name with which the hyper-v agent gets

installed as a service.
This commit is contained in:
Devdeep Singh 2013-12-12 20:41:32 +05:30
parent bbeb164abf
commit bdbc5f2ae3
2 changed files with 21 additions and 21 deletions

View File

@ -29,7 +29,7 @@ namespace CloudStack.Plugin.AgentShell
static class Program
{
private static ILog logger = LogManager.GetLogger(typeof(Program));
private static string serviceName = "CloudStack ServerResource";
public static string serviceName = "CloudStack Hyper-V Agent";
/// <summary>
/// Application entry point allows service to run in console application or as a Windows service.
@ -39,27 +39,27 @@ namespace CloudStack.Plugin.AgentShell
{
if (args.Length == 0)
{
logger.InfoFormat("CloudStack ServerResource running as Windows Service");
logger.InfoFormat(serviceName + " running as Windows Service");
ServiceBase[] ServicesToRun = new ServiceBase[] { new AgentService() };
ServiceBase.Run(ServicesToRun);
}
else if (args.Length == 1)
{
logger.DebugFormat("CloudStack ServerResource arg is ", args[0]);
logger.DebugFormat(serviceName + " arg is ", args[0]);
switch (args[0])
{
case "--install":
logger.InfoFormat("Installing and running CloudStack ServerResource ");
logger.InfoFormat("Installing and running " + serviceName);
InstallService();
StartService();
break;
case "--uninstall":
logger.InfoFormat("stopping and uninstalling CloudStack ServerResource ");
logger.InfoFormat("Stopping and uninstalling " + serviceName);
StopService();
UninstallService();
break;
case "--console":
logger.InfoFormat("CloudStack ServerResource running as console app");
logger.InfoFormat(serviceName + " is running as console application");
new AgentService().RunConsole(args);
break;
default:

View File

@ -44,33 +44,33 @@ namespace CloudStack.Plugin.AgentShell
/// </summary>
private void InitializeComponent()
{
this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();
this.serviceProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();
this.serviceInstaller = new System.ServiceProcess.ServiceInstaller();
//
// serviceProcessInstaller1
// serviceProcessInstaller
//
this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
this.serviceProcessInstaller1.Password = null;
this.serviceProcessInstaller1.Username = null;
this.serviceProcessInstaller.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
this.serviceProcessInstaller.Password = null;
this.serviceProcessInstaller.Username = null;
//
// serviceInstaller1
// serviceInstaller
//
this.serviceInstaller1.Description = "CloudStack Agent";
this.serviceInstaller1.DisplayName = "CloudStack ServerResource";
this.serviceInstaller1.ServiceName = "CloudStack ServerResource";
this.serviceInstaller1.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
this.serviceInstaller.Description = "CloudStack agent for managing a hyper-v host";
this.serviceInstaller.DisplayName = Program.serviceName;
this.serviceInstaller.ServiceName = Program.serviceName;
this.serviceInstaller.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
//
// ProjectInstaller
//
this.Installers.AddRange(new System.Configuration.Install.Installer[] {
this.serviceProcessInstaller1,
this.serviceInstaller1});
this.serviceProcessInstaller,
this.serviceInstaller});
}
#endregion
private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller1;
private System.ServiceProcess.ServiceInstaller serviceInstaller1;
private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller;
private System.ServiceProcess.ServiceInstaller serviceInstaller;
}
}