Github user apiri commented on a diff in the pull request:
https://github.com/apache/nifi/pull/561#discussion_r68160177
--- Diff:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/bin/nifi.sh
---
@@ -142,22 +138,72 @@ init() {
install() {
- SVC_NAME=nifi
- if [ "x$2" != "x" ] ; then
- SVC_NAME=$2
- fi
+ detectOS
- SVC_FILE="/etc/init.d/${SVC_NAME}"
- cp "$0" "${SVC_FILE}"
- sed -i s:NIFI_HOME=.*:NIFI_HOME="${NIFI_HOME}": "${SVC_FILE}"
- sed -i s:PROGNAME=.*:PROGNAME="${SCRIPT_NAME}": "${SVC_FILE}"
- rm -f "/etc/rc2.d/S65${SVC_NAME}"
- ln -s "/etc/init.d/${SVC_NAME}" "/etc/rc2.d/S65${SVC_NAME}"
- rm -f "/etc/rc2.d/K65${SVC_NAME}"
- ln -s "/etc/init.d/${SVC_NAME}" "/etc/rc2.d/K65${SVC_NAME}"
- echo "Service ${SVC_NAME} installed"
-}
+ 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
+
+ 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."
--- End diff --
It is not. Will also adjust.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---