mirror of https://github.com/apache/nifi.git
NIFI-13677 Removed install command from nifi.sh
Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com> This closes #9194.
This commit is contained in:
parent
81bb78cef7
commit
fa6e55f1de
|
@ -49,10 +49,6 @@ NOTE: Under sustained and extremely high throughput the CodeCache settings may n
|
|||
*** `stop`: stops NiFi that is running in the background
|
||||
*** `status`: provides the current status of NiFi
|
||||
*** `run`: runs NiFi in the foreground and waits for a Ctrl-C to initiate shutdown of NiFi
|
||||
*** `install`: installs NiFi as a service that can then be controlled via
|
||||
**** `service nifi start`
|
||||
**** `service nifi stop`
|
||||
**** `service nifi status`
|
||||
|
||||
* Windows
|
||||
** Decompress into the desired installation directory
|
||||
|
|
|
@ -165,93 +165,6 @@ init() {
|
|||
locateJava "$1"
|
||||
}
|
||||
|
||||
|
||||
install() {
|
||||
detectOS
|
||||
|
||||
if [ "${darwin}" = "true" ] || [ "${cygwin}" = "true" ]; then
|
||||
echo 'Installing Apache NiFi as a service is not supported on OS X or Cygwin.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SVC_NAME=nifi
|
||||
if [ "x$2" != "x" ] ; then
|
||||
SVC_NAME=$2
|
||||
fi
|
||||
|
||||
# since systemd seems to honour /etc/init.d we don't still create native systemd services
|
||||
# yet...
|
||||
initd_dir='/etc/init.d'
|
||||
SVC_FILE="${initd_dir}/${SVC_NAME}"
|
||||
|
||||
if [ ! -w "${initd_dir}" ]; then
|
||||
echo "Current user does not have write permissions to ${initd_dir}. Cannot install NiFi as a service."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create the init script, overwriting anything currently present
|
||||
cat <<SERVICEDESCRIPTOR > ${SVC_FILE}
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You 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.
|
||||
#
|
||||
# chkconfig: 2345 20 80
|
||||
# description: Apache NiFi is a dataflow system based on the principles of Flow-Based Programming.
|
||||
#
|
||||
|
||||
# Make use of the configured NIFI_HOME directory and pass service requests to the nifi.sh executable
|
||||
NIFI_HOME=${NIFI_HOME}
|
||||
bin_dir=\${NIFI_HOME}/bin
|
||||
nifi_executable=\${bin_dir}/nifi.sh
|
||||
|
||||
\${nifi_executable} "\$@"
|
||||
SERVICEDESCRIPTOR
|
||||
|
||||
if [ ! -f "${SVC_FILE}" ]; then
|
||||
echo "Could not create service file ${SVC_FILE}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Provide the user execute access on the file
|
||||
chmod u+x ${SVC_FILE}
|
||||
|
||||
|
||||
# If SLES or OpenSuse...
|
||||
if [ "${ID}" = "opensuse" ] || [ "${ID}" = "sles" ]; then
|
||||
rm -f "/etc/rc.d/rc2.d/S65${SVC_NAME}"
|
||||
ln -s "/etc/init.d/${SVC_NAME}" "/etc/rc.d/rc2.d/S65${SVC_NAME}" || { echo "Could not create link /etc/rc.d/rc2.d/S65${SVC_NAME}"; exit 1; }
|
||||
rm -f "/etc/rc.d/rc2.d/K65${SVC_NAME}"
|
||||
ln -s "/etc/init.d/${SVC_NAME}" "/etc/rc.d/rc2.d/K65${SVC_NAME}" || { echo "Could not create link /etc/rc.d/rc2.d/K65${SVC_NAME}"; exit 1; }
|
||||
echo "Service ${SVC_NAME} installed"
|
||||
# Anything other fallback to the old approach
|
||||
else
|
||||
rm -f "/etc/rc2.d/S65${SVC_NAME}"
|
||||
ln -s "/etc/init.d/${SVC_NAME}" "/etc/rc2.d/S65${SVC_NAME}" || { echo "Could not create link /etc/rc2.d/S65${SVC_NAME}"; exit 1; }
|
||||
rm -f "/etc/rc2.d/K65${SVC_NAME}"
|
||||
ln -s "/etc/init.d/${SVC_NAME}" "/etc/rc2.d/K65${SVC_NAME}" || { echo "Could not create link /etc/rc2.d/K65${SVC_NAME}"; exit 1; }
|
||||
echo "Service ${SVC_NAME} installed"
|
||||
fi
|
||||
|
||||
# systemd: generate nifi.service from init.d
|
||||
if [ -d "/run/systemd/system/" ] || [ ! -z "$(pidof systemd 2>/dev/null)" ]; then
|
||||
systemctl daemon-reload
|
||||
fi
|
||||
}
|
||||
|
||||
is_nonzero_integer() {
|
||||
|
||||
if [ "$1" -gt 0 ] 2>/dev/null; then
|
||||
|
@ -457,6 +370,6 @@ case "$1" in
|
|||
run "start"
|
||||
;;
|
||||
*)
|
||||
echo "Usage nifi {start|stop|decommission|run|restart|status|dump|diagnostics|status-history|install|set-sensitive-properties-algorithm|set-sensitive-properties-key|set-single-user-credentials|cluster-status}"
|
||||
echo "Usage nifi {start|stop|decommission|run|restart|status|dump|diagnostics|status-history|set-sensitive-properties-algorithm|set-sensitive-properties-key|set-single-user-credentials|cluster-status}"
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Reference in New Issue