Skip to content
This repository
Browse code

XX-10372 - Allow restarting services from UI again, many valid cases …

…one needs this
  • Loading branch information...
commit eaf5a2b2536466fd9abb941eb8e088798bebfa03 1 parent 7797e48
ezuce-admin authored August 16, 2012

Showing 56 changed files with 244 additions and 127 deletions. Show diff stats Hide diff stats

  1. 18  sipXconfig/etc/ftp.cf
  2. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/acccode/AuthCodesImpl.java
  3. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/acd/AcdContextImpl.java
  4. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/acd/stats/AcdStatsImpl.java
  5. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/admin/AdminContextImpl.java
  6. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/alarm/Alarms.java
  7. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/bridge/BridgeSbcConfiguration.java
  8. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/cdr/CdrManagerImpl.java
  9. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/dhcp/DhcpManagerImpl.java
  10. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/dns/DnsManagerImpl.java
  11. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/event/WebSocketImpl.java
  12. 4  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/freeswitch/FreeswitchFeature.java
  13. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/ftp/FtpManagerImpl.java
  14. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/imbot/ImBotImpl.java
  15. 4  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/ivr/IvrImpl.java
  16. 5  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/logwatcher/LogWatcherImpl.java
  17. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/mail/MailManager.java
  18. 7  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/mongo/MongoManagerImpl.java
  19. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/mwi/MwiImpl.java
  20. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/mysql/MySqlImpl.java
  21. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/nattraversal/NatTraversalImpl.java
  22. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/networkqueue/NetworkQueueManagerImpl.java
  23. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/openacd/OpenAcdContextImpl.java
  24. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/paging/PagingContextImpl.java
  25. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/parkorbit/ParkOrbitContextImpl.java
  26. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/phonelog/PhoneLog.java
  27. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/presence/PresenceServerImpl.java
  28. 3  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/proxy/ProxyManagerImpl.java
  29. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/redis/RedisImpl.java
  30. 3  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/registrar/RegistrarImpl.java
  31. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/restserver/RestServerImpl.java
  32. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/rls/RlsImpl.java
  33. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/saa/SaaManagerImpl.java
  34. 59  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/snmp/ProcessDefinition.java
  35. 5  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/snmp/SnmpManager.java
  36. 45  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/snmp/SnmpManagerImpl.java
  37. 1  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/snmp/snmp.beans.xml
  38. 3  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/supervisor/SupervisorImpl.java
  39. 2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/time/NtpManagerImpl.java
  40. 10  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/tunnel/TunnelManagerImpl.java
  41. 12  sipXconfig/neoconf/test/org/sipfoundry/sipxconfig/snmp/SnmpConfigTest.java
  42. 4  sipXconfig/neoconf/test/org/sipfoundry/sipxconfig/snmp/expected-config
  43. 2  sipXconfig/neoconf/test/org/sipfoundry/sipxconfig/snmp/expected-config-restart
  44. 1  sipXconfig/web/context/WEB-INF/admin/commserver/EditLocationPage.html
  45. 1  sipXconfig/web/context/WEB-INF/admin/commserver/ServicesTable.html
  46. 2  sipXconfig/web/context/WEB-INF/admin/commserver/ServicesTable.properties
  47. 20  sipXconfig/web/src/org/sipfoundry/sipxconfig/site/admin/commserver/ServicesTable.java
  48. 18  sipXdns/etc/sipxdns.cf
  49. 2  sipXhomer
  50. 16  sipXmongo/etc/mongodb.cf
  51. 2  sipXopenfire/config-plugin/src/org/sipfoundry/sipxconfig/openfire/OpenfireImpl.java
  52. 22  sipXopenfire/etc/sipxopenfire.cf
  53. 2  sipXprovision/config-plugin/src/org/sipfoundry/sipxconfig/provision/ProvisionImpl.java
  54. 2  sipXrecording/config-plugin/src/org/sipfoundry/sipxconfig/recording/RecordingImpl.java
  55. 18  sipXsnmp/etc/snmp.cf
  56. 26  sipXsnmp/etc/snmptrap.cf
18  sipXconfig/etc/ftp.cf
@@ -50,7 +50,7 @@ bundle agent ftp_config {
50 50
       perms => m("600"),
51 51
       edit_defaults => empty,
52 52
       edit_line => vsftp_config,
53  
-      classes => if_repaired("restart_ftp");
  53
+      classes => if_repaired("restart_vsftpd");
54 54
 }
55 55
 
