diff options
author | eronkeo <ronan.keogh@ericsson.com> | 2018-08-12 15:46:43 +0100 |
---|---|---|
committer | eronkeo <ronan.keogh@ericsson.com> | 2018-08-12 15:47:06 +0100 |
commit | 1841cb5d8da7b21996f8faad9d24f858e6ce8a41 (patch) | |
tree | f55479f0dd56ec4fdbe3501ef8814d18341632c3 /datarouter-node/src/main/resources/misc | |
parent | 4261823d84c2b911b68cdf4cb4dc3be429ebe285 (diff) |
datarouter-node clean code - remove tabs
Change-Id: I28240cee3958603788d1e9f8e72bb10706dba712
Issue-ID: DMAAP-582
Signed-off-by: eronkeo <ronan.keogh@ericsson.com>
Diffstat (limited to 'datarouter-node/src/main/resources/misc')
-rw-r--r-- | datarouter-node/src/main/resources/misc/descriptor.xml | 106 | ||||
-rw-r--r-- | datarouter-node/src/main/resources/misc/doaction | 52 | ||||
-rw-r--r-- | datarouter-node/src/main/resources/misc/drtrnode | 166 | ||||
-rw-r--r-- | datarouter-node/src/main/resources/misc/havecert.tmpl | 2 | ||||
-rw-r--r-- | datarouter-node/src/main/resources/misc/notes | 56 |
5 files changed, 191 insertions, 191 deletions
diff --git a/datarouter-node/src/main/resources/misc/descriptor.xml b/datarouter-node/src/main/resources/misc/descriptor.xml index 88fccc19..6ddcad23 100644 --- a/datarouter-node/src/main/resources/misc/descriptor.xml +++ b/datarouter-node/src/main/resources/misc/descriptor.xml @@ -1,53 +1,53 @@ -<?xml version="1.0" encoding="utf-8"?>
-<!--
- ============LICENSE_START==================================================
- * org.onap.dmaap
- * ===========================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===========================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END====================================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- *
--->
-<descriptor version="1" xmlns="http://aft.att.com/swm/descriptor">
- <platforms>
- <platform os="Linux" osVersions="*" architecture="*"/>
- </platforms>
- <paths>
- <path name="/opt/app/datartr" user="datartr" group="datartr" permissions="755,644" recursive="true"/>
- <path name="/opt/app/platform/init.d/drtrnode" user="datartr" group="datartr" permissions="755"/>
- </paths>
- <actions>
- <action type="INIT">
- <proc stage="POST" user="datartr" group="datartr"/>
- </action>
- <action type="FALL">
- <proc stage="PRE" user="datartr" group="datartr"/>
- <proc stage="POST" user="datartr" group="datartr"/>
- </action>
- <action type="INST">
- <proc stage="PRE" user="datartr" group="datartr"/>
- <proc stage="POST" user="datartr" group="datartr"/>
- </action>
- <action type="DINST">
- <proc stage="PRE" user="datartr" group="datartr"/>
- </action>
- </actions>
- <dependencies>
- <dependencyFilter componentName="com.att.java:jdk8lin" versions="[1.8.0.77-02]" sequence="1"/>
- <dependencyFilter componentName="com.att.platform:initd" versions="[1.0.15,)" sequence="2"/>
- <dependencyFilter componentName="com.att.dmaap.datarouter:util" versions="[1.0.7,)" sequence="3"/>
- </dependencies>
-</descriptor>
+<?xml version="1.0" encoding="utf-8"?> +<!-- + ============LICENSE_START================================================== + * org.onap.dmaap + * =========================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =========================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END==================================================== + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + * +--> +<descriptor version="1" xmlns="http://aft.att.com/swm/descriptor"> + <platforms> + <platform os="Linux" osVersions="*" architecture="*"/> + </platforms> + <paths> + <path name="/opt/app/datartr" user="datartr" group="datartr" permissions="755,644" recursive="true"/> + <path name="/opt/app/platform/init.d/drtrnode" user="datartr" group="datartr" permissions="755"/> + </paths> + <actions> + <action type="INIT"> + <proc stage="POST" user="datartr" group="datartr"/> + </action> + <action type="FALL"> + <proc stage="PRE" user="datartr" group="datartr"/> + <proc stage="POST" user="datartr" group="datartr"/> + </action> + <action type="INST"> + <proc stage="PRE" user="datartr" group="datartr"/> + <proc stage="POST" user="datartr" group="datartr"/> + </action> + <action type="DINST"> + <proc stage="PRE" user="datartr" group="datartr"/> + </action> + </actions> + <dependencies> + <dependencyFilter componentName="com.att.java:jdk8lin" versions="[1.8.0.77-02]" sequence="1"/> + <dependencyFilter componentName="com.att.platform:initd" versions="[1.0.15,)" sequence="2"/> + <dependencyFilter componentName="com.att.dmaap.datarouter:util" versions="[1.0.7,)" sequence="3"/> + </dependencies> +</descriptor> diff --git a/datarouter-node/src/main/resources/misc/doaction b/datarouter-node/src/main/resources/misc/doaction index 654afb62..0be002b7 100644 --- a/datarouter-node/src/main/resources/misc/doaction +++ b/datarouter-node/src/main/resources/misc/doaction @@ -24,38 +24,38 @@ for action in "$@" do case "$action" in 'backup') - cp log4j.properties log4j.properties.save 2>/dev/null - cp node.properties node.properties.save 2>/dev/null - cp havecert havecert.save 2>/dev/null - ;; + cp log4j.properties log4j.properties.save 2>/dev/null + cp node.properties node.properties.save 2>/dev/null + cp havecert havecert.save 2>/dev/null + ;; 'stop') - /opt/app/platform/init.d/drtrnode stop - ;; + /opt/app/platform/init.d/drtrnode stop + ;; 'start') - /opt/app/platform/init.d/drtrnode start || exit 1 - ;; + /opt/app/platform/init.d/drtrnode start || exit 1 + ;; 'config') - /bin/bash log4j.properties.tmpl >log4j.properties - /bin/bash node.properties.tmpl >node.properties - /bin/bash havecert.tmpl >havecert - echo "$AFTSWM_ACTION_NEW_VERSION" >VERSION.node - chmod +x havecert - rm -f /opt/app/platform/rc.d/K90drtrnode /opt/app/platform/rc.d/S10drtrnode - ln -s ../init.d/drtrnode /opt/app/platform/rc.d/K90drtrnode - ln -s ../init.d/drtrnode /opt/app/platform/rc.d/S10drtrnode - ;; + /bin/bash log4j.properties.tmpl >log4j.properties + /bin/bash node.properties.tmpl >node.properties + /bin/bash havecert.tmpl >havecert + echo "$AFTSWM_ACTION_NEW_VERSION" >VERSION.node + chmod +x havecert + rm -f /opt/app/platform/rc.d/K90drtrnode /opt/app/platform/rc.d/S10drtrnode + ln -s ../init.d/drtrnode /opt/app/platform/rc.d/K90drtrnode + ln -s ../init.d/drtrnode /opt/app/platform/rc.d/S10drtrnode + ;; 'restore') - cp log4j.properties.save log4j.properties 2>/dev/null - cp node.properties.save node.properties 2>/dev/null - cp havecert.save havecert 2>/dev/null - ;; + cp log4j.properties.save log4j.properties 2>/dev/null + cp node.properties.save node.properties 2>/dev/null + cp havecert.save havecert 2>/dev/null + ;; 'clean') - rm -f log4j.properties node.properties havecert log4j.properties.save node.properties.save havecert.save SHUTDOWN redirections.dat VERSION.node - rm -f /opt/app/platform/rc.d/K90drtrnode /opt/app/platform/rc.d/S10drtrnode - ;; + rm -f log4j.properties node.properties havecert log4j.properties.save node.properties.save havecert.save SHUTDOWN redirections.dat VERSION.node + rm -f /opt/app/platform/rc.d/K90drtrnode /opt/app/platform/rc.d/S10drtrnode + ;; *) - exit 1 - ;; + exit 1 + ;; esac done exit 0 diff --git a/datarouter-node/src/main/resources/misc/drtrnode b/datarouter-node/src/main/resources/misc/drtrnode index 9bce062d..970d7d3f 100644 --- a/datarouter-node/src/main/resources/misc/drtrnode +++ b/datarouter-node/src/main/resources/misc/drtrnode @@ -24,110 +24,110 @@ TZ=GMT0 export TZ PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/java/jdk/jdk180/bin export PATH -CLASSPATH=`echo /opt/app/datartr/etc /opt/app/datartr/lib/*.jar | tr ' ' ':'` +CLASSPATH=`echo /opt/app/datartr/etc /opt/app/datartr/lib/*.jar | tr ' ' ':'` export CLASSPATH pids() { - ps -ef | grep java | grep node.NodeMain | sed -e 's/[^ ]* *//' -e 's/ .*//' + ps -ef | grep java | grep node.NodeMain | sed -e 's/[^ ]* *//' -e 's/ .*//' } start() { - ID=`id -n -u` - GRP=`id -n -g` - if [ "$ID" != "root" ] - then - echo drtrnode must be started as user datartr not $ID - exit 1 - fi - if [ "$GRP" != "datartr" ] - then - echo drtrnode must be started as group datartr not $GRP - exit 1 - fi - cd /opt/app/datartr - if etc/havecert - then - echo >/dev/null - else - echo No certificate file available. Cannot start - exit 0 - fi - PIDS=`pids` - if [ "$PIDS" != "" ] - then - echo drtrnode already running - exit 0 - fi + ID=`id -n -u` + GRP=`id -n -g` + if [ "$ID" != "root" ] + then + echo drtrnode must be started as user datartr not $ID + exit 1 + fi + if [ "$GRP" != "datartr" ] + then + echo drtrnode must be started as group datartr not $GRP + exit 1 + fi + cd /opt/app/datartr + if etc/havecert + then + echo >/dev/null + else + echo No certificate file available. Cannot start + exit 0 + fi + PIDS=`pids` + if [ "$PIDS" != "" ] + then + echo drtrnode already running + exit 0 + fi - mkdir -p /opt/app/datartr/spool/s - chmod 755 /opt/app/datartr/spool/s + mkdir -p /opt/app/datartr/spool/s + chmod 755 /opt/app/datartr/spool/s - rm -f /opt/app/datartr/etc/SHUTDOWN - nohup java org.onap.dmaap.datarouter.node.NodeMain </dev/null >/dev/null 2>&1 & - sleep 5 - PIDS=`pids` - if [ "$PIDS" = "" ] - then - echo drtrnode startup failed - else - echo drtrnode started - fi + rm -f /opt/app/datartr/etc/SHUTDOWN + nohup java org.onap.dmaap.datarouter.node.NodeMain </dev/null >/dev/null 2>&1 & + sleep 5 + PIDS=`pids` + if [ "$PIDS" = "" ] + then + echo drtrnode startup failed + else + echo drtrnode started + fi } stop() { - ID=`id -n -u` - GRP=`id -n -g` - if [ "$ID" != "datartr" ] - then - echo drtrnode must be stopped as user datartr not $ID - exit 1 - fi - if [ "$GRP" != "datartr" ] - then - echo drtrnode must be stopped as group datartr not $GRP - exit 1 - fi - touch /opt/app/datartr/etc/SHUTDOWN - PIDS=`pids` - if [ "$PIDS" != "" ] - then - sleep 5 - kill -9 $PIDS - sleep 5 - echo drtrnode stopped - else - echo drtrnode not running - fi + ID=`id -n -u` + GRP=`id -n -g` + if [ "$ID" != "datartr" ] + then + echo drtrnode must be stopped as user datartr not $ID + exit 1 + fi + if [ "$GRP" != "datartr" ] + then + echo drtrnode must be stopped as group datartr not $GRP + exit 1 + fi + touch /opt/app/datartr/etc/SHUTDOWN + PIDS=`pids` + if [ "$PIDS" != "" ] + then + sleep 5 + kill -9 $PIDS + sleep 5 + echo drtrnode stopped + else + echo drtrnode not running + fi } status() { - PIDS=`pids` - if [ "$PIDS" != "" ] - then - echo drtrnode running - else - echo drtrnode not running - fi + PIDS=`pids` + if [ "$PIDS" != "" ] + then + echo drtrnode running + else + echo drtrnode not running + fi } case "$1" in 'start') - start - ;; + start + ;; 'stop') - stop - ;; + stop + ;; 'restart') - stop - sleep 20 - start - ;; + stop + sleep 20 + start + ;; 'status') - status - ;; + status + ;; *) - echo "Usage: $0 { start | stop | restart }" - exit 1 - ;; + echo "Usage: $0 { start | stop | restart }" + exit 1 + ;; esac exit 0 diff --git a/datarouter-node/src/main/resources/misc/havecert.tmpl b/datarouter-node/src/main/resources/misc/havecert.tmpl index 2e813ba3..5affefd1 100644 --- a/datarouter-node/src/main/resources/misc/havecert.tmpl +++ b/datarouter-node/src/main/resources/misc/havecert.tmpl @@ -4,7 +4,7 @@ TZ=GMT0 cd /opt/app/datartr; if [ -f ${DRTR_NODE_KSTOREFILE:-etc/keystore} ] then - exit 0 + exit 0 fi echo `date '+%F %T,000'` WARN Certificate file "${DRTR_NODE_KSTOREFILE:-etc/keystore}" is missing >>${DRTR_NODE_LOGS:-logs}/node.log exit 1 diff --git a/datarouter-node/src/main/resources/misc/notes b/datarouter-node/src/main/resources/misc/notes index f37a8ea2..e5e9746f 100644 --- a/datarouter-node/src/main/resources/misc/notes +++ b/datarouter-node/src/main/resources/misc/notes @@ -3,52 +3,52 @@ package notes for com.att.dmaap.datarouter:node This component is for the Data Router Node software. The following pre-requisite components should already be present: - com.att.aft.swm:swm-cli - com.att.aft.swm:swm-node - - SWM Variables: AFTSWM_AUTOLINK_PARENTS=/opt/app:/opt/app/workload,/opt/app/aft:/opt/app/workload/aft - com.att.platform:uam-auto - com.att.java:jdk8lin - com.att.platform:initd - com.att.platform:port-fwd - - SWM Variables: PLATFORM_PORT_FWD=80,8080|443,8443 - com.att.dmaap.datarouter:util + com.att.aft.swm:swm-cli + com.att.aft.swm:swm-node + - SWM Variables: AFTSWM_AUTOLINK_PARENTS=/opt/app:/opt/app/workload,/opt/app/aft:/opt/app/workload/aft + com.att.platform:uam-auto + com.att.java:jdk8lin + com.att.platform:initd + com.att.platform:port-fwd + - SWM Variables: PLATFORM_PORT_FWD=80,8080|443,8443 + com.att.dmaap.datarouter:util In a non-production environment, the URL for fetching provisioning data from the provisioning server must be overridden. This can be done by setting a SWM variable prior to installing this component. The production (default) value for this variable is: - DRTR_PROV_INTURL=https://feeds-drtr.web.att.com/internal/prov + DRTR_PROV_INTURL=https://feeds-drtr.web.att.com/internal/prov Similarly, the URL for uploading event logs to the log server must be overridden. This can also be done by setting a SWM variable. The production (default) value is: - DRTR_LOG_URL=https://feeds-drtr.web.att.com/internal/logs + DRTR_LOG_URL=https://feeds-drtr.web.att.com/internal/logs Other SWM variables that can be set are: DRTR_NODE_INTHTTPPORT (default 8080) - The TCP/IP port number the component should listen on for "go fetch" - requests from the provisioning server + The TCP/IP port number the component should listen on for "go fetch" + requests from the provisioning server DRTR_NODE_INTHTTPSPORT (default 8443) - The TCP/IP port number the component should listen on for publish - requests from feed publishers and other nodes + The TCP/IP port number the component should listen on for publish + requests from feed publishers and other nodes DRTR_NODE_EXTHTTPSPORT (default 443) - The TCP/IP port number the component should use for node-to-node - transfers and for sending redirect requests back to publishers + The TCP/IP port number the component should use for node-to-node + transfers and for sending redirect requests back to publishers DRTR_NODE_SPOOL (default /opt/app/datartr/spool) - The directory where data files should be saved while in transit + The directory where data files should be saved while in transit DRTR_NODE_LOGS (default /opt/app/datartr/logs) - The directory where log files should be kept + The directory where log files should be kept DRTR_NODE_LOG_RETENTION (default 30) - How long a log file is kept before being deleted + How long a log file is kept before being deleted DRTR_NODE_KSTOREFILE (default /opt/app/datartr/etc/keystore) - The java keystore file containing the server certificate and private key - for this server + The java keystore file containing the server certificate and private key + for this server DRTR_NODE_KSTOREPASS (default changeit) - The password for the keystore file + The password for the keystore file DRTR_NODE_PVTKEYPASS (default changeit) - The password for the private key in the keystore file + The password for the private key in the keystore file DRTR_NODE_TSTOREFILE (by default, use the truststore from the Java JDK) - The java keystore file containing the trusted certificate authority - certificates + The java keystore file containing the trusted certificate authority + certificates DRTR_NODE_TSTOREPASS (default changeit) - The password for the trust store file. Only applies if a trust store - file is specified. + The password for the trust store file. Only applies if a trust store + file is specified. |