Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8949


Ignore:
Timestamp:
11/27/12 12:43:09 (12 years ago)
Author:
ascheibe
Message:

#1986 added slave command for shutting down a computer

Location:
branches/SlaveShutdown
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/SlaveShutdown/HeuristicLab.Clients.Hive.Slave.ConsoleClient/3.3/app.config

    r7777 r8949  
    126126        <value>2</value>
    127127      </setting>
     128      <setting name="ShutdownCommand" serializeAs="String">
     129        <value>shutdown.exe</value>
     130      </setting>
    128131   </HeuristicLab.Clients.Hive.SlaveCore.Properties.Settings>
    129132  </userSettings>
  • branches/SlaveShutdown/HeuristicLab.Clients.Hive.Slave.Views/3.3/HeuristicLab.Clients.Hive.Slave.Views-3.3.csproj

    r8600 r8949  
    291291  </PropertyGroup>
    292292  <PropertyGroup>
    293    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
     293    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
    294294set ProjectDir=$(ProjectDir)
    295295set SolutionDir=$(SolutionDir)
     
    297297
    298298call PreBuildEvent.cmd</PreBuildEvent>
    299 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
     299    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
    300300export ProjectDir=$(ProjectDir)
    301301export SolutionDir=$(SolutionDir)
  • branches/SlaveShutdown/HeuristicLab.Clients.Hive.Slave.WindowsService/3.3/app.config

    r7777 r8949  
    119119        <value>-1</value>
    120120      </setting>
     121      <setting name="ShutdownCommand" serializeAs="String">
     122        <value>shutdown.exe</value>
     123      </setting>
    121124    </HeuristicLab.Clients.Hive.SlaveCore.Properties.Settings>
    122125  </userSettings>
  • branches/SlaveShutdown/HeuristicLab.Clients.Hive.Slave/3.3/Core.cs

    r7259 r8949  
    2626using System.Threading.Tasks;
    2727using HeuristicLab.Clients.Hive.SlaveCore.Properties;
    28 using HeuristicLab.Clients.Hive.SlaveCore.ServiceContracts;
    2928using HeuristicLab.Common;
    3029using HeuristicLab.Core;
     
    7675        slaveComm = new ServiceHost(typeof(SlaveCommunicationService));
    7776        slaveComm.Open();
    78        
     77
    7978        // delete all left over task directories
    8079        pluginManager.CleanPluginTemp();
     
    9695        }
    9796        ShutdownCore();
    98       } finally {
     97      }
     98      finally {
    9999        DeregisterServiceEvents();
    100100        waitShutdownSem.Release();
     
    185185            HeartbeatManager.Interval = TimeSpan.FromSeconds(interval);
    186186          }
     187          break;
     188        case MessageContainer.MessageType.ShutdownComputer:
     189          ShutdownComputer();
    187190          break;
    188191      }
     
    450453    }
    451454
     455    private void ShutdownComputer() {
     456      Shutdown();
     457
     458      try {
     459        Process.Start(Settings.Default.ShutdownCommand);
     460      }
     461      catch (Exception ex) {
     462        if (ServiceEventLog != null) {
     463          EventLogManager.LogException(ex);
     464        } else
     465          throw ex;
     466      }
     467    }
     468
    452469    /// <summary>
    453470    /// complete shutdown, should be called before the the application is exited
  • branches/SlaveShutdown/HeuristicLab.Clients.Hive.Slave/3.3/Properties/Settings.Designer.cs

    r7777 r8949  
    22// <auto-generated>
    33//     This code was generated by a tool.
    4 //     Runtime Version:4.0.30319.530
     4//     Runtime Version:4.0.30319.586
    55//
    66//     Changes to this file may cause incorrect behavior and will be lost if
     
    311311            }
    312312        }
     313       
     314        [global::System.Configuration.UserScopedSettingAttribute()]
     315        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     316        [global::System.Configuration.DefaultSettingValueAttribute("shutdown.exe")]
     317        public string ShutdownCommand {
     318            get {
     319                return ((string)(this["ShutdownCommand"]));
     320            }
     321            set {
     322                this["ShutdownCommand"] = value;
     323            }
     324        }
    313325    }
    314326}
  • branches/SlaveShutdown/HeuristicLab.Clients.Hive.Slave/3.3/Properties/Settings.settings

    r7777 r8949  
    7575      <Value Profile="(Default)">-1</Value>
    7676    </Setting>
     77    <Setting Name="ShutdownCommand" Type="System.String" Scope="User">
     78      <Value Profile="(Default)">shutdown.exe</Value>
     79    </Setting>
    7780  </Settings>
    7881</SettingsFile>
  • branches/SlaveShutdown/HeuristicLab.Clients.Hive.Slave/3.3/app.config

    r7777 r8949  
    122122        <value>-1</value>
    123123      </setting>
     124      <setting name="ShutdownCommand" serializeAs="String">
     125        <value>shutdown.exe</value>
     126      </setting>
    124127    </HeuristicLab.Clients.Hive.SlaveCore.Properties.Settings>
    125128  </userSettings>
  • branches/SlaveShutdown/HeuristicLab.Clients.Hive/3.3/ServiceClients/HiveServiceClient.cs

    r8071 r8949  
    22// <auto-generated>
    33//     This code was generated by a tool.
    4 //     Runtime Version:4.0.30319.17379
     4//     Runtime Version:4.0.30319.586
    55//
    66//     Changes to this file may cause incorrect behavior and will be lost if
     
    629629
    630630    [System.Runtime.Serialization.OptionalFieldAttribute()]
     631    private HeuristicLab.Clients.Hive.DowntimeType DowntimeTypeField;
     632
     633    [System.Runtime.Serialization.OptionalFieldAttribute()]
    631634    private System.DateTime EndDateField;
    632635
     
    652655          this.AllDayEventField = value;
    653656          this.RaisePropertyChanged("AllDayEvent");
     657        }
     658      }
     659    }
     660
     661    [System.Runtime.Serialization.DataMemberAttribute()]
     662    public HeuristicLab.Clients.Hive.DowntimeType DowntimeType {
     663      get {
     664        return this.DowntimeTypeField;
     665      }
     666      set {
     667        if ((this.DowntimeTypeField.Equals(value) != true)) {
     668          this.DowntimeTypeField = value;
     669          this.RaisePropertyChanged("DowntimeType");
    654670        }
    655671      }
     
    12861302
    12871303  [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
     1304  [System.Runtime.Serialization.DataContractAttribute(Name = "DowntimeType", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataAccess")]
     1305  public enum DowntimeType : int {
     1306
     1307    [System.Runtime.Serialization.EnumMemberAttribute()]
     1308    Offline = 0,
     1309
     1310    [System.Runtime.Serialization.EnumMemberAttribute()]
     1311    Shutdown = 1,
     1312  }
     1313
     1314  [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    12881315  [System.Runtime.Serialization.DataContractAttribute(Name = "Permission", Namespace = "http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.DataTransfer")]
    12891316  public enum Permission : int {
     
    16131640      [System.Runtime.Serialization.EnumMemberAttribute()]
    16141641      NewHBInterval = 11,
     1642
     1643      [System.Runtime.Serialization.EnumMemberAttribute()]
     1644      ShutdownComputer = 12,
    16151645    }
    16161646  }
  • branches/SlaveShutdown/HeuristicLab.Clients.Hive/3.3/Settings.Designer.cs

    r7249 r8949  
    22// <auto-generated>
    33//     This code was generated by a tool.
    4 //     Runtime Version:4.0.30319.239
     4//     Runtime Version:4.0.30319.586
    55//
    66//     Changes to this file may cause incorrect behavior and will be lost if
  • branches/SlaveShutdown/HeuristicLab.Clients.Hive/3.3/app.config

    r7249 r8949  
    1 <?xml version="1.0"?>
     1<?xml version="1.0" encoding="utf-8"?>
    22<configuration>
    3   <configSections>
    4     <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
    5       <section name="HeuristicLab.Clients.Hive.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    6     </sectionGroup>
    7   </configSections>
    8   <applicationSettings>
    9     <HeuristicLab.Clients.Hive.Settings>
    10       <setting name="MaxParallelUploads" serializeAs="String">
    11         <value>4</value>
    12       </setting>
    13       <setting name="HLBinaryName" serializeAs="String">
    14         <value>HeuristicLab 3.3.exe</value>
    15       </setting>
    16       <setting name="ResultPollingInterval" serializeAs="String">
    17         <value>00:00:20</value>
    18       </setting>
    19       <setting name="MaxParallelDownloads" serializeAs="String">
    20         <value>2</value>
    21       </setting>
    22       <setting name="MaxRepeatServiceCalls" serializeAs="String">
    23         <value>5</value>
    24       </setting>
    25       <setting name="AnonymousUserName" serializeAs="String">
    26         <value>anonymous</value>
    27       </setting>
    28     </HeuristicLab.Clients.Hive.Settings>
    29   </applicationSettings>
    30   <system.serviceModel>
    31     <behaviors>
    32       <endpointBehaviors>
    33         <behavior name="HiveBehaviorConfiguration">
    34           <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
    35         </behavior>
    36       </endpointBehaviors>
    37     </behaviors>
    38     <bindings>
    39       <wsHttpBinding>
    40         <binding name="wsHttpBinding_Hive"
    41                  closeTimeout="00:01:00"
    42                  openTimeout="00:01:00"
    43                  receiveTimeout="00:20:00"
    44                  sendTimeout="00:20:00"
    45                  bypassProxyOnLocal="false"
    46                  transactionFlow="false"
    47                  hostNameComparisonMode="StrongWildcard"
    48                  maxBufferPoolSize="2147483647"
    49                  maxReceivedMessageSize="2147483647"
    50                  messageEncoding="Text"
    51                  textEncoding="utf-8"
    52                  useDefaultWebProxy="true"
    53                  allowCookies="false">
    54 
    55           <readerQuotas maxDepth="2147483647"
    56                         maxStringContentLength="2147483647"
    57                         maxArrayLength="2147483647"
    58                         maxBytesPerRead="2147483647"
    59                         maxNameTableCharCount="2147483647"/>
    60           <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
    61           <security mode="Message">
    62             <transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
    63             <message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default"/>
    64           </security>
    65         </binding>
    66       </wsHttpBinding>
    67     </bindings>
    68     <client>
    69       <endpoint address="http://services.heuristiclab.com/Hive-3.3/HiveService.svc" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding_Hive" contract="HeuristicLab.Clients.Hive.IHiveService" name="wsHttpBinding_IHiveService" behaviorConfiguration="HiveBehaviorConfiguration">
    70         <identity>
    71           <certificate encodedValue="AwAAAAEAAAAUAAAAwK1+2oAmcy/mI2P2QjyiJRh0y60gAAAAAQAAACoCAAAwggImMIIBj6ADAgECAhAIkseQ2EEhgU720qJA61gqMA0GCSqGSIb3DQEBBAUAMCQxIjAgBgNVBAMTGXNlcnZpY2VzLmhldXJpc3RpY2xhYi5jb20wHhcNMTAwNTExMTExNDAyWhcNMzkxMjMxMjM1OTU5WjAkMSIwIAYDVQQDExlzZXJ2aWNlcy5oZXVyaXN0aWNsYWIuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq26Bwmwc7k+4W30qLQ2j+FInEL5BuH6opDY6CSlrtt3xQS/anrhvpbf3QghLDVINzcHkzbPmm/SguG4F85QLB6xO+tJaOvRo0iEK5g3c307vMIru7FJwk/OhplEQ5J1hbDgL3zOJlrWlgtqRVxCtVdF3XroI9BctOt1NkeKv9ewIDAQABo1kwVzBVBgNVHQEETjBMgBCjbgdYd4j5JgUuJ1Wo/GxroSYwJDEiMCAGA1UEAxMZc2VydmljZXMuaGV1cmlzdGljbGFiLmNvbYIQCJLHkNhBIYFO9tKiQOtYKjANBgkqhkiG9w0BAQQFAAOBgQAb/2xk2uQad68shSPl/uixWgvFI8WkxOTBopOLaLtDxwCeZ3mWVHdV9VnixHtThubnEBXAhYOCQSIXWtQuXFWO+gH3YyjTRJY5kTmXyuvBRTn3/so5SrQ7Rdlm9hf6E5YVX3tCjAy7ybUyaDUkQfmH5vmvgvpMzRfsJ1qhnUpJiQ=="/>
    72         </identity>
    73       </endpoint>
    74     </client>
    75   </system.serviceModel>
    76   <startup>
    77     <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    78   </startup>
     3    <configSections>
     4        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
     5            <section name="HeuristicLab.Clients.Hive.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
     6        </sectionGroup>
     7    </configSections>
     8    <system.serviceModel>
     9        <bindings>
     10            <wsHttpBinding>
     11                <binding name="WSHttpBinding_IHiveService" closeTimeout="00:01:00"
     12                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
     13                    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
     14                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
     15                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
     16                    allowCookies="false">
     17                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
     18                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
     19                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
     20                        enabled="false" />
     21                    <security mode="Message">
     22                        <transport clientCredentialType="Windows" proxyCredentialType="None"
     23                            realm="" />
     24                        <message clientCredentialType="UserName" negotiateServiceCredential="true"
     25                            algorithmSuite="Default" />
     26                    </security>
     27                </binding>
     28            </wsHttpBinding>
     29        </bindings>
     30        <client>
     31            <endpoint address="http://localhost/Hive-3.3/HiveService.svc"
     32                binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IHiveService"
     33                contract="HeuristicLab.Clients.Hive.IHiveService" name="WSHttpBinding_IHiveService">
     34                <identity>
     35                    <certificate encodedValue="AwAAAAEAAAAUAAAAQkazTmWcZqFuuREaov8jmDtOu4UgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhAVedIj+0w6jEdhZErAeemyMAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTExMDkwNjA4NDUzOVoXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCiKeSwXFm0qxkuMFao9NHftClUYvX0jpiyKFthUnutfhB2FF3Ie8a8U15M+GBYSZOV5vXlEn3D30HsV/x6L9/UU1fiJndJd5lWI2/4mP2jra0qP0b8xyitHfRhePIfpDkufZqIOvOmT/DoFqMTK3joexzuEmAw5Ugil6fbOxELlwIDAQABo0kwRzBFBgNVHQEEPjA8gBCJmAWIXCTyTFXdjdnseED4oRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghAVedIj+0w6jEdhZErAeemyMAkGBSsOAwIdBQADgYEACW9nLJnu1+OJg93AAKfWqkiETHcXUcULrPjMWJQsy5fkHY1qExKBGeUJHK0REvqQs3KRY3GqikMjlAnDmb/e9P1h+PynsRv7y2zAGCnKW4nryWVncWf1xJL9xvKNuH2aR4+Wdq9oo2m793+RXtA7YTSsr/OiiIdkQcjUGQtkaYo=" />
     36                </identity>
     37            </endpoint>
     38        </client>
     39    </system.serviceModel>
     40    <applicationSettings>
     41        <HeuristicLab.Clients.Hive.Settings>
     42            <setting name="MaxParallelUploads" serializeAs="String">
     43                <value>4</value>
     44            </setting>
     45            <setting name="HLBinaryName" serializeAs="String">
     46                <value>HeuristicLab 3.3.exe</value>
     47            </setting>
     48            <setting name="ResultPollingInterval" serializeAs="String">
     49                <value>00:00:20</value>
     50            </setting>
     51            <setting name="MaxParallelDownloads" serializeAs="String">
     52                <value>2</value>
     53            </setting>
     54            <setting name="MaxRepeatServiceCalls" serializeAs="String">
     55                <value>5</value>
     56            </setting>
     57            <setting name="AnonymousUserName" serializeAs="String">
     58                <value>anonymous</value>
     59            </setting>
     60        </HeuristicLab.Clients.Hive.Settings>
     61    </applicationSettings>
    7962</configuration>
Note: See TracChangeset for help on using the changeset viewer.