Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

XX-10436 - create /etc/init.d/sipxecs script to start/stop/restart an…

…d get status of all services
  • Loading branch information...
commit a8c3b046674fa308fcd22d7eedb3b5bb6cdd5b24 1 parent 0f517c9
@laurentiu laurentiu authored
Showing with 227 additions and 45 deletions.
  1. +1 −1  sipXacccode/bin/sipxacccode.in
  2. +1 −1  sipXbridge/bin/sipxbridge.in
  3. +1 −1  sipXcdr/bin/sipxcdr.in
  4. +1 −1  sipXconfig/bin/sipxconfig.in
  5. +11 −0 sipXconfig/etc/sipxconfig.cf
  6. +1 −1  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/alarm/Alarms.java
  7. +92 −0 sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/commserver/SipxServices.java
  8. +4 −0 sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/commserver/commserver.beans.xml
  9. +1 −1  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/dhcp/DhcpManagerImpl.java
  10. +1 −1  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/dns/DnsManagerImpl.java
  11. +2 −1  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/freeswitch/FreeswitchFeature.java
  12. +1 −1  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/ftp/FtpManagerImpl.java
  13. +3 −2 sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/logwatcher/LogWatcherImpl.java
  14. +1 −1  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/mail/MailManager.java
  15. +1 −1  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/mongo/MongoManagerImpl.java
  16. +2 −2 sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/mwi/MwiImpl.java
  17. +1 −1  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/mysql/MySqlImpl.java
  18. +1 −1  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/phonelog/PhoneLog.java
  19. +2 −1  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/proxy/ProxyManagerImpl.java
  20. +1 −1  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/redis/RedisImpl.java
  21. +2 −1  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/registrar/RegistrarImpl.java
  22. +23 −0 sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/snmp/ProcessDefinition.java
  23. +1 −1  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/snmp/SnmpManagerImpl.java
  24. +3 −1 sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/supervisor/SupervisorImpl.java
  25. +1 −1  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/time/NtpManagerImpl.java
  26. +4 −4 sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/tunnel/TunnelManagerImpl.java
  27. +1 −1  sipXevent/bin/sipxevent.in
  28. +5 −2 sipXfreeSwitch/bin/sipxfreeswitch.in
  29. +1 −1  sipXimbot/bin/sipximbot.in
  30. +1 −1  sipXivr/bin/sipxivr.in
  31. +1 −1  sipXpage/bin/sipxpage.in
  32. +1 −1  sipXprovision/bin/sipxprovision.in
  33. +2 −2 sipXpublisher/bin/sipxpublisher.in
  34. +1 −1  sipXrecording/bin/sipxrecording.in
  35. +1 −1  sipXregistry/bin/sipxregistrar.in
  36. +1 −1  sipXrelay/sipxrelay.in
  37. +1 −1  sipXrest/bin/sipxrest.in
  38. +2 −1  sipXsupervisor/bin/Makefile.am
  39. +41 −0 sipXsupervisor/bin/sipxecs.in
  40. +3 −2 sipXsupervisor/bin/sipxlogwatcher.in
  41. +2 −2 sipXsupervisor/bin/sipxsupervisor.in