56 56
 bundle edit_line vsftp_config {
@@ -82,24 +82,24 @@ bundle agent ftp_sysv_running {
82 82
 
83 83
   methods:
84 84
     any::
85  
-      "any" usebundle => find_service_by_command("$(service_command)", "ftp_running", "root");
  85
+      "any" usebundle => find_service_by_command("$(service_command)", "vsftpd_running", "root");
86 86
     ftp::
87 87
       "any" usebundle => rh_chkconfig_status("vsftpd on");
88 88
     !ftp.!unmanaged_ftp::
89 89
       "any" usebundle => rh_chkconfig_status("vsftpd off");
90 90
 
91 91
   commands:
92  
-    !ftp.!unmanaged_ftp.ftp_running::
  92
+    !ftp.!unmanaged_ftp.vsftpd_running::
93 93
       "$(service)"
94 94
         comment => "stop ftp",
95 95
         args => "stop";
96 96
 
97  
-    ftp.!ftp_running::
  97
+    ftp.!vsftpd_running::
98 98
       "$(service)"
99 99
         comment => "start ftp",
100 100
         args => "start";
101 101
 
102  
-    ftp.ftp_running.!unmanaged_ftp.restart_ftp::
  102
+    ftp.vsftpd_running.!unmanaged_ftp.restart_vsftpd::
103 103
       "$(service)"
104 104
         comment => "restart ftp",
105 105
         args => "restart";
@@ -112,10 +112,10 @@ bundle agent ftp_sysctl_running {
112 112
 
113 113
   classes:
114 114
     fedora16_or_greater::
115  
-      "ftp_running" expression => returnszero("$(sipx.systemctl) is-active $(service)","noshell");
  115
+      "vsftpd_running" expression => returnszero("$(sipx.systemctl) is-active $(service)","noshell");
116 116
 
117 117
   commands:
118  
-    !ftp.ftp_running::
  118
+    !ftp.vsftpd_running::
119 119
       "$(sipx.systemctl)"
120 120
         comment => "stop $(service)",
121 121
         args => "stop $(service)";
@@ -124,7 +124,7 @@ bundle agent ftp_sysctl_running {
124 124
         comment => "disable $(service)",
125 125
         args => "disable $(service)";
126 126
 
127  
-    ftp.!ftp_running::
  127
+    ftp.!vsftpd_running::
128 128
       "$(sipx.systemctl)"
129 129
         comment => "start $(service)",
130 130
         args => "start $(service)";
@@ -133,7 +133,7 @@ bundle agent ftp_sysctl_running {
133 133
         comment => "enable $(service)",
134 134
         args => "enable $(service)";
135 135
 
136  
-    ftp.ftp_running.restart_ftp::
  136
+    ftp.vsftpd_running.restart_vsftpd::
137 137
       "$(sipx.systemctl)"
138 138
         comment => "restart $(service)",
139 139
         args => "restart $(service)";
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/acccode/AuthCodesImpl.java
@@ -145,7 +145,7 @@ public void setSettingsDao(BeanWithSettingsDao<AuthCodeSettings> settingsDao) {
145 145
     @Override
146 146
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
147 147
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE, location);
148  
-        return (enabled ? Collections.singleton(ProcessDefinition.sipxDefault("sipxacccode",
  148
+        return (enabled ? Collections.singleton(ProcessDefinition.sipxByRegex("sipxacccode",
149 149
                 ".*\\s-Dprocname=sipxacccode\\s.*")) : null);
150 150
     }
151 151
 
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/acd/AcdContextImpl.java
@@ -557,6 +557,6 @@ private void onLocationDelete(Location location) {
557 557
     @Override
558 558
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
559 559
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(Acd.FEATURE, location);
560  
-        return (enabled ? Collections.singleton(new ProcessDefinition("sipxacd")) : null);
  560
+        return (enabled ? Collections.singleton(ProcessDefinition.sipx("sipxacd")) : null);
561 561
     }
562 562
 }
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/acd/stats/AcdStatsImpl.java
@@ -91,7 +91,7 @@ public void setSettingsDao(BeanWithSettingsDao settingsDao) {
91 91
     @Override
92 92
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
93 93
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE, location);
94  
-        return (enabled ? Collections.singleton(new ProcessDefinition("sipxacd-stats")) : null);
  94
+        return (enabled ? Collections.singleton(ProcessDefinition.sipx("sipxacd-stats")) : null);
95 95
     }
96 96
 
97 97
     @Override
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/admin/AdminContextImpl.java
@@ -70,7 +70,7 @@ public void setLocationsManager(LocationsManager locationsManager) {
70 70
 
71 71
     @Override
72 72
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
73  
-        return (location.isPrimary() ? Collections.singleton(ProcessDefinition.sipxDefault("sipxconfig",
  73
+        return (location.isPrimary() ? Collections.singleton(ProcessDefinition.sipxByRegex("sipxconfig",
74 74
                 ".*-Dprocname=sipxconfig.*")) : null);
75 75
     }
76 76
 
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/alarm/Alarms.java
@@ -83,7 +83,7 @@ public void featureChangePostcommit(FeatureManager manager, FeatureChangeRequest
83 83
     @Override
84 84
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
85 85
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE);
86  
-        return (enabled ? Collections.singleton(ProcessDefinition.sysvDefault("snmptrapd")) : null);
  86
+        return (enabled ? Collections.singleton(ProcessDefinition.sysv("snmptrapd")) : null);
87 87
     }
88 88
 
89 89
     @Override
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/bridge/BridgeSbcConfiguration.java
@@ -87,7 +87,7 @@ public void setSbcDeviceManager(SbcDeviceManager sbcDeviceManager) {
87 87
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
88 88
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(BridgeSbcContext.FEATURE, location);
89 89
         return (enabled ? Collections
90  
-                .singleton(ProcessDefinition.sipxDefault(SIPXBRIDGE, ".*\\s-Dprocname=sipxbridge\\s.*")) : null);
  90
+                .singleton(ProcessDefinition.sipxByRegex(SIPXBRIDGE, ".*\\s-Dprocname=sipxbridge\\s.*")) : null);
91 91
     }
92 92
 
93 93
     @Override
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/cdr/CdrManagerImpl.java
@@ -567,7 +567,7 @@ public void setFeatureManager(FeatureManager featureManager) {
567 567
     @Override
568 568
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
569 569
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE, location);
570  
-        return (enabled ? Collections.singleton(ProcessDefinition.sipxDefault("sipxcdr",
  570
+        return (enabled ? Collections.singleton(ProcessDefinition.sipxByRegex("sipxcdr",
571 571
                 ".*\\s$(sipx.SIPX_LIBDIR)/ruby/gems/[0-9.]+/gems/sipxcallresolver-[0-9.]+/lib/main.rb\\s.*")) : null);
572 572
     }
573 573
 
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/dhcp/DhcpManagerImpl.java
@@ -100,7 +100,7 @@ public void saveSettings(DhcpSettings settings) {
100 100
     @Override
101 101
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
102 102
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE, location);
103  
-        return (enabled ? Collections.singleton(ProcessDefinition.sysvDefault("dhcpd")) : null);
  103
+        return (enabled ? Collections.singleton(ProcessDefinition.sysv("dhcpd")) : null);
104 104
     }
105 105
 
106 106
     public void setSettingsDao(BeanWithSettingsDao<DhcpSettings> settingsDao) {
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/dns/DnsManagerImpl.java
@@ -185,7 +185,7 @@ void setProviders(List<DnsProvider> providers) {
185 185
     @Override
186 186
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
187 187
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE, location);
188  
-        return (enabled ? Collections.singleton(ProcessDefinition.sysvDefault("named")) : null);
  188
+        return (enabled ? Collections.singleton(ProcessDefinition.sysv("named")) : null);
189 189
     }
190 190
 
191 191
     @Override
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/event/WebSocketImpl.java
@@ -66,7 +66,7 @@ public void getBundleFeatures(FeatureManager featureManager, Bundle b) {
66 66
     @Override
67 67
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
68 68
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE, location);
69  
-        return (enabled ? Collections.singleton(ProcessDefinition.sipxDefault("sipxevent",
  69
+        return (enabled ? Collections.singleton(ProcessDefinition.sipxByRegex("sipxevent",
70 70
                 ".*\\s-Dprocname=sipxevent\\s.*")) : null);
71 71
     }
72 72
 
4  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/freeswitch/FreeswitchFeature.java
@@ -61,7 +61,6 @@
61 61
 
62 62
     private SettingsWithLocationDao<FreeswitchSettings> m_settingsDao;
63 63
     private SipxReplicationContext m_sipxReplicationContext;
64  
-    private String m_name = "freeswitch";
65 64
     private ConfigManager m_configManager;
66 65
 
67 66
     public FreeswitchSettings getSettings(Location location) {
@@ -136,8 +135,7 @@ public void setSettingsDao(SettingsWithLocationDao<FreeswitchSettings> settingsD
136 135
         if (!manager.getFeatureManager().isFeatureEnabled(FEATURE, location)) {
137 136
             return null;
138 137
         }
139  
-        ProcessDefinition def = new ProcessDefinition(m_name);
140  
-        def.setSipxServiceName("sipxfreeswitch");
  138
+        ProcessDefinition def = ProcessDefinition.sipx("freeswitch", "sipxfreeswitch");
141 139
         return Collections.singleton(def);
142 140
     }
143 141
 
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/ftp/FtpManagerImpl.java
@@ -56,7 +56,7 @@
56 56
         if (!m_featureManager.isFeatureEnabled(FTP_FEATURE, location)) {
57 57
             return null;
58 58
         }
59  
-        return Collections.singleton(ProcessDefinition.sysvDefault("vsftpd"));
  59
+        return Collections.singleton(ProcessDefinition.sysv("vsftpd"));
60 60
     }
61 61
 
62 62
     @Override
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/imbot/ImBotImpl.java
@@ -103,7 +103,7 @@ public void setSettingsDao(BeanWithSettingsDao<ImBotSettings> settingsDao) {
103 103
     @Override
104 104
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
105 105
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE, location);
106  
-        return (enabled ? Collections.singleton(ProcessDefinition.sipxDefault("sipximbot",
  106
+        return (enabled ? Collections.singleton(ProcessDefinition.sipxByRegex("sipximbot",
107 107
                 ".*\\s-Dprocname=sipximbot\\s.*")) : null);
108 108
     }
109 109
 
4  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/ivr/IvrImpl.java
@@ -189,8 +189,8 @@ public void setFreeswitchFeature(FreeswitchFeature fsFeature) {
189 189
     @Override
190 190
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
191 191
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE, location);
192  
-        return (enabled ? Collections.singleton(new ProcessDefinition("sipxivr", ".*\\s-Dprocname=sipxivr\\s.*"))
193  
-                : null);
  192
+        return (enabled ? Collections.singleton(ProcessDefinition.sysvByRegex("sipxivr",
  193
+                ".*\\s-Dprocname=sipxivr\\s.*")) : null);
194 194
     }
195 195
 
196 196
     @Override
5  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/logwatcher/LogWatcherImpl.java
@@ -48,9 +48,8 @@ public boolean setup(SetupManager manager) {
48 48
 
49 49
     @Override
50 50
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
51  
-        ProcessDefinition def = new ProcessDefinition("logwatcher",
52  
-            "/usr/bin/perl\\s+-w\\s+/usr/bin/sec.*");
53  
-        def.setSipxServiceName("sipxlogwatcher");
  51
+        ProcessDefinition def = ProcessDefinition.sipxByRegex("logwatcher",
  52
+            "/usr/bin/perl\\s+-w\\s+/usr/bin/sec.*", "sipxlogwatcher");
54 53
         return Collections.singleton(def);
55 54
     }
56 55
 
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/mail/MailManager.java
@@ -23,7 +23,7 @@
23 23
 
24 24
 public interface MailManager {
25 25
     public static final GlobalFeature FEATURE = new GlobalFeature("mail");
26  
-    public static final ProcessDefinition SERVICE = ProcessDefinition.sysvDefault("sendmail");
  26
+    public static final ProcessDefinition SERVICE = ProcessDefinition.sysv("sendmail");
27 27
     public static final AddressType SMTP = new AddressType("smtp", 25, Protocol.tcp);
28 28
 
29 29
     /** avoids checkstyle error */
7  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/mongo/MongoManagerImpl.java
@@ -99,11 +99,12 @@ public void setSettingsDao(BeanWithSettingsDao<MongoSettings> settingsDao) {
99 99
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
100 100
         Collection<ProcessDefinition> procs = new ArrayList<ProcessDefinition>(2);
101 101
         if (manager.getFeatureManager().isFeatureEnabled(FEATURE_ID, location) || location.isPrimary()) {
102  
-            procs.add(ProcessDefinition.sysvDefault("mongod", ".*/mongod.*-f.*/mongod.conf"));
  102
+            procs.add(ProcessDefinition.sysvByRegex("mongod", ".*/mongod.*-f.*/mongod.conf"));
103 103
         }
104 104
         if (manager.getFeatureManager().isFeatureEnabled(ARBITER_FEATURE, location)) {
105  
-            ProcessDefinition def = new ProcessDefinition("mongoArbiter", ".*/mongod.*-f.*/mongod-arbiter.conf");
106  
-            def.setSipxServiceName("mongod-arbiter");
  105
+            ProcessDefinition def = ProcessDefinition.sipxByRegex("mongod-arbiter",
  106
+                    ".*/mongod.*-f.*/mongod-arbiter.conf");
  107
+            def.setRestartClass("restart_mongo_arbiter");
107 108
             procs.add(def);
108 109
         }
109 110
         return procs;
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/mwi/MwiImpl.java
@@ -131,7 +131,7 @@ public void setConfigManager(ConfigManager configManager) {
131 131
     @Override
132 132
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
133 133
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE, location);
134  
-        ProcessDefinition def = ProcessDefinition.sipxDefault("sipstatus");
  134
+        ProcessDefinition def = ProcessDefinition.sipx("sipstatus");
135 135
         def.setSipxServiceName("sipxpublisher");
136 136
         return (enabled ? Collections.singleton(def) : null);
137 137
     }
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/mysql/MySqlImpl.java
@@ -66,7 +66,7 @@ public void avoidCheckstyleError() {
66 66
             return null;
67 67
         }
68 68
 
69  
-        ProcessDefinition def = ProcessDefinition.sysvDefault("mysqld");
  69
+        ProcessDefinition def = ProcessDefinition.sysv("mysqld");
70 70
         return Collections.singleton(def);
71 71
     }
72 72
 
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/nattraversal/NatTraversalImpl.java
@@ -77,7 +77,7 @@ public void setSettingsDao(BeanWithSettingsDao<NatSettings> settingsDao) {
77 77
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
78 78
         boolean relayEnabled = manager.getFeatureManager().isFeatureEnabled(FEATURE);
79 79
         boolean proxyEnabled = manager.getFeatureManager().isFeatureEnabled(ProxyManager.FEATURE, location);
80  
-        return (relayEnabled && proxyEnabled ? Collections.singleton(ProcessDefinition.sipxDefault("sipxrelay",
  80
+        return (relayEnabled && proxyEnabled ? Collections.singleton(ProcessDefinition.sipxByRegex("sipxrelay",
81 81
             ".*\\s-Dprocname=sipxrelay\\s.*")) : null);
82 82
     }
83 83
 
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/networkqueue/NetworkQueueManagerImpl.java
@@ -172,7 +172,7 @@ public void setSettingsDao(BeanWithSettingsDao<NetworkQueueSettings> settingsDao
172 172
             return null;
173 173
         }
174 174
 
175  
-        ProcessDefinition def = ProcessDefinition.sipxDefault(FEATURE.getId());
  175
+        ProcessDefinition def = ProcessDefinition.sipx(FEATURE.getId());
176 176
         return Collections.singleton(def);
177 177
     }
178 178
 }
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/openacd/OpenAcdContextImpl.java
@@ -1205,7 +1205,7 @@ public void setCoreContext(CoreContext coreContext) {
1205 1205
 
1206 1206
             return null;
1207 1207
         }
1208  
-        ProcessDefinition def = ProcessDefinition.sysvDefault(OPEN_ACD_PROCESS_NAME, "/bin/"
  1208
+        ProcessDefinition def = ProcessDefinition.sysvByRegex(OPEN_ACD_PROCESS_NAME, "/bin/"
1209 1209
                 + OPEN_ACD_PROCESS_NAME);
1210 1210
         return Collections.singleton(def);
1211 1211
     }
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/paging/PagingContextImpl.java
@@ -287,7 +287,7 @@ public void setJdbc(JdbcTemplate jdbc) {
287 287
     @Override
288 288
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
289 289
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE, location);
290  
-        return (enabled ? Collections.singleton(ProcessDefinition.sipxDefault("sipxpage",
  290
+        return (enabled ? Collections.singleton(ProcessDefinition.sipxByRegex("sipxpage",
291 291
                 ".*\\s-Dprocname=sipxpage\\s.*")) : null);
292 292
     }
293 293
 
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/parkorbit/ParkOrbitContextImpl.java
@@ -225,7 +225,7 @@ public void setBeanWithSettingsDao(BeanWithSettingsDao<ParkSettings> beanWithSet
225 225
     @Override
226 226
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
227 227
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE, location);
228  
-        return (enabled ? Collections.singleton(ProcessDefinition.sipxDefault("sipxpark")) : null);
  228
+        return (enabled ? Collections.singleton(ProcessDefinition.sipx("sipxpark")) : null);
229 229
     }
230 230
 
231 231
     @Override
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/phonelog/PhoneLog.java
@@ -91,6 +91,6 @@ public void featureChangePostcommit(FeatureManager manager, FeatureChangeRequest
91 91
     @Override
92 92
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
93 93
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE);
94  
-        return (enabled ? Collections.singleton(ProcessDefinition.sysvDefault("rsyslogd")) : null);
  94
+        return (enabled ? Collections.singleton(ProcessDefinition.sysv("rsyslogd")) : null);
95 95
     }
96 96
 }
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/presence/PresenceServerImpl.java
@@ -232,7 +232,7 @@ public void setAddressManager(AddressManager addressManager) {
232 232
     @Override
233 233
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
234 234
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE, location);
235  
-        return (enabled ? Collections.singleton(ProcessDefinition.sipxDefault("sipxpresence")) : null);
  235
+        return (enabled ? Collections.singleton(ProcessDefinition.sipx("sipxpresence")) : null);
236 236
     }
237 237
 
238 238
     @Override
3  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/proxy/ProxyManagerImpl.java
@@ -119,8 +119,7 @@ public void setSettingsDao(BeanWithSettingsDao<ProxySettings> settingsDao) {
119 119
         if (!m_featureManager.isFeatureEnabled(FEATURE, location)) {
120 120
             return null;
121 121
         }
122  
-        ProcessDefinition def = new ProcessDefinition("sipXproxy");
123  
-        def.setSipxServiceName("sipxproxy");
  122
+        ProcessDefinition def = ProcessDefinition.sipx("sipXproxy", "sipxproxy");
124 123
         return Collections.singleton(def);
125 124
     }
126 125
 
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/redis/RedisImpl.java
@@ -70,7 +70,7 @@ public void avoidChecksytleError() {
70 70
             return null;
71 71
         }
72 72
 
73  
-        ProcessDefinition def = ProcessDefinition.sysvDefault("redis-server");
  73
+        ProcessDefinition def = ProcessDefinition.sysv("redis-server");
74 74
         return Collections.singleton(def);
75 75
     }
76 76
 
3  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/registrar/RegistrarImpl.java
@@ -162,8 +162,7 @@ public void setConfigManager(ConfigManager configManager) {
162 162
         if (!manager.getFeatureManager().isFeatureEnabled(FEATURE, location)) {
163 163
             return null;
164 164
         }
165  
-        ProcessDefinition def = new ProcessDefinition("sipregistrar");
166  
-        def.setSipxServiceName("sipxregistrar");
  165
+        ProcessDefinition def = ProcessDefinition.sipx("sipregistrar", "sipxregistrar");
167 166
         return Collections.singleton(def);
168 167
     }
169 168
 
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/restserver/RestServerImpl.java
@@ -100,7 +100,7 @@ public void setSettingsDao(BeanWithSettingsDao<RestServerSettings> settingsDao)
100 100
     @Override
101 101
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
102 102
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE, location);
103  
-        return (enabled ? Collections.singleton(ProcessDefinition.sipxDefault("sipxrest",
  103
+        return (enabled ? Collections.singleton(ProcessDefinition.sipxByRegex("sipxrest",
104 104
                 ".*\\s-Dprocname=sipxrest\\s.*")) : null);
105 105
     }
106 106
 
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/rls/RlsImpl.java
@@ -102,7 +102,7 @@ public void setSettingsDao(BeanWithSettingsDao<RlsSettings> settingsDao) {
102 102
     @Override
103 103
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
104 104
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE, location);
105  
-        return (enabled ? Collections.singleton(ProcessDefinition.sipxDefault("sipxrls")) : null);
  105
+        return (enabled ? Collections.singleton(ProcessDefinition.sipx("sipxrls")) : null);
106 106
     }
107 107
 
108 108
     @Override
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/saa/SaaManagerImpl.java
@@ -63,7 +63,7 @@ public void setSettingsDao(BeanWithSettingsDao<SaaSettings> settingsDao) {
63 63
     @Override
64 64
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
65 65
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE, location);
66  
-        return (enabled ? Collections.singleton(ProcessDefinition.sipxDefault("sipxsaa")) : null);
  66
+        return (enabled ? Collections.singleton(ProcessDefinition.sipx("sipxsaa")) : null);
67 67
     }
68 68
 
69 69
     @Override
59  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/snmp/ProcessDefinition.java
@@ -18,49 +18,69 @@
18 18
 
19 19
 import static java.lang.String.format;
20 20
 
21  
-public class ProcessDefinition {
  21
+public final class ProcessDefinition {
22 22
     private String m_process;
23 23
     private String m_restartCommand;
24 24
     private String m_regexp;
  25
+    private String m_restartClass;
25 26
 
26  
-    public ProcessDefinition(String process) {
  27
+    private ProcessDefinition(String process) {
27 28
         m_process = process;
28 29
     }
29 30
 
30  
-    public ProcessDefinition(String process, String regexp) {
  31
+    private ProcessDefinition(String process, String regexp) {
31 32
         this(process);
32 33
         m_regexp = regexp;
33 34
     }
34 35
 
35  
-    public ProcessDefinition(String process, String regexp, String restartCommand) {
36  
-        this(process, regexp);
37  
-        m_restartCommand = restartCommand;
  36
+    public static ProcessDefinition sipx(String process) {
  37
+        ProcessDefinition pd = new ProcessDefinition(process);
  38
+        pd.setSipxServiceName(process);
  39
+        return pd;
38 40
     }
39 41
 
40  
-    public static ProcessDefinition sipxDefault(String process) {
  42
+    public static ProcessDefinition sipx(String process, String service) {
41 43
         ProcessDefinition pd = new ProcessDefinition(process);
42  
-        pd.setSipxServiceName(process);
  44
+        pd.setSipxServiceName(service);
43 45
         return pd;
44 46
     }
45 47
 
46  
-    public static ProcessDefinition sipxDefault(String process, String regexp) {
  48
+    public static ProcessDefinition sipxByRegex(String process, String regexp) {
47 49
         ProcessDefinition pd = new ProcessDefinition(process, regexp);
48 50
         pd.setSipxServiceName(process);
49 51
         return pd;
50 52
     }
51 53
 
52  
-    public static ProcessDefinition sysvDefault(String process) {
  54
+    public static ProcessDefinition sipxByRegex(String process, String regexp, String service) {
  55
+        ProcessDefinition pd = new ProcessDefinition(process, regexp);
  56
+        pd.setSipxServiceName(service);
  57
+        return pd;
  58
+    }
  59
+
  60
+    public static ProcessDefinition sysv(String process) {
53 61
         ProcessDefinition pd = new ProcessDefinition(process);
54 62
         pd.setSysVServiceName(process);
55 63
         return pd;
56 64
     }
57 65
 
58  
-    public static ProcessDefinition sysvDefault(String process, String regexp) {
  66
+    public static ProcessDefinition sysv(String process, String service) {
  67
+        ProcessDefinition pd = new ProcessDefinition(process);
  68
+        pd.setSysVServiceName(service);
  69
+        return pd;
  70
+    }
  71
+
  72
+    public static ProcessDefinition sysvByRegex(String process, String regexp) {
59 73
         ProcessDefinition pd = new ProcessDefinition(process, regexp);
60 74
         pd.setSysVServiceName(process);
61 75
         return pd;
62 76
     }
63 77
 
  78
+    public static ProcessDefinition sysvByRegex(String process, String regexp, String service) {
  79
+        ProcessDefinition pd = new ProcessDefinition(process, regexp);
  80
+        pd.setSysVServiceName(service);
  81
+        return pd;
  82
+    }
  83
+
64 84
     public String getProcess() {
65 85
         return m_process;
66 86
     }
@@ -70,11 +90,16 @@ public String getRegexp() {
70 90
     }
71 91
 
72 92
     public void setSipxServiceName(String service) {
73  
-        setServiceStartCommand(format("$(sipx.SIPX_SERVICEDIR)/%s start", service));
  93
+        setServiceStartCommand(format("$(sipx.SIPX_SERVICEDIR)/%s start", service), service);
74 94
     }
75 95
 
76 96
     public void setSysVServiceName(String service) {
77  
-        setServiceStartCommand(format("/etc/init.d/%s start", service));
  97
+        setServiceStartCommand(format("/etc/init.d/%s start", service), service);
  98
+    }
  99
+
  100
+    private void setServiceStartCommand(String restartCommand, String service) {
  101
+        setServiceStartCommand(restartCommand);
  102
+        m_restartClass = "restart_" + service;
78 103
     }
79 104
 
80 105
     public void setServiceStartCommand(String restartCommand) {
@@ -84,4 +109,12 @@ public void setServiceStartCommand(String restartCommand) {
84 109
     public String getRestartCommand() {
85 110
         return m_restartCommand;
86 111
     }
  112
+
  113
+    public String getRestartClass() {
  114
+        return m_restartClass;
  115
+    }
  116
+
  117
+    public void setRestartClass(String restartClass) {
  118
+        m_restartClass = restartClass;
  119
+    }
87 120
 }
5  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/snmp/SnmpManager.java
@@ -16,6 +16,7 @@
16 16
  */
17 17
 package org.sipfoundry.sipxconfig.snmp;
18 18
 
  19
+import java.util.Collection;
19 20
 import java.util.List;
20 21
 
21 22
 import org.sipfoundry.sipxconfig.commserver.Location;
@@ -35,4 +36,8 @@
35 36
     public List<ProcessDefinition> getProcessDefinitions(Location location);
36 37
 
37 38
     public List<ServiceStatus> getServicesStatuses(Location location);
  39
+
  40
+    public List<ProcessDefinition> getProcessDefinitions(Location location, Collection<String> processId);
  41
+
  42
+    public void restartProcesses(Location location, Collection<ProcessDefinition> processes);
38 43
 }
45  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/snmp/SnmpManagerImpl.java
@@ -16,14 +16,19 @@
16 16
  */
17 17
 package org.sipfoundry.sipxconfig.snmp;
18 18
 
19  
-
20 19
 import java.io.IOException;
21 20
 import java.util.ArrayList;
22 21
 import java.util.Collection;
23 22
 import java.util.Collections;
  23
+import java.util.HashSet;
  24
+import java.util.Iterator;
24 25
 import java.util.List;
25 26
 import java.util.Map;
  27
+import java.util.Set;
26 28
 
  29
+import org.apache.commons.lang.StringUtils;
  30
+import org.sipfoundry.sipxconfig.cfgmgt.ConfigManager;
  31
+import org.sipfoundry.sipxconfig.cfgmgt.RunRequest;
27 32
 import org.sipfoundry.sipxconfig.common.UserException;
28 33
 import org.sipfoundry.sipxconfig.commserver.Location;
29 34
 import org.sipfoundry.sipxconfig.commserver.ServiceStatus;
@@ -44,6 +49,7 @@
44 49
     private FeatureManager m_featureManager;
45 50
     private Collection<ProcessProvider> m_processProviders;
46 51
     private BeanWithSettingsDao<SnmpSettings> m_settingsDao;
  52
+    private ConfigManager m_configManager;
47 53
 
48 54
     @Override
49 55
     public List<ProcessDefinition> getProcessDefinitions(Location location) {
@@ -102,7 +108,7 @@ public void setFeatureManager(FeatureManager featureManager) {
102 108
     @Override
103 109
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
104 110
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE);
105  
-        return (enabled ? Collections.singleton(ProcessDefinition.sysvDefault("snmpd")) : null);
  111
+        return (enabled ? Collections.singleton(ProcessDefinition.sysv("snmpd")) : null);
106 112
     }
107 113
 
108 114
     @Override
@@ -133,4 +139,39 @@ public void saveSettings(SnmpSettings settings) {
133 139
     public void setSettingsDao(BeanWithSettingsDao<SnmpSettings> settingsDao) {
134 140
         m_settingsDao = settingsDao;
135 141
     }
  142
+
  143
+    @Override
  144
+    public List<ProcessDefinition> getProcessDefinitions(Location location, Collection<String> processIds) {
  145
+        List<ProcessDefinition> defs = getProcessDefinitions(location);
  146
+        List<ProcessDefinition> selected = new ArrayList<ProcessDefinition>(processIds.size());
  147
+        Set<String> ids = new HashSet<String>(processIds);
  148
+        for (ProcessDefinition def : defs) {
  149
+            if (ids.contains(def.getProcess())) {
  150
+                ids.remove(def.getProcess());
  151
+                selected.add(def);
  152
+            }
  153
+        }
  154
+        if (ids.size() > 0) {
  155
+            throw new UserException("Could not find process definitions for " + StringUtils.join(ids, ' '));
  156
+        }
  157
+
  158
+        return selected;
  159
+    }
  160
+
  161
+    @Override
  162
+    public void restartProcesses(Location location, Collection<ProcessDefinition> processes) {
  163
+        RunRequest restart = new RunRequest("restart services", Collections.singleton(location));
  164
+        String[] restarts = new String[processes.size()];
  165
+        Iterator<ProcessDefinition> iProcesses = processes.iterator();
  166
+        for (int i = 0; iProcesses.hasNext(); i++) {
  167
+            restarts[i] = iProcesses.next().getRestartClass();
  168
+        }
  169
+        restart.setDefines(restarts);
  170
+        m_configManager.run(restart);
  171
+
  172
+    }
  173
+
  174
+    public void setConfigManager(ConfigManager configManager) {
  175
+        m_configManager = configManager;
  176
+    }
136 177
 }
1  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/snmp/snmp.beans.xml
@@ -9,6 +9,7 @@
9 9
   
10 10
   <bean id="snmpManagerImpl" class="org.sipfoundry.sipxconfig.snmp.SnmpManagerImpl">
11 11
     <property name="featureManager" ref="featureManager"/>
  12
+    <property name="configManager" ref="configManager"/>
12 13
     <property name="settingsDao">
13 14
       <bean parent="beanWithSettingsDao">
14 15
         <property name="target">
3  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/supervisor/SupervisorImpl.java
@@ -28,8 +28,7 @@
28 28
 
29 29
     @Override
30 30
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
31  
-        ProcessDefinition def = new ProcessDefinition("cf-serverd");
32  
-        def.setSipxServiceName("sipxsupervisor");
  31
+        ProcessDefinition def = ProcessDefinition.sipx("cf-serverd", "sipxsupervisor");
33 32
         return Collections.singleton(def);
34 33
     }
35 34
 }
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/time/NtpManagerImpl.java
@@ -115,7 +115,7 @@ public String getSystemTimezone() {
115 115
     @Override
116 116
     public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
117 117
         boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE);
118  
-        return (enabled ? Collections.singleton(ProcessDefinition.sysvDefault("ntpd")) : null);
  118
+        return (enabled ? Collections.singleton(ProcessDefinition.sysv("ntpd")) : null);
119 119
     }
120 120
 
121 121
     @Override
10  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/tunnel/TunnelManagerImpl.java
@@ -114,10 +114,12 @@ public void setSettingsDao(BeanWithSettingsDao<TunnelSettings> settingsDao) {
114 114
         if (!manager.getFeatureManager().isFeatureEnabled(FEATURE)) {
115 115
             return null;
116 116
         }
117  
-        ProcessDefinition c = new ProcessDefinition("encryption-outbound", ".*/stunnel\\s.*/tunnel-client.ini");
118  
-        c.setSipxServiceName("tunnel-client");
119  
-        ProcessDefinition s = new ProcessDefinition("encryption-inbound", ".*/stunnel\\s.*/tunnel-server.ini");
120  
-        s.setSipxServiceName("tunnel-server");
  117
+        ProcessDefinition c = ProcessDefinition.sipxByRegex("encryption-outbound",
  118
+                ".*/stunnel\\s.*/tunnel-client.ini", "tunnel-client");
  119
+        c.setRestartClass("restart_tunnel_client");
  120
+        ProcessDefinition s = ProcessDefinition.sipxByRegex("encryption-inbound",
  121
+                ".*/stunnel\\s.*/tunnel-server.ini", "tunnel-server");
  122
+        s.setRestartClass("restart_tunnel_server");
121 123
         return Arrays.asList(c, s);
122 124
     }
123 125
 
12  sipXconfig/neoconf/test/org/sipfoundry/sipxconfig/snmp/SnmpConfigTest.java
@@ -23,6 +23,8 @@
23 23
 import java.util.Arrays;
24 24
 import java.util.List;
25 25
 
  26
+import org.apache.commons.io.FileUtils;
  27
+import org.apache.commons.io.IOUtils;
26 28
 import org.junit.Test;
27 29
 
28 30
 public class SnmpConfigTest {
@@ -30,18 +32,20 @@
30 32
     @Test
31 33
     public void config() throws IOException {
32 34
         SnmpConfig config = new SnmpConfig();
33  
-        List<ProcessDefinition> defs = Arrays.asList(new ProcessDefinition("jay"), new ProcessDefinition("robin", ".*whatever.*"));
  35
+        List<ProcessDefinition> defs = Arrays.asList(ProcessDefinition.sipx("jay"), ProcessDefinition.sysvByRegex("robin", ".*whatever.*"));
34 36
         StringWriter actual = new StringWriter();
35 37
         config.writeProcesses(actual, defs);
36  
-        assertEquals("proc jay\nproc robin 0 1 .*whatever.*\n", actual.toString());
  38
+        String expected = IOUtils.toString(getClass().getResourceAsStream("expected-config"));
  39
+        assertEquals(expected, actual.toString());
37 40
     }
38 41
 
39 42
     @Test
40 43
     public void configWithRestart() throws IOException {
41 44
         SnmpConfig config = new SnmpConfig();
42  
-        List<ProcessDefinition> defs = Arrays.asList(new ProcessDefinition("robin", ".*whatever.*", "restart"));
  45
+        List<ProcessDefinition> defs = Arrays.asList(ProcessDefinition.sipxByRegex("robin", ".*whatever.*", "restart"));
43 46
         StringWriter actual = new StringWriter();
44 47
         config.writeProcesses(actual, defs);
45  
-        assertEquals("proc robin 0 1 .*whatever.*\nprocfix robin $(sipx.SIPX_LIBEXECDIR)/snmp-fix-process robin restart\n", actual.toString());
  48
+        String expected = IOUtils.toString(getClass().getResourceAsStream("expected-config-restart"));
  49
+        assertEquals(expected, actual.toString());
46 50
     }
47 51
 }
4  sipXconfig/neoconf/test/org/sipfoundry/sipxconfig/snmp/expected-config
... ...
@@ -0,0 +1,4 @@
  1
+proc jay
  2
+procfix jay $(sipx.SIPX_LIBEXECDIR)/snmp-fix-process jay $(sipx.SIPX_SERVICEDIR)/jay start
  3
+proc robin 0 1 .*whatever.*
  4
+procfix robin $(sipx.SIPX_LIBEXECDIR)/snmp-fix-process robin /etc/init.d/robin start
2  sipXconfig/neoconf/test/org/sipfoundry/sipxconfig/snmp/expected-config-restart
... ...
@@ -0,0 +1,2 @@
  1
+proc robin 0 1 .*whatever.*
  2
+procfix robin $(sipx.SIPX_LIBEXECDIR)/snmp-fix-process robin $(sipx.SIPX_SERVICEDIR)/restart start
1  sipXconfig/web/context/WEB-INF/admin/commserver/EditLocationPage.html
@@ -21,7 +21,6 @@
21 21
   </div>
22 22
   <div jwcid="listServicesTab@Block">
23 23
 	<span jwcid="@common/QuickHelp" value="message:quick.help" />
24  
-	<span jwcid="@common/ErrorMsg"/>
25 24
 	<span jwcid="servicesTable@admin/commserver/ServicesTable"
26 25
 		breadCrumbs="ognl:breadCrumbs" serviceLocation="ognl:locationBean" />
27 26
   </div>
1  sipXconfig/web/context/WEB-INF/admin/commserver/ServicesTable.html
@@ -18,4 +18,5 @@
18 18
     </table>
19 19
 </form>
20 20
 <ul jwcid="actions@Block">
  21
+  <input jwcid="restart@Submit" id="form:restart" listener="listener:restart" value="message:button.restart"/>
21 22
 </ul>
2  sipXconfig/web/context/WEB-INF/admin/commserver/ServicesTable.properties
@@ -12,7 +12,7 @@ role=Role
12 12
 prompt.addNewSipxService=Add New sipX Service
13 13
 
14 14
 statusMessage.version.mismatch=Software version mismatch
15  
-statusMessage.resource.missing=Resource missing
  15
+statusMessage.servicesRestarted=Services restarted
16 16
 
17 17
 xml.rpc.error.state=Cannot retrieve services status from host: {0}
18 18
 xml.rpc.error.status.messages=Cannot retrieve services status messages from host: {0}
20  sipXconfig/web/src/org/sipfoundry/sipxconfig/site/admin/commserver/ServicesTable.java
@@ -9,9 +9,11 @@
9 9
  */
10 10
 package org.sipfoundry.sipxconfig.site.admin.commserver;
11 11
 
  12
+
12 13
 import static org.sipfoundry.sipxconfig.components.LocalizationUtils.getMessage;
13 14
 
14 15
 import java.util.ArrayList;
  16
+import java.util.Collection;
15 17
 import java.util.HashMap;
16 18
 import java.util.List;
17 19
 import java.util.Map;
@@ -27,6 +29,7 @@
27 29
 import org.apache.tapestry.annotations.InjectPage;
28 30
 import org.apache.tapestry.annotations.Parameter;
29 31
 import org.apache.tapestry.services.ExpressionEvaluator;
  32
+import org.sipfoundry.sipxconfig.cfgmgt.ConfigManager;
30 33
 import org.sipfoundry.sipxconfig.common.CoreContext;
31 34
 import org.sipfoundry.sipxconfig.common.UserException;
32 35
 import org.sipfoundry.sipxconfig.commserver.Location;
@@ -34,8 +37,11 @@
34 37
 import org.sipfoundry.sipxconfig.commserver.ServiceStatus;
35 38
 import org.sipfoundry.sipxconfig.components.ObjectSelectionModel;
36 39
 import org.sipfoundry.sipxconfig.components.SelectMap;
  40
+import org.sipfoundry.sipxconfig.components.SipxValidationDelegate;
  41
+import org.sipfoundry.sipxconfig.components.TapestryUtils;
37 42
 import org.sipfoundry.sipxconfig.site.admin.WaitingPage;
38 43
 import org.sipfoundry.sipxconfig.site.common.BreadCrumb;
  44
+import org.sipfoundry.sipxconfig.snmp.ProcessDefinition;
39 45
 import org.sipfoundry.sipxconfig.snmp.SnmpManager;
40 46
 
41 47
 public abstract class ServicesTable extends BaseComponent {
@@ -51,6 +57,9 @@
51 57
     @InjectObject("spring:snmpManager")
52 58
     public abstract SnmpManager getSnmpManager();
53 59
 
  60
+    @InjectObject("spring:configManager")
  61
+    public abstract ConfigManager getConfigManager();
  62
+
54 63
     @InjectObject("spring:coreContext")
55 64
     public abstract CoreContext getCoreContext();
56 65
 
@@ -128,4 +137,15 @@ public String getServiceLabel() {
128 137
     public void refresh() {
129 138
         setServiceStatusCached(null);
130 139
     }
  140
+
  141
+    public void restart() {
  142
+        @SuppressWarnings("unchecked")
  143
+        Collection<String> selected = getSelections().getAllSelected();
  144
+        if (selected.size() > 0) {
  145
+            List<ProcessDefinition> defs = getSnmpManager().getProcessDefinitions(getServiceLocation(), selected);
  146
+            getSnmpManager().restartProcesses(getServiceLocation(), defs);
  147
+            String msg = getMessages().getMessage("statusMessage.servicesRestarted");
  148
+            ((SipxValidationDelegate) TapestryUtils.getValidator(getPage())).recordSuccess(msg);
  149
+        }
  150
+    }
131 151
 }
18  sipXdns/etc/sipxdns.cf
@@ -34,7 +34,7 @@ bundle agent sipxdns {
34 34
       "any" usebundle => sipxdns_setup;
35 35
 
36 36
     !sipxdns_unmanaged::
37  
-      "any" usebundle => sipxdns_running;
  37
+      "any" usebundle => named_running;
38 38
 }
39 39
 
40 40
 bundle agent sipxdns_resolv {
@@ -63,7 +63,7 @@ bundle agent sipxdns_config {
63 63
         perms => mog(600, "named", "root"),
64 64
         edit_line => named_conf,
65 65
         edit_defaults => empty,
66  
-        classes => if_repaired("reload_sipxdns");
  66
+        classes => if_repaired("reload_named");
67 67
         
68 68
     update_zone::
69 69
       "/var/named/$(sipx.domain).zone$(sipxdns.managed_ext)"
@@ -71,7 +71,7 @@ bundle agent sipxdns_config {
71 71
         create => "true",
72 72
         perms => mog(600, "named", "named"),
73 73
         transformer => "$(sipx.SIPX_LIBEXECDIR)/sipx-dns-zone-maker --in $(sipx.SIPX_CFDATA)/$(sipx.location_id)/zone.yaml --out /var/named/$(sipx.domain).zone$(sipxdns.managed_ext)",
74  
-        classes => if_repaired("reload_sipxdns");
  74
+        classes => if_repaired("reload_named");
75 75
 }
76 76
 
77 77
 bundle edit_line named_conf {
@@ -113,7 +113,7 @@ bundle agent sipxdns_setup {
113 113
       "any" usebundle => rh_chkconfig_status("named off");
114 114
 }
115 115
 
116  
-bundle agent sipxdns_running {
  116
+bundle agent named_running {
117 117
   vars:
118 118
     any::
119 119
       "service" string => "/etc/init.d/named";
@@ -121,28 +121,28 @@ bundle agent sipxdns_running {
121 121
 
122 122
   methods:
123 123
     any::
124  
-      "any" usebundle => find_service_by_command("$(service_command)", "sipxdns_running", "named");
  124
+      "any" usebundle => find_service_by_command("$(service_command)", "named_running", "named");
125 125
 
126 126
   commands:
127 127
     # NOTE : Not shutting off  explicit stop function because we cannot tell if
128 128
     # admin is configuring and managing DNS on their own (which is the 
129 129
     # case for a lot of ezuce developers anyway)
130  
-    !sipxdns.!src.sipxdns_running::
  130
+    !sipxdns.!src.named_running::
131 131
       "$(service)"
132 132
         comment => "stop named",
133 133
         args => "stop";
134 134
 
135  
-    sipxdns.!sipxdns_running::
  135
+    sipxdns.!named_running::
136 136
       "$(service)"
137 137
         comment => "start named",
138 138
         args => "start";
139 139
 
140  
-    sipxdns.sipxdns_running.restart_sipxdns::
  140
+    sipxdns.named_running.restart_named::
141 141
       "$(service)"
142 142
         comment => "restart named",
143 143
         args => "restart";
144 144
 
145  
-    sipxdns.sipxdns_running.reload_sipxdns::
  145
+    sipxdns.named_running.reload_named::
146 146
       "$(service)"
147 147
         comment => "reload named",
148 148
         args => "reload";
2  sipXhomer
... ...
@@ -1 +1 @@
1  
-Subproject commit dd54af26b044f66c33798fe4e70b9fbf7aebfb87
  1
+Subproject commit 9721130c1878831e6c7116f3ef21c3a5bb71268b
16  sipXmongo/etc/mongodb.cf
@@ -86,7 +86,7 @@ bundle agent mongodb_arbiter_config {
86 86
         perms => m("644"),
87 87
         edit_defaults => empty,
88 88
         edit_line => mongodb_arbiter_config_contents,
89  
-        classes => if_repaired("restart_mongodb_arbiter");
  89
+        classes => if_repaired("restart_mongo_arbiter");
90 90
 }
91 91
 
92 92
 bundle edit_line mongodb_arbiter_config_contents {
@@ -117,7 +117,7 @@ bundle agent mongodb_config {
117 117
         create => "false",
118 118
         perms => m("644"),
119 119
         edit_line => set_variable_values("mongodb_config.server"),
120  
-        classes => if_repaired("restart_mongodb");
  120
+        classes => if_repaired("restart_mongod");
121 121
 }
122 122
 
123 123
 bundle edit_line mongo_client_config {
@@ -161,20 +161,20 @@ bundle agent mongodb_arbiter_running {
161 161
 
162 162
   methods:
163 163
     any::
164  
-      "any" usebundle => find_service_by_command("$(service_command)", "mongodb_arbiter_running", "$(mongodb.user)");
  164
+      "any" usebundle => find_service_by_command("$(service_command)", "mongo_arbiter_running", "$(mongodb.user)");
165 165
 
166 166
   commands:
167  
-    !mongod_arbiter.mongodb_arbiter_running::
  167
+    !mongod_arbiter.mongo_arbiter_running::
168 168
       "$(service)"
169 169
         comment => "stop mongo arbiter",
170 170
         args => "stop";
171 171
 
172  
-    mongod_arbiter.!mongodb_arbiter_running::
  172
+    mongod_arbiter.!mongo_arbiter_running::
173 173
       "$(service)"
174 174
         comment => "start mongo arbiter",
175 175
         args => "start";
176 176
 
177  
-    mongod_arbiter.mongodb_arbiter_running.restart_mongodb_arbiter::
  177
+    mongod_arbiter.mongo_arbiter_running.restart_mongo_arbiter::
178 178
       "$(service)"
179 179
         comment => "restart mongo arbiter",
180 180
         args => "restart";
@@ -201,7 +201,7 @@ bundle agent mongodb_sysv_running {
201 201
         comment => "start mongo",
202 202
         args => "start";
203 203
 
204  
-    mongod.mongodb_running.restart_mongodb::
  204
+    mongod.mongodb_running.restart_mongod::
205 205
       "$(service)"
206 206
         comment => "restart mongo",
207 207
         args => "restart";
@@ -235,7 +235,7 @@ bundle agent mongodb_systemctl_running {
235 235
         comment => "enable iptables",
236 236
         args => "enable $(service)";
237 237
 
238  
-    mongod.mongodb_running.restart_mongodb::
  238
+    mongod.mongodb_running.restart_mongod::
239 239
       "$(sipx.systemctl)"
240 240