View
2  sipXacccode/bin/sipxacccode.in
@@ -102,7 +102,7 @@ case "$1" in
[ -f ${pidfile} ] && restart || :
;;
status)
- status -p ${pidfile} java
+ status -p ${pidfile} sipxacccode
;;
configtest)
configtest
View
2  sipXbridge/bin/sipxbridge.in
@@ -106,7 +106,7 @@ case "$1" in
[ -f ${pidfile} ] && restart || :
;;
status)
- status -p ${pidfile} java
+ status -p ${pidfile} sipxbridge
;;
configtest)
configtest
View
2  sipXcdr/bin/sipxcdr.in
@@ -470,7 +470,7 @@ case "$1" in
[ -f ${pidfile} ] && restart || :
;;
status)
- status -p ${PidFile} java
+ status -p ${PidFile} sipxcdr
;;
configtest)
configCheck
View
2  sipXconfig/bin/sipxconfig.in
@@ -288,7 +288,7 @@ case "$1" in
[ -f ${PidFile} ] && restart || :
;;
status)
- status -p ${PidFile} java
+ status -p ${PidFile} sipxconfig
;;
configtest)
configtest
View
11 sipXconfig/etc/sipxconfig.cf
@@ -22,6 +22,8 @@ bundle agent sipxconfig {
"any" usebundle => "sipxconfig_apache";
sipxlogwatcher::
"any" usebundle => "sipxconfig_logwatcher";
+ any::
+ "any" usebundle => "sipxconfig_services";
}
bundle agent sipxconfig_logwatcher {
@@ -74,3 +76,12 @@ bundle agent sipxconfig_apache {
edit_line => expand_template("$(sipx.SIPX_CONFDIR)/sipxconfig/sipxconfig-apache.conf"),
classes => if_repaired("restart_apache");
}
+
+bundle agent sipxconfig_services {
+ files:
+ "$(sipx.SIPX_CONFDIR)/sipxecs-services.ini"
+ comment => "list of sipxecs services",
+ create => "true",
+ perms => m("644"),
+ copy_from => copy_from_cfdata("$(sipx.location_id)/sipxecs-services.ini");
+}
View
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/alarm/Alarms.java
@@ -69,7 +69,7 @@ public void featureChangePostcommit(FeatureManager manager, FeatureChangeRequest
@Override
public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE);
- return (enabled ? Collections.singleton(ProcessDefinition.sysv("snmptrapd")) : null);
+ return (enabled ? Collections.singleton(ProcessDefinition.sysv("snmptrapd", true)) : null);
}
@Override
View
92 sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/commserver/SipxServices.java
@@ -0,0 +1,92 @@
+/**
+ *
+ *
+ * Copyright (c) 2012 eZuce, Inc. All rights reserved.
+ * Contributed to SIPfoundry under a Contributor Agreement
+ *
+ * This software is free software; you can redistribute it and/or modify it under
+ * the terms of the Affero General Public License (AGPL) as published by the
+ * Free Software Foundation; either version 3 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
+ * details.
+ */
+package org.sipfoundry.sipxconfig.commserver;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.sipfoundry.sipxconfig.cfgmgt.ConfigManager;
+import org.sipfoundry.sipxconfig.feature.FeatureChangeRequest;
+import org.sipfoundry.sipxconfig.feature.FeatureChangeValidator;
+import org.sipfoundry.sipxconfig.feature.FeatureListener;
+import org.sipfoundry.sipxconfig.feature.FeatureManager;
+import org.sipfoundry.sipxconfig.setup.SetupListener;
+import org.sipfoundry.sipxconfig.setup.SetupManager;
+import org.sipfoundry.sipxconfig.snmp.ProcessDefinition;
+import org.sipfoundry.sipxconfig.snmp.SnmpManager;
+import org.springframework.beans.factory.annotation.Required;
+
+public class SipxServices implements SetupListener, FeatureListener {
+ private static final Log LOG = LogFactory.getLog(SipxServices.class);
+ private ConfigManager m_configManager;
+ private SnmpManager m_snmpManager;
+
+ @Override
+ public boolean setup(SetupManager manager) {
+ String id = "sipxecs-services";
+ if (!manager.isTrue(id)) {
+ writerServicesList();
+ manager.setTrue(id);
+ }
+ return true;
+ }
+
+ void writerServicesList() {
+ Location[] all = m_configManager.getLocationManager().getLocations();
+ for (Location location : all) {
+ FileWriter services = null;
+ File dir = m_configManager.getLocationDataDirectory(location);
+ try {
+ services = new FileWriter(new File(dir, "sipxecs-services.ini"));
+ for (ProcessDefinition process : m_snmpManager.getProcessDefinitions(location)) {
+ if (!process.isHideFromGlobalServiceScript()) {
+ String processName = process.getProcess();
+ services.write(processName);
+ services.write("\n");
+ }
+ }
+ } catch (IOException e) {
+ LOG.error("Cannot create/write sipxecs-services.ini file: " + e.getMessage());
+ } finally {
+ IOUtils.closeQuietly(services);
+ }
+ }
+ }
+
+ @Required
+ public void setConfigManager(ConfigManager configManager) {
+ m_configManager = configManager;
+ }
+
+ @Required
+ public void setSnmpManager(SnmpManager snmpManager) {
+ m_snmpManager = snmpManager;
+ }
+
+ @Override
+ public void featureChangePrecommit(FeatureManager manager, FeatureChangeValidator validator) {
+ }
+
+ @Override
+ public void featureChangePostcommit(FeatureManager manager, FeatureChangeRequest request) {
+ writerServicesList();
+ }
+}
View
4 sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/commserver/commserver.beans.xml
@@ -76,4 +76,8 @@
<bean id="locationsConfig" class="org.sipfoundry.sipxconfig.commserver.LocationsConfig">
</bean>
+ <bean id="sipxServices" class="org.sipfoundry.sipxconfig.commserver.SipxServices">
+ <property name="configManager" ref="configManager"/>
+ <property name="snmpManager" ref="snmpManager" />
+ </bean>
</beans>
View
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/dhcp/DhcpManagerImpl.java
@@ -100,7 +100,7 @@ public void saveSettings(DhcpSettings settings) {
@Override
public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE, location);
- return (enabled ? Collections.singleton(ProcessDefinition.sysv("dhcpd")) : null);
+ return (enabled ? Collections.singleton(ProcessDefinition.sysv("dhcpd", true)) : null);
}
public void setSettingsDao(BeanWithSettingsDao<DhcpSettings> settingsDao) {
View
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/dns/DnsManagerImpl.java
@@ -185,7 +185,7 @@ void setProviders(List<DnsProvider> providers) {
@Override
public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE, location);
- return (enabled ? Collections.singleton(ProcessDefinition.sysv("named")) : null);
+ return (enabled ? Collections.singleton(ProcessDefinition.sysv("named", true)) : null);
}
@Override
View
3  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/freeswitch/FreeswitchFeature.java
@@ -58,6 +58,7 @@
public static final AddressType ACC_EVENT_ADDRESS = new AddressType("acc-freeswitch-event");
private static final Collection<AddressType> ADDRESSES = Arrays.asList(SIP_ADDRESS, XMLRPC_ADDRESS,
EVENT_ADDRESS, ACC_EVENT_ADDRESS);
+ private static final String PROCESS = "sipxfreeswitch";
private SettingsWithLocationDao<FreeswitchSettings> m_settingsDao;
private SipxReplicationContext m_sipxReplicationContext;
@@ -135,7 +136,7 @@ public void setSettingsDao(SettingsWithLocationDao<FreeswitchSettings> settingsD
if (!manager.getFeatureManager().isFeatureEnabled(FEATURE, location)) {
return null;
}
- ProcessDefinition def = ProcessDefinition.sipx("freeswitch", "sipxfreeswitch");
+ ProcessDefinition def = ProcessDefinition.sipx(PROCESS, PROCESS);
return Collections.singleton(def);
}
View
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/ftp/FtpManagerImpl.java
@@ -56,7 +56,7 @@
if (!m_featureManager.isFeatureEnabled(FTP_FEATURE, location)) {
return null;
}
- return Collections.singleton(ProcessDefinition.sysv("vsftpd"));
+ return Collections.singleton(ProcessDefinition.sysv("vsftpd", true));
}
@Override
View
5 sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/logwatcher/LogWatcherImpl.java
@@ -35,6 +35,7 @@
import org.sipfoundry.sipxconfig.snmp.SnmpManager;
public class LogWatcherImpl implements LogWatcher, SetupListener, ProcessProvider, FeatureProvider {
+ private static final String PROCESS = "sipxlogwatcher";
private BeanWithSettingsDao<LogWatcherSettings> m_settingsDao;
@Override
@@ -48,8 +49,8 @@ public boolean setup(SetupManager manager) {
@Override
public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
- ProcessDefinition def = ProcessDefinition.sipxByRegex("logwatcher",
- "/usr/bin/perl\\s+-w\\s+/usr/bin/sec.*", "sipxlogwatcher");
+ ProcessDefinition def = ProcessDefinition.sipxByRegex(PROCESS, "/usr/bin/perl\\s+-w\\s+/usr/bin/sec.*",
+ PROCESS);
return Collections.singleton(def);
}
View
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/mail/MailManager.java
@@ -23,7 +23,7 @@
public interface MailManager {
public static final GlobalFeature FEATURE = new GlobalFeature("mail");
- public static final ProcessDefinition SERVICE = ProcessDefinition.sysv("sendmail");
+ public static final ProcessDefinition SERVICE = ProcessDefinition.sysv("sendmail", true);
public static final AddressType SMTP = new AddressType("smtp", 25, Protocol.tcp);
/** avoids checkstyle error */
View
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/mongo/MongoManagerImpl.java
@@ -99,7 +99,7 @@ public void setSettingsDao(BeanWithSettingsDao<MongoSettings> settingsDao) {
public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
Collection<ProcessDefinition> procs = new ArrayList<ProcessDefinition>(2);
if (manager.getFeatureManager().isFeatureEnabled(FEATURE_ID, location) || location.isPrimary()) {
- procs.add(ProcessDefinition.sysvByRegex("mongod", ".*/mongod.*-f.*/mongodb{0,1}.conf"));
+ procs.add(ProcessDefinition.sysvByRegex("mongod", ".*/mongod.*-f.*/mongodb{0,1}.conf", true));
}
if (manager.getFeatureManager().isFeatureEnabled(ARBITER_FEATURE, location)) {
ProcessDefinition def = ProcessDefinition.sipxByRegex("mongod-arbiter",
View
4 sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/mwi/MwiImpl.java
@@ -54,6 +54,7 @@
public class MwiImpl implements AddressProvider, FeatureProvider, Mwi, DnsProvider, ProcessProvider,
FirewallProvider {
private static final Collection<AddressType> ADDRESSES = Arrays.asList(SIP_UDP, SIP_TCP, HTTP_API);
+ private static final String PROCESS = "sipxpublisher";
private BeanWithSettingsDao<MwiSettings> m_settingsDao;
private ConfigManager m_configManager;
@@ -136,8 +137,7 @@ public void setConfigManager(ConfigManager configManager) {
@Override
public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE, location);
- ProcessDefinition def = ProcessDefinition.sipx("sipstatus");
- def.setSipxServiceName("sipxpublisher");
+ ProcessDefinition def = ProcessDefinition.sipx(PROCESS, PROCESS);
return (enabled ? Collections.singleton(def) : null);
}
View
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/mysql/MySqlImpl.java
@@ -66,7 +66,7 @@ public void avoidCheckstyleError() {
return null;
}
- ProcessDefinition def = ProcessDefinition.sysv("mysqld");
+ ProcessDefinition def = ProcessDefinition.sysv("mysqld", true);
return Collections.singleton(def);
}
View
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/phonelog/PhoneLog.java
@@ -91,6 +91,6 @@ public void featureChangePostcommit(FeatureManager manager, FeatureChangeRequest
@Override
public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE);
- return (enabled ? Collections.singleton(ProcessDefinition.sysv("rsyslogd")) : null);
+ return (enabled ? Collections.singleton(ProcessDefinition.sysv("rsyslogd", true)) : null);
}
}
View
3  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/proxy/ProxyManagerImpl.java
@@ -57,6 +57,7 @@
private static final Collection<AddressType> ADDRESS_TYPES = Arrays.asList(new AddressType[] {
TCP_ADDRESS, UDP_ADDRESS, TLS_ADDRESS
});
+ private static final String PROCESS = "sipxproxy";
private FeatureManager m_featureManager;
private BeanWithSettingsDao<ProxySettings> m_settingsDao;
private ConfigManager m_configManager;
@@ -121,7 +122,7 @@ public void setSettingsDao(BeanWithSettingsDao<ProxySettings> settingsDao) {
if (!m_featureManager.isFeatureEnabled(FEATURE, location)) {
return null;
}
- ProcessDefinition def = ProcessDefinition.sipx("sipXproxy", "sipxproxy");
+ ProcessDefinition def = ProcessDefinition.sipx(PROCESS, PROCESS);
return Collections.singleton(def);
}
View
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/redis/RedisImpl.java
@@ -70,7 +70,7 @@ public void avoidChecksytleError() {
return null;
}
- ProcessDefinition def = ProcessDefinition.sysv("redis-server");
+ ProcessDefinition def = ProcessDefinition.sysv("redis-server", true);
return Collections.singleton(def);
}
View
3  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/registrar/RegistrarImpl.java
@@ -58,6 +58,7 @@
private static final Collection<AddressType> ADDRESSES = Arrays.asList(new AddressType[] {
TCP_ADDRESS, UDP_ADDRESS, PRESENCE_MONITOR_ADDRESS, EVENT_ADDRESS
});
+ private static final String PROCESS = "sipxregistrar";
private BeanWithSettingsDao<RegistrarSettings> m_settingsDao;
private ListableBeanFactory m_beanFactory;
private ConfigManager m_configManager;
@@ -162,7 +163,7 @@ public void setConfigManager(ConfigManager configManager) {
if (!manager.getFeatureManager().isFeatureEnabled(FEATURE, location)) {
return null;
}
- ProcessDefinition def = ProcessDefinition.sipx("sipregistrar", "sipxregistrar");
+ ProcessDefinition def = ProcessDefinition.sipx(PROCESS, PROCESS);
return Collections.singleton(def);
}
View
23 sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/snmp/ProcessDefinition.java
@@ -23,6 +23,7 @@
private String m_restartCommand;
private String m_regexp;
private String m_restartClass;
+ private boolean m_hideFromGlobalServiceScript;
private ProcessDefinition(String process) {
m_process = process;
@@ -63,6 +64,13 @@ public static ProcessDefinition sysv(String process) {
return pd;
}
+ public static ProcessDefinition sysv(String process, boolean hideFromGlobalServiceScript) {
+ ProcessDefinition pd = new ProcessDefinition(process);
+ pd.setSysVServiceName(process);
+ pd.setHideFromGlobalServiceScript(true);
+ return pd;
+ }
+
public static ProcessDefinition sysv(String process, String service) {
ProcessDefinition pd = new ProcessDefinition(process);
pd.setSysVServiceName(service);
@@ -75,6 +83,13 @@ public static ProcessDefinition sysvByRegex(String process, String regexp) {
return pd;
}
+ public static ProcessDefinition sysvByRegex(String process, String regexp, boolean hideFromGlobalServiceScript) {
+ ProcessDefinition pd = new ProcessDefinition(process, regexp);
+ pd.setSysVServiceName(process);
+ pd.setHideFromGlobalServiceScript(true);
+ return pd;
+ }
+
public static ProcessDefinition sysvByRegex(String process, String regexp, String service) {
ProcessDefinition pd = new ProcessDefinition(process, regexp);
pd.setSysVServiceName(service);
@@ -117,4 +132,12 @@ public String getRestartClass() {
public void setRestartClass(String restartClass) {
m_restartClass = restartClass;
}
+
+ public boolean isHideFromGlobalServiceScript() {
+ return m_hideFromGlobalServiceScript;
+ }
+
+ public void setHideFromGlobalServiceScript(boolean hideFromGlobalServiceScript) {
+ m_hideFromGlobalServiceScript = hideFromGlobalServiceScript;
+ }
}
View
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/snmp/SnmpManagerImpl.java
@@ -138,7 +138,7 @@ public void setFeatureManager(FeatureManager featureManager) {
@Override
public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE);
- return (enabled ? Collections.singleton(ProcessDefinition.sysv("snmpd")) : null);
+ return (enabled ? Collections.singleton(ProcessDefinition.sysv("snmpd", true)) : null);
}
@Override
View
4 sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/supervisor/SupervisorImpl.java
@@ -26,9 +26,11 @@
public class SupervisorImpl implements Supervisor, ProcessProvider {
+ private static final String PROCESS = "sipxsupervisor";
+
@Override
public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
- ProcessDefinition def = ProcessDefinition.sipx("cf-serverd", "sipxsupervisor");
+ ProcessDefinition def = ProcessDefinition.sipx(PROCESS, PROCESS);
return Collections.singleton(def);
}
}
View
2  sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/time/NtpManagerImpl.java
@@ -115,7 +115,7 @@ public String getSystemTimezone() {
@Override
public Collection<ProcessDefinition> getProcessDefinitions(SnmpManager manager, Location location) {
boolean enabled = manager.getFeatureManager().isFeatureEnabled(FEATURE);
- return (enabled ? Collections.singleton(ProcessDefinition.sysv("ntpd")) : null);
+ return (enabled ? Collections.singleton(ProcessDefinition.sysv("ntpd", true)) : null);
}
@Override
View
8 sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/tunnel/TunnelManagerImpl.java
@@ -48,6 +48,8 @@
* don't have authentication mechanisms or are to cumbersome to configure such as the mongo database service.
*/
public class TunnelManagerImpl implements TunnelManager, BeanFactoryAware, FeatureProvider, ProcessProvider {
+ private static final String CLIENT = "tunnel-client";
+ private static final String SERVER = "tunnel-server";
private ListableBeanFactory m_beanFactory;
private volatile Collection<TunnelProvider> m_providers;
private BeanWithSettingsDao<TunnelSettings> m_settingsDao;
@@ -114,11 +116,9 @@ public void setSettingsDao(BeanWithSettingsDao<TunnelSettings> settingsDao) {
if (!manager.getFeatureManager().isFeatureEnabled(FEATURE)) {
return null;
}
- ProcessDefinition c = ProcessDefinition.sipxByRegex("encryption-outbound",
- ".*/stunnel\\s.*/tunnel-client.ini", "tunnel-client");
+ ProcessDefinition c = ProcessDefinition.sipxByRegex(CLIENT, ".*/stunnel\\s.*/tunnel-client.ini", CLIENT);
c.setRestartClass("restart_tunnel_client");
- ProcessDefinition s = ProcessDefinition.sipxByRegex("encryption-inbound",
- ".*/stunnel\\s.*/tunnel-server.ini", "tunnel-server");
+ ProcessDefinition s = ProcessDefinition.sipxByRegex(SERVER, ".*/stunnel\\s.*/tunnel-server.ini", SERVER);
s.setRestartClass("restart_tunnel_server");
return Arrays.asList(c, s);
}
View
2  sipXevent/bin/sipxevent.in
@@ -86,7 +86,7 @@ case "$1" in
[ -f ${pidfile} ] && restart || :
;;
status)
- status -p ${pidfile} java
+ status -p ${pidfile} sipxevent
;;
configtest)
configtest
View
7 sipXfreeSwitch/bin/sipxfreeswitch.in
@@ -28,7 +28,7 @@ DAEMON_START_ARGS="-nc -nonat \
$DAEMON_ARGS"
DAEMON_STOP_ARGS="-stop \
$DAEMON_ARGS"
-PIDFILE=@SIPX_RUNDIR@/freeswitch.pid
+PIDFILE=@SIPX_LOGDIR@/freeswitch.pid
do_setlimits() {
ulimit -c unlimited
@@ -139,8 +139,11 @@ case "$1" in
do_stop
do_start
;;
+ status)
+ status -p ${PIDFILE} sipxfreeswitch
+ ;;
*)
- echo $"Usage: $0 {start|stop}"
+ echo $"Usage: $0 {start|stop|status}"
exit 2
;;
esac
View
2  sipXimbot/bin/sipximbot.in
@@ -102,7 +102,7 @@ case "$1" in
[ -f ${pidfile} ] && restart || :
;;
status)
- status -p ${pidfile} java
+ status -p ${pidfile} sipximbot
;;
configtest)
configtest
View
2  sipXivr/bin/sipxivr.in
@@ -103,7 +103,7 @@ case "$1" in
[ -f ${pidfile} ] && restart || :
;;
status)
- status -p ${pidfile} java
+ status -p ${pidfile} sipxivr
;;
configtest)
configtest
View
2  sipXpage/bin/sipxpage.in
@@ -98,7 +98,7 @@ case "$1" in
[ -f ${pidfile} ] && restart || :
;;
status)
- status -p ${pidfile} java
+ status -p ${pidfile} sipxpage
;;
configtest)
configtest
View
2  sipXprovision/bin/sipxprovision.in
@@ -108,7 +108,7 @@ case "$1" in
[ -f ${pidfile} ] && restart || :
;;
status)
- status -p ${pidfile} java
+ status -p ${pidfile} sipxprovision
;;
configtest)
configtest
View
4 sipXpublisher/bin/sipxpublisher.in
@@ -35,7 +35,7 @@ start() {
runuser - @SIPXPBXUSER@ -c $exec
Status=$?
else
- echo -n $"Starting $prog: "
+ echo -n $"Starting sipxpublisher: "
daemon --user @SIPXPBXUSER@ --pidfile $pidfile $exec $pidfile
Status=$?
echo_success
@@ -88,7 +88,7 @@ case "$1" in
[ -f ${pidfile} ] && restart || :
;;
status)
- status -p ${pidfile} ${exec}
+ status -p ${pidfile} sipxpublisher
Status=$?
;;
configtest)
View
2  sipXrecording/bin/sipxrecording.in
@@ -100,7 +100,7 @@ case "$1" in
[ -f ${pidfile} ] && restart || :
;;
status)
- status -p ${pidfile} java
+ status -p ${pidfile} sipxrecording
;;
configtest)
configtest
View
2  sipXregistry/bin/sipxregistrar.in
@@ -127,7 +127,7 @@ case "$1" in
[ -f ${pidfile} ] && restart || :
;;
status)
- status -p "${pidfile}" "${prog}"
+ status -p "${pidfile}" sipxregistrar
Status=$?
;;
configtest)
View
2  sipXrelay/sipxrelay.in
@@ -115,7 +115,7 @@ case "$1" in
[ -f ${pidfile} ] && restart || :
;;
status)
- status -p ${pidfile} java
+ status -p ${pidfile} sipxrelay
;;
configtest)
configtest
View
2  sipXrest/bin/sipxrest.in
@@ -88,7 +88,7 @@ case "$1" in
[ -f ${pidfile} ] && restart || :
;;
status)
- status -p ${pidfile} java
+ status -p ${pidfile} sipxrest
;;
configtest)
configtest
View
3  sipXsupervisor/bin/Makefile.am
@@ -27,7 +27,8 @@ cfmod_SCRIPTS = \
initddir = @SIPX_SERVICEDIR@
initd_SCRIPTS = \
sipxsupervisor \
- sipxlogwatcher
+ sipxlogwatcher \
+ sipxecs
$(libexec_SCRIPTS) $(cfmod_SCRIPTS) $(initd_SCRIPTS) $(bin_SCRIPTS) : % : %.in Makefile
@$(call SearchAndReplace,$<,$@)
View
41 sipXsupervisor/bin/sipxecs.in
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+# sipxecs - sipXecs services control
+# description: sipxecs is a script used for control and query of the services required by sipXecs
+# processname: sipxecs
+
+# Copyright (C) 2012 eZuce Inc., certain elements licensed under a Contributor Agreement.
+# Contributors retain copyright to elements licensed under a Contributor Agreement.
+# Licensed to the User under the AGPL license.
+
+# Location of the file containing the required SVCs to be modified
+SVCSLIST="@SIPX_CONFDIR@/sipxecs-services.ini"
+
+case "$1" in
+start)
+ for SVC in `cat $SVCSLIST`; do
+ @SIPX_SERVICEDIR@/$SVC start
+done
+;;
+
+status)
+ for SVC in `cat $SVCSLIST`; do
+ @SIPX_SERVICEDIR@/$SVC status
+done
+;;
+
+stop)
+ for SVC in `cat $SVCSLIST`; do
+ @SIPX_SERVICEDIR@/$SVC stop
+done
+;;
+
+restart)
+ $0 stop
+ $0 start
+;;
+
+*)
+ echo "Usage: $0 {status|start|stop|restart}"
+ exit 1
+esac
View
5 sipXsupervisor/bin/sipxlogwatcher.in
@@ -10,6 +10,7 @@
prog="sec"
exec="/usr/bin/sec"
lockfile="/var/lock/subsys/sec"
+PidFile=@SIPX_RUNDIR@/sipxlogwatcher.pid
rc=@SIPX_CONFDIR@/sipxlogwatcher-rc
[ -e $rc ] && . $rc
@@ -29,7 +30,7 @@ start() {
stop() {
echo -n $"Stopping sipxlogwatcher: "
- killproc $prog
+ killproc -p "${PidFile}" $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $lockfile
@@ -54,7 +55,7 @@ force_reload() {
}
rh_status() {
- status $prog
+ status -p ${PidFile} sipxlogwatcher
}
rh_status_q() {
View
4 sipXsupervisor/bin/sipxsupervisor.in
@@ -25,7 +25,7 @@ sipxagentlockfile="@SIPX_RUNDIR@/sipxagent.lock"
start() {
echo -n $config > $configid
- echo -n $"Starting $prog: "
+ echo -n $"Starting sipxsupervisor: "
daemon $exec -f $config
RETVAL=$?
echo
@@ -48,7 +48,7 @@ nofork() {
}
stop() {
- echo -n $"Stopping $prog: "
+ echo -n $"Stopping sipxsupervisor: "
killproc $prog
RETVAL=$?
echo
Please sign in to comment.
Something went wrong with that request. Please try again.