<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Error launching NIFI(v1.26) in service mode with  systemctl: Permission denied in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Error-launching-NIFI-v1-26-in-service-mode-with-systemctl/m-p/412719#M253648</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/134637"&gt;@ThierryOfNantes&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Welcome to the Cloudera community.&lt;BR /&gt;&lt;BR /&gt;I suspect your issue is with your run.as user.&amp;nbsp; While the nifi.sh may have executable to all, does your run.as user have necessary permissions to traverse the entire directory tree to the nifi.sh script?&lt;BR /&gt;&lt;BR /&gt;I suggest trying to navigate the directory tree as the run as user and starting nifii.sh manually as that user.&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can you share your /etc/rc.d/init.d/nifi script?&lt;BR /&gt;Can you share your&amp;nbsp;&lt;SPAN&gt;/install_directory/&lt;/SPAN&gt;&lt;FONT color="#000000"&gt;nifi/bin/nifi.sh script?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help our community grow. If you found&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;any&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Accept as Solution&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;" on&amp;nbsp;&lt;STRONG&gt;one or more&lt;/STRONG&gt;&amp;nbsp;of them that helped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;BR /&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Oct 2025 17:22:18 GMT</pubDate>
    <dc:creator>MattWho</dc:creator>
    <dc:date>2025-10-22T17:22:18Z</dc:date>
    <item>
      <title>Error launching NIFI(v1.26) in service mode with  systemctl: Permission denied</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Error-launching-NIFI-v1-26-in-service-mode-with-systemctl/m-p/412718#M253647</link>
      <description>&lt;P&gt;In Cluster mode, on Linux REDHAT 8 , (version NIFI 1.26), we have an error when we are trying to launch NIFI in service mode with command: systemctl start nifi.service.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;user&lt;/STRONG&gt;&amp;nbsp;to execute systemctl : &lt;STRONG&gt;root&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;first script executed by systemctl (start) : /etc/rc.d/init.d/nifi&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this script (line 28) will have to execute command : /install_directory/&lt;FONT color="#339966"&gt;&lt;STRONG&gt;nifi/bin/nifi.sh&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Script &lt;FONT color="#339966"&gt;&lt;STRONG&gt;nifi.sh&lt;/STRONG&gt;&lt;/FONT&gt; can be launched by everyone&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;-rwxrwxr-x&lt;/STRONG&gt;. 1 user usrgroup vy9 17308 Jul 24 10:49 &lt;STRONG&gt;&lt;FONT color="#339966"&gt;nifi.sh&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the &lt;STRONG&gt;journalctl log&lt;/STRONG&gt; we have this trace:&lt;/P&gt;&lt;P&gt;Oct 22 10:53:37 &lt;EM&gt;Serveur_Name&lt;/EM&gt; nifi[110953]: /etc/rc.d/init.d/nifi: line 28: /&lt;EM&gt;install_directory&lt;/EM&gt;/nifi/bin/nifi.sh: &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Permission denied&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;Oct 22 10:53:37 &lt;EM&gt;Serveur_Name&lt;/EM&gt; systemd[1]: nifi.service: Control process exited, code=exited status=126&lt;BR /&gt;Oct 22 10:53:37 &lt;EM&gt;Serveur_Name&lt;/EM&gt; systemd[1]: nifi.service: Failed with result 'exit-code'.&lt;/P&gt;&lt;P&gt;I don't know which is wrong ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2025 14:46:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Error-launching-NIFI-v1-26-in-service-mode-with-systemctl/m-p/412718#M253647</guid>
      <dc:creator>ThierryOfNantes</dc:creator>
      <dc:date>2025-10-22T14:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Error launching NIFI(v1.26) in service mode with  systemctl: Permission denied</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Error-launching-NIFI-v1-26-in-service-mode-with-systemctl/m-p/412719#M253648</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/134637"&gt;@ThierryOfNantes&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Welcome to the Cloudera community.&lt;BR /&gt;&lt;BR /&gt;I suspect your issue is with your run.as user.&amp;nbsp; While the nifi.sh may have executable to all, does your run.as user have necessary permissions to traverse the entire directory tree to the nifi.sh script?&lt;BR /&gt;&lt;BR /&gt;I suggest trying to navigate the directory tree as the run as user and starting nifii.sh manually as that user.&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can you share your /etc/rc.d/init.d/nifi script?&lt;BR /&gt;Can you share your&amp;nbsp;&lt;SPAN&gt;/install_directory/&lt;/SPAN&gt;&lt;FONT color="#000000"&gt;nifi/bin/nifi.sh script?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help our community grow. If you found&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;any&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Accept as Solution&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;" on&amp;nbsp;&lt;STRONG&gt;one or more&lt;/STRONG&gt;&amp;nbsp;of them that helped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;BR /&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2025 17:22:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Error-launching-NIFI-v1-26-in-service-mode-with-systemctl/m-p/412719#M253648</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2025-10-22T17:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Error launching NIFI(v1.26) in service mode with  systemctl: Permission denied</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Error-launching-NIFI-v1-26-in-service-mode-with-systemctl/m-p/412850#M253729</link>
      <description>&lt;P&gt;Hi MaatWho.&lt;BR /&gt;I had already testing loggin using the user specified in the bootstrap file as the run.as user .&lt;BR /&gt;Then i can launch without any problem NIFI in line command : ./nifi.sh start&lt;BR /&gt;It works fine.&lt;BR /&gt;&lt;SPAN&gt;I can navigate without troubles in all directories and subdirectories with this user.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Additionnal information: I'm on Linux REDHAT 8 for the OS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;my nifi script:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;#!/bin/sh&lt;/P&gt;&lt;P&gt;#&lt;BR /&gt;# Licensed to the Apache Software Foundation (ASF) under one or more&lt;BR /&gt;# contributor license agreements. See the NOTICE file distributed with&lt;BR /&gt;# this work for additional information regarding copyright ownership.&lt;BR /&gt;# The ASF licenses this file to You under the Apache License, Version 2.0&lt;BR /&gt;# (the "License"); you may not use this file except in compliance with&lt;BR /&gt;# the License. You may obtain a copy of the License at&lt;BR /&gt;#&lt;BR /&gt;# &lt;A href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank"&gt;http://www.apache.org/licenses/LICENSE-2.0&lt;/A&gt;&lt;BR /&gt;#&lt;BR /&gt;# Unless required by applicable law or agreed to in writing, software&lt;BR /&gt;# distributed under the License is distributed on an "AS IS" BASIS,&lt;BR /&gt;# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;BR /&gt;# See the License for the specific language governing permissions and&lt;BR /&gt;# limitations under the License.&lt;BR /&gt;#&lt;BR /&gt;# chkconfig: 2345 20 80&lt;BR /&gt;# description: Apache NiFi is a dataflow system based on the principles of Flow-Based Programming.&lt;BR /&gt;#&lt;/P&gt;&lt;P&gt;# Make use of the configured NIFI_HOME directory and pass service requests to the nifi.sh executable&lt;BR /&gt;NIFI_HOME=/vy9/vy9adm/u1/01_00_00.000/nifi&lt;BR /&gt;bin_dir=${NIFI_HOME}/bin&lt;BR /&gt;nifi_executable=${bin_dir}/nifi.sh&lt;/P&gt;&lt;P&gt;${nifi_executable} "$@"&lt;/P&gt;&lt;P&gt;(files attached)&lt;/P&gt;&lt;P&gt;It seems the problem is only when I try to launch nifi in service mode with the command : systemctl start nifi&lt;/P&gt;&lt;P&gt;Is there special configuration for service mode with rights to give ? user to specify ?&lt;BR /&gt;the service was intalled with commad:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; nifi.sh install&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 11:31:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Error-launching-NIFI-v1-26-in-service-mode-with-systemctl/m-p/412850#M253729</guid>
      <dc:creator>ThierryOfNantes</dc:creator>
      <dc:date>2025-11-13T11:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Error launching NIFI(v1.26) in service mode with  systemctl: Permission denied</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Error-launching-NIFI-v1-26-in-service-mode-with-systemctl/m-p/412851#M253730</link>
      <description>&lt;P&gt;file nifi.sh&lt;BR /&gt;--------------------&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;#!/bin/sh&lt;BR /&gt;#&lt;BR /&gt;# Licensed to the Apache Software Foundation (ASF) under one or more&lt;BR /&gt;# contributor license agreements. See the NOTICE file distributed with&lt;BR /&gt;# this work for additional information regarding copyright ownership.&lt;BR /&gt;# The ASF licenses this file to You under the Apache License, Version 2.0&lt;BR /&gt;# (the "License"); you may not use this file except in compliance with&lt;BR /&gt;# the License. You may obtain a copy of the License at&lt;BR /&gt;#&lt;BR /&gt;# &lt;A href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank"&gt;http://www.apache.org/licenses/LICENSE-2.0&lt;/A&gt;&lt;BR /&gt;#&lt;BR /&gt;# Unless required by applicable law or agreed to in writing, software&lt;BR /&gt;# distributed under the License is distributed on an "AS IS" BASIS,&lt;BR /&gt;# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;BR /&gt;# See the License for the specific language governing permissions and&lt;BR /&gt;# limitations under the License.&lt;/P&gt;&lt;P&gt;# Script structure inspired from Apache Karaf and other Apache projects with similar startup approaches&lt;/P&gt;&lt;P&gt;# Discover the path of the file&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# Since MacOS X, FreeBSD and some other systems lack gnu readlink, we use a more portable&lt;BR /&gt;# approach based on following StackOverflow comment &lt;A href="http://stackoverflow.com/a/1116890/888876" target="_blank"&gt;http://stackoverflow.com/a/1116890/888876&lt;/A&gt;&lt;/P&gt;&lt;P&gt;TARGET_FILE=$0&lt;/P&gt;&lt;P&gt;cd $(dirname $TARGET_FILE)&lt;BR /&gt;TARGET_FILE=$(basename $TARGET_FILE)&lt;/P&gt;&lt;P&gt;# Iterate down a (possible) chain of symlinks&lt;BR /&gt;while [ -L "$TARGET_FILE" ]&lt;BR /&gt;do&lt;BR /&gt;TARGET_FILE=$(readlink $TARGET_FILE)&lt;BR /&gt;cd $(dirname $TARGET_FILE)&lt;BR /&gt;TARGET_FILE=$(basename $TARGET_FILE)&lt;BR /&gt;done&lt;/P&gt;&lt;P&gt;# Compute the canonicalized name by finding the physical path&lt;BR /&gt;# for the directory we're in and appending the target file.&lt;BR /&gt;PHYS_DIR=$(pwd -P)&lt;/P&gt;&lt;P&gt;SCRIPT_DIR=$PHYS_DIR&lt;BR /&gt;PROGNAME=$(basename "$0")&lt;/P&gt;&lt;P&gt;. "${SCRIPT_DIR}/nifi-env.sh"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;warn() {&lt;BR /&gt;echo "${PROGNAME}: $*"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;die() {&lt;BR /&gt;warn "$*"&lt;BR /&gt;exit 1&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;detectOS() {&lt;BR /&gt;# OS specific support (must be 'true' or 'false').&lt;BR /&gt;cygwin=false;&lt;BR /&gt;aix=false;&lt;BR /&gt;os400=false;&lt;BR /&gt;darwin=false;&lt;BR /&gt;case "$(uname)" in&lt;BR /&gt;CYGWIN*)&lt;BR /&gt;cygwin=true&lt;BR /&gt;;;&lt;BR /&gt;AIX*)&lt;BR /&gt;aix=true&lt;BR /&gt;;;&lt;BR /&gt;OS400*)&lt;BR /&gt;os400=true&lt;BR /&gt;;;&lt;BR /&gt;Darwin)&lt;BR /&gt;darwin=true&lt;BR /&gt;;;&lt;BR /&gt;esac&lt;BR /&gt;# For AIX, set an environment variable&lt;BR /&gt;if ${aix}; then&lt;BR /&gt;export LDR_CNTRL=MAXDATA=0xB0000000@DSA&lt;BR /&gt;echo ${LDR_CNTRL}&lt;BR /&gt;fi&lt;BR /&gt;# In addition to those, go around the linux space and query the widely&lt;BR /&gt;# adopted /etc/os-release to detect linux variants&lt;BR /&gt;if [ -f /etc/os-release ]; then&lt;BR /&gt;. /etc/os-release&lt;BR /&gt;fi&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;unlimitFD() {&lt;BR /&gt;# Use the maximum available, or set MAX_FD != -1 to use that&lt;BR /&gt;if [ "x${MAX_FD}" = "x" ]; then&lt;BR /&gt;MAX_FD="maximum"&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;# Increase the maximum file descriptors if we can&lt;BR /&gt;if [ "${os400}" = "false" ] &amp;amp;&amp;amp; [ "${cygwin}" = "false" ]; then&lt;BR /&gt;MAX_FD_LIMIT=$(ulimit -H -n)&lt;BR /&gt;if [ "${MAX_FD_LIMIT}" != 'unlimited' ]; then&lt;BR /&gt;if [ $? -eq 0 ]; then&lt;BR /&gt;if [ "${MAX_FD}" = "maximum" -o "${MAX_FD}" = "max" ]; then&lt;BR /&gt;# use the system max&lt;BR /&gt;MAX_FD="${MAX_FD_LIMIT}"&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;ulimit -n ${MAX_FD} &amp;gt; /dev/null&lt;BR /&gt;# echo "ulimit -n" `ulimit -n`&lt;BR /&gt;if [ $? -ne 0 ]; then&lt;BR /&gt;warn "Could not set maximum file descriptor limit: ${MAX_FD}"&lt;BR /&gt;fi&lt;BR /&gt;else&lt;BR /&gt;warn "Could not query system maximum file descriptor limit: ${MAX_FD_LIMIT}"&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;locateJava() {&lt;BR /&gt;# Setup the Java Virtual Machine&lt;BR /&gt;if $cygwin ; then&lt;BR /&gt;[ -n "${JAVA}" ] &amp;amp;&amp;amp; JAVA=$(cygpath --unix "${JAVA}")&lt;BR /&gt;[ -n "${JAVA_HOME}" ] &amp;amp;&amp;amp; JAVA_HOME=$(cygpath --unix "${JAVA_HOME}")&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;if [ "x${JAVA}" = "x" ] &amp;amp;&amp;amp; [ -r /etc/gentoo-release ] ; then&lt;BR /&gt;JAVA_HOME=$(java-config --jre-home)&lt;BR /&gt;fi&lt;BR /&gt;if [ "x${JAVA}" = "x" ]; then&lt;BR /&gt;if [ "x${JAVA_HOME}" != "x" ]; then&lt;BR /&gt;if [ ! -d "${JAVA_HOME}" ]; then&lt;BR /&gt;die "JAVA_HOME is not valid: ${JAVA_HOME}"&lt;BR /&gt;fi&lt;BR /&gt;JAVA="${JAVA_HOME}/bin/java"&lt;BR /&gt;else&lt;BR /&gt;warn "JAVA_HOME not set; results may vary"&lt;BR /&gt;JAVA=$(type java)&lt;BR /&gt;JAVA=$(expr "${JAVA}" : '.* \(/.*\)$')&lt;BR /&gt;if [ "x${JAVA}" = "x" ]; then&lt;BR /&gt;die "java command not found"&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;BR /&gt;# if command is env, attempt to add more to the classpath&lt;BR /&gt;if [ "$1" = "env" ]; then&lt;BR /&gt;[ "x${TOOLS_JAR}" = "x" ] &amp;amp;&amp;amp; [ -n "${JAVA_HOME}" ] &amp;amp;&amp;amp; TOOLS_JAR=$(find -H "${JAVA_HOME}" -name "tools.jar")&lt;BR /&gt;[ "x${TOOLS_JAR}" = "x" ] &amp;amp;&amp;amp; [ -n "${JAVA_HOME}" ] &amp;amp;&amp;amp; TOOLS_JAR=$(find -H "${JAVA_HOME}" -name "classes.jar")&lt;BR /&gt;if [ "x${TOOLS_JAR}" = "x" ]; then&lt;BR /&gt;warn "Could not locate tools.jar or classes.jar. Please set manually to avail all command features."&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;init() {&lt;BR /&gt;# Determine if there is special OS handling we must perform&lt;BR /&gt;detectOS&lt;/P&gt;&lt;P&gt;# Unlimit the number of file descriptors if possible&lt;BR /&gt;unlimitFD&lt;/P&gt;&lt;P&gt;# Locate the Java VM to execute&lt;BR /&gt;locateJava "$1"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;install() {&lt;BR /&gt;detectOS&lt;/P&gt;&lt;P&gt;if [ "${darwin}" = "true" ] || [ "${cygwin}" = "true" ]; then&lt;BR /&gt;echo 'Installing Apache NiFi as a service is not supported on OS X or Cygwin.'&lt;BR /&gt;exit 1&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;SVC_NAME=nifi&lt;BR /&gt;if [ "x$2" != "x" ] ; then&lt;BR /&gt;SVC_NAME=$2&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;# since systemd seems to honour /etc/init.d we don't still create native systemd services&lt;BR /&gt;# yet...&lt;BR /&gt;initd_dir='/etc/init.d'&lt;BR /&gt;SVC_FILE="${initd_dir}/${SVC_NAME}"&lt;/P&gt;&lt;P&gt;if [ ! -w "${initd_dir}" ]; then&lt;BR /&gt;echo "Current user does not have write permissions to ${initd_dir}. Cannot install NiFi as a service."&lt;BR /&gt;exit 1&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;# Create the init script, overwriting anything currently present&lt;BR /&gt;cat &amp;lt;&amp;lt;SERVICEDESCRIPTOR &amp;gt; ${SVC_FILE}&lt;BR /&gt;#!/bin/sh&lt;/P&gt;&lt;P&gt;#&lt;BR /&gt;# Licensed to the Apache Software Foundation (ASF) under one or more&lt;BR /&gt;# contributor license agreements. See the NOTICE file distributed with&lt;BR /&gt;# this work for additional information regarding copyright ownership.&lt;BR /&gt;# The ASF licenses this file to You under the Apache License, Version 2.0&lt;BR /&gt;# (the "License"); you may not use this file except in compliance with&lt;BR /&gt;# the License. You may obtain a copy of the License at&lt;BR /&gt;#&lt;BR /&gt;# &lt;A href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank"&gt;http://www.apache.org/licenses/LICENSE-2.0&lt;/A&gt;&lt;BR /&gt;#&lt;BR /&gt;# Unless required by applicable law or agreed to in writing, software&lt;BR /&gt;# distributed under the License is distributed on an "AS IS" BASIS,&lt;BR /&gt;# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;BR /&gt;# See the License for the specific language governing permissions and&lt;BR /&gt;# limitations under the License.&lt;BR /&gt;#&lt;BR /&gt;# chkconfig: 2345 20 80&lt;BR /&gt;# description: Apache NiFi is a dataflow system based on the principles of Flow-Based Programming.&lt;BR /&gt;#&lt;/P&gt;&lt;P&gt;# Make use of the configured NIFI_HOME directory and pass service requests to the nifi.sh executable&lt;BR /&gt;NIFI_HOME=${NIFI_HOME}&lt;BR /&gt;bin_dir=\${NIFI_HOME}/bin&lt;BR /&gt;nifi_executable=\${bin_dir}/nifi.sh&lt;/P&gt;&lt;P&gt;\${nifi_executable} "\$@"&lt;BR /&gt;SERVICEDESCRIPTOR&lt;/P&gt;&lt;P&gt;if [ ! -f "${SVC_FILE}" ]; then&lt;BR /&gt;echo "Could not create service file ${SVC_FILE}"&lt;BR /&gt;exit 1&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;# Provide the user execute access on the file&lt;BR /&gt;chmod u+x ${SVC_FILE}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# If SLES or OpenSuse...&lt;BR /&gt;if [ "${ID}" = "opensuse" ] || [ "${ID}" = "sles" ]; then&lt;BR /&gt;rm -f "/etc/rc.d/rc2.d/S65${SVC_NAME}"&lt;BR /&gt;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; }&lt;BR /&gt;rm -f "/etc/rc.d/rc2.d/K65${SVC_NAME}"&lt;BR /&gt;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; }&lt;BR /&gt;echo "Service ${SVC_NAME} installed"&lt;BR /&gt;# Anything other fallback to the old approach&lt;BR /&gt;else&lt;BR /&gt;rm -f "/etc/rc2.d/S65${SVC_NAME}"&lt;BR /&gt;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; }&lt;BR /&gt;rm -f "/etc/rc2.d/K65${SVC_NAME}"&lt;BR /&gt;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; }&lt;BR /&gt;echo "Service ${SVC_NAME} installed"&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;# systemd: generate nifi.service from init.d&lt;BR /&gt;if [ -d "/run/systemd/system/" ] || [ ! -z "$(pidof systemd 2&amp;gt;/dev/null)" ]; then&lt;BR /&gt;systemctl daemon-reload&lt;BR /&gt;fi&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;is_nonzero_integer() {&lt;/P&gt;&lt;P&gt;if [ "$1" -gt 0 ] 2&amp;gt;/dev/null; then&lt;BR /&gt;return 0&lt;BR /&gt;else&lt;BR /&gt;return 1&lt;BR /&gt;fi&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;run() {&lt;BR /&gt;BOOTSTRAP_CONF_DIR="${NIFI_HOME}/conf"&lt;BR /&gt;BOOTSTRAP_CONF="${BOOTSTRAP_CONF_DIR}/bootstrap.conf";&lt;BR /&gt;BOOTSTRAP_LIBS="${NIFI_HOME}/lib/bootstrap/*"&lt;/P&gt;&lt;P&gt;WAIT_FOR_INIT_DEFAULT_TIMEOUT=900&lt;BR /&gt;WAIT_FOR_INIT_SLEEP_TIME=2&lt;BR /&gt;WAIT_FOR_INIT_FEEDBACK_INTERVAL=10&lt;/P&gt;&lt;P&gt;run_as_user=$(grep '^\s*run.as' "${BOOTSTRAP_CONF}" | cut -d'=' -f2)&lt;BR /&gt;# If the run as user is the same as that starting the process, ignore this configuration&lt;BR /&gt;if [ "${run_as_user}" = "$(whoami)" ]; then&lt;BR /&gt;unset run_as_user&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;if $cygwin; then&lt;BR /&gt;if [ -n "${run_as_user}" ]; then&lt;BR /&gt;echo "The run.as option is not supported in a Cygwin environment. Exiting."&lt;BR /&gt;exit 1&lt;BR /&gt;fi;&lt;/P&gt;&lt;P&gt;NIFI_HOME=$(cygpath --path --windows "${NIFI_HOME}")&lt;BR /&gt;NIFI_LOG_DIR=$(cygpath --path --windows "${NIFI_LOG_DIR}")&lt;BR /&gt;NIFI_PID_DIR=$(cygpath --path --windows "${NIFI_PID_DIR}")&lt;BR /&gt;BOOTSTRAP_CONF=$(cygpath --path --windows "${BOOTSTRAP_CONF}")&lt;BR /&gt;BOOTSTRAP_CONF_DIR=$(cygpath --path --windows "${BOOTSTRAP_CONF_DIR}")&lt;BR /&gt;BOOTSTRAP_LIBS=$(cygpath --path --windows "${BOOTSTRAP_LIBS}")&lt;BR /&gt;BOOTSTRAP_CLASSPATH="${BOOTSTRAP_CONF_DIR};${BOOTSTRAP_LIBS}"&lt;BR /&gt;if [ -n "${TOOLS_JAR}" ]; then&lt;BR /&gt;TOOLS_JAR=$(cygpath --path --windows "${TOOLS_JAR}")&lt;BR /&gt;BOOTSTRAP_CLASSPATH="${TOOLS_JAR};${BOOTSTRAP_CLASSPATH}"&lt;BR /&gt;fi&lt;BR /&gt;else&lt;BR /&gt;if [ -n "${run_as_user}" ]; then&lt;BR /&gt;if ! id -u "${run_as_user}" &amp;gt;/dev/null 2&amp;gt;&amp;amp;1; then&lt;BR /&gt;echo "The specified run.as user ${run_as_user} does not exist. Exiting."&lt;BR /&gt;exit 1&lt;BR /&gt;fi&lt;BR /&gt;fi;&lt;BR /&gt;BOOTSTRAP_CLASSPATH="${BOOTSTRAP_CONF_DIR}:${BOOTSTRAP_LIBS}"&lt;BR /&gt;if [ -n "${TOOLS_JAR}" ]; then&lt;BR /&gt;BOOTSTRAP_CLASSPATH="${TOOLS_JAR}:${BOOTSTRAP_CLASSPATH}"&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;echo&lt;BR /&gt;echo "Java home: ${JAVA_HOME}"&lt;BR /&gt;echo "NiFi home: ${NIFI_HOME}"&lt;BR /&gt;echo&lt;BR /&gt;echo "Bootstrap Config File: ${BOOTSTRAP_CONF}"&lt;BR /&gt;echo&lt;/P&gt;&lt;P&gt;# run 'start' in the background because the process will continue to run, monitoring NiFi.&lt;BR /&gt;# all other commands will terminate quickly so want to just wait for them&lt;/P&gt;&lt;P&gt;#setup directory parameters&lt;BR /&gt;BOOTSTRAP_LOG_PARAMS="-Dorg.apache.nifi.bootstrap.config.log.dir='${NIFI_LOG_DIR}'"&lt;BR /&gt;BOOTSTRAP_PID_PARAMS="-Dorg.apache.nifi.bootstrap.config.pid.dir='${NIFI_PID_DIR}'"&lt;BR /&gt;BOOTSTRAP_CONF_PARAMS="-Dorg.apache.nifi.bootstrap.config.file='${BOOTSTRAP_CONF}'"&lt;/P&gt;&lt;P&gt;# uncomment to allow debugging of the bootstrap process&lt;BR /&gt;#BOOTSTRAP_DEBUG_PARAMS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000"&lt;/P&gt;&lt;P&gt;BOOTSTRAP_DIR_PARAMS="${BOOTSTRAP_LOG_PARAMS} ${BOOTSTRAP_PID_PARAMS} ${BOOTSTRAP_CONF_PARAMS}"&lt;/P&gt;&lt;P&gt;run_bootstrap_cmd="'${JAVA}' -cp '${BOOTSTRAP_CLASSPATH}' -Xms48m -Xmx48m ${BOOTSTRAP_DIR_PARAMS} ${BOOTSTRAP_DEBUG_PARAMS} ${BOOTSTRAP_JAVA_OPTS} org.apache.nifi.bootstrap.RunNiFi"&lt;BR /&gt;run_nifi_cmd="${run_bootstrap_cmd} $@"&lt;/P&gt;&lt;P&gt;if [ -n "${run_as_user}" ]; then&lt;BR /&gt;preserve_environment=$(grep '^\s*preserve.environment' "${BOOTSTRAP_CONF}" | cut -d'=' -f2 | tr '[:upper:]' '[:lower:]')&lt;BR /&gt;SUDO="sudo"&lt;BR /&gt;if [ "$preserve_environment" = "true" ]; then&lt;BR /&gt;SUDO="sudo -E"&lt;BR /&gt;fi&lt;BR /&gt;# Provide SCRIPT_DIR and execute nifi-env for the run.as user command&lt;BR /&gt;run_nifi_cmd="${SUDO} -u ${run_as_user} sh -c \"SCRIPT_DIR='${SCRIPT_DIR}' &amp;amp;&amp;amp; . '${SCRIPT_DIR}/nifi-env.sh' &amp;amp;&amp;amp; ${run_nifi_cmd}\""&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;if [ "$1" = "run" ]; then&lt;BR /&gt;# Use exec to handover PID to RunNiFi java process, instead of foking it as a child process&lt;BR /&gt;run_nifi_cmd="exec ${run_nifi_cmd}"&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;if [ "$1" = "set-sensitive-properties-algorithm" ]; then&lt;BR /&gt;run_command="'${JAVA}' -cp '${BOOTSTRAP_CLASSPATH}' '-Dnifi.properties.file.path=${NIFI_HOME}/conf/nifi.properties' 'org.apache.nifi.flow.encryptor.command.SetSensitivePropertiesAlgorithm'"&lt;BR /&gt;eval "cd ${NIFI_HOME}"&lt;BR /&gt;shift&lt;BR /&gt;eval "${run_command}" '"$@"'&lt;BR /&gt;EXIT_STATUS=$?&lt;BR /&gt;echo&lt;BR /&gt;return;&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;if [ "$1" = "set-sensitive-properties-key" ]; then&lt;BR /&gt;run_command="'${JAVA}' -cp '${BOOTSTRAP_CLASSPATH}' '-Dnifi.properties.file.path=${NIFI_HOME}/conf/nifi.properties' 'org.apache.nifi.flow.encryptor.command.SetSensitivePropertiesKey'"&lt;BR /&gt;eval "cd ${NIFI_HOME}"&lt;BR /&gt;shift&lt;BR /&gt;eval "${run_command}" '"$@"'&lt;BR /&gt;EXIT_STATUS=$?&lt;BR /&gt;echo&lt;BR /&gt;return;&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;if [ "$1" = "set-single-user-credentials" ]; then&lt;BR /&gt;run_command="'${JAVA}' -cp '${BOOTSTRAP_CLASSPATH}' '-Dnifi.properties.file.path=${NIFI_HOME}/conf/nifi.properties' 'org.apache.nifi.authentication.single.user.command.SetSingleUserCredentials'"&lt;BR /&gt;eval "cd ${NIFI_HOME}"&lt;BR /&gt;shift&lt;BR /&gt;eval "${run_command}" '"$@"'&lt;BR /&gt;EXIT_STATUS=$?&lt;BR /&gt;echo&lt;BR /&gt;return;&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;if [ "$1" = "stateless" ]; then&lt;BR /&gt;STATELESS_JAVA_OPTS="${STATELESS_JAVA_OPTS:=-Xms1024m -Xmx1024m}"&lt;/P&gt;&lt;P&gt;shift # Remove 'stateless' argument so we can pass all the rest as $@&lt;/P&gt;&lt;P&gt;echo&lt;BR /&gt;echo "Note: Use of this command is considered experimental. The commands and approach used may change from time to time."&lt;BR /&gt;echo&lt;BR /&gt;echo "Java home (JAVA_HOME): ${JAVA_HOME}"&lt;BR /&gt;echo "NiFi home (NIFI_HOME): ${NIFI_HOME}"&lt;BR /&gt;echo "Java options (STATELESS_JAVA_OPTS): ${STATELESS_JAVA_OPTS}"&lt;BR /&gt;echo&lt;BR /&gt;run_nifi_cmd="'${JAVA}' ${BOOTSTRAP_LOG_PARAMS} '-Dlogback.configurationFile=${NIFI_HOME}/conf/stateless-logback.xml' -cp '${NIFI_HOME}/lib/*:${NIFI_HOME}/conf' ${STATELESS_JAVA_OPTS} 'org.apache.nifi.stateless.bootstrap.RunStatelessFlow'"&lt;/P&gt;&lt;P&gt;eval "cd ${NIFI_HOME}"&lt;BR /&gt;# Our arguments may have spaces (especially for passing parameters). The eval command will strip those out. To avoid that, we need to use "$@" to get the quotes in the arguments, and then&lt;BR /&gt;# surround that by single-ticks in order to prevent eval from stripping the quotes out.&lt;BR /&gt;eval "${run_nifi_cmd}" '"$@"'&lt;BR /&gt;EXIT_STATUS=$?&lt;BR /&gt;echo&lt;BR /&gt;return;&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;if [ "$1" = "start" ]; then&lt;BR /&gt;( eval "cd ${NIFI_HOME} &amp;amp;&amp;amp; ${run_nifi_cmd}" &amp;amp; )&amp;gt; /dev/null 1&amp;gt;&amp;amp;-&lt;/P&gt;&lt;P&gt;if [ "$2" = "--wait-for-init" ]; then&lt;/P&gt;&lt;P&gt;if is_nonzero_integer "$3" ; then&lt;BR /&gt;wait_timeout="$3"&lt;BR /&gt;else&lt;BR /&gt;wait_timeout=$WAIT_FOR_INIT_DEFAULT_TIMEOUT&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;starttime=$(date +%s)&lt;BR /&gt;endtime=$(($starttime+$wait_timeout))&lt;BR /&gt;current_time=$starttime&lt;BR /&gt;time_since_feedback=0&lt;BR /&gt;not_running_counter=0&lt;/P&gt;&lt;P&gt;is_nifi_loaded="false" # 3 possible values: "true", "false", "not_running". "not_running" means NiFi has not been started.&lt;BR /&gt;while [ "$is_nifi_loaded" != "true" ]; do&lt;BR /&gt;time_at_previous_loop=$current_time&lt;/P&gt;&lt;P&gt;current_time=$(date +%s)&lt;BR /&gt;if [ "$current_time" -ge "$endtime" ]; then&lt;BR /&gt;echo "Exited the script due to --wait-for-init timeout"&lt;BR /&gt;break;&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;time_since_feedback=$(($time_since_feedback+($current_time-$time_at_previous_loop)))&lt;BR /&gt;if [ "$time_since_feedback" -ge "$WAIT_FOR_INIT_FEEDBACK_INTERVAL" ]; then&lt;BR /&gt;time_since_feedback=0&lt;BR /&gt;echo "NiFi has not fully initialized yet..."&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;is_nifi_loaded=$( eval "cd ${NIFI_HOME} &amp;amp;&amp;amp; ${run_bootstrap_cmd} is_loaded" )&lt;/P&gt;&lt;P&gt;if [ "$is_nifi_loaded" = "not_running" ]; then&lt;BR /&gt;not_running_counter=$(($not_running_counter+1))&lt;BR /&gt;if [ "$not_running_counter" -ge 3 ]; then&lt;BR /&gt;echo "NiFi is not running. Stopped waiting for it to initialize."&lt;BR /&gt;break;&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;sleep $WAIT_FOR_INIT_SLEEP_TIME&lt;BR /&gt;done&lt;BR /&gt;if [ "$is_nifi_loaded" = "true" ]; then&lt;BR /&gt;echo "NiFi initialized."&lt;BR /&gt;echo "Exiting startup script..."&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;BR /&gt;else&lt;BR /&gt;eval "cd ${NIFI_HOME} &amp;amp;&amp;amp; ${run_nifi_cmd}"&lt;BR /&gt;fi&lt;BR /&gt;EXIT_STATUS=$?&lt;/P&gt;&lt;P&gt;# Wait just a bit (3 secs) to wait for the logging to finish and then echo a new-line.&lt;BR /&gt;# We do this to avoid having logs spewed on the console after running the command and then not giving&lt;BR /&gt;# control back to the user&lt;BR /&gt;sleep 3&lt;BR /&gt;echo&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;main() {&lt;BR /&gt;init "$1"&lt;BR /&gt;run "$@"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;case "$1" in&lt;BR /&gt;install)&lt;BR /&gt;install "$@"&lt;BR /&gt;;;&lt;/P&gt;&lt;P&gt;start|stop|decommission|run|status|is_loaded|dump|diagnostics|status-history|env|stateless|set-sensitive-properties-algorithm|set-sensitive-properties-key|set-single-user-credentials)&lt;BR /&gt;main "$@"&lt;BR /&gt;;;&lt;/P&gt;&lt;P&gt;restart)&lt;BR /&gt;init&lt;BR /&gt;run "stop"&lt;BR /&gt;run "start"&lt;BR /&gt;;;&lt;BR /&gt;*)&lt;BR /&gt;echo "Usage nifi {start|stop|decommission|run|restart|status|dump|diagnostics|status-history|install|stateless|set-sensitive-properties-algorithm|set-sensitive-properties-key|set-single-user-credentials}"&lt;BR /&gt;;;&lt;BR /&gt;esac&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 11:33:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Error-launching-NIFI-v1-26-in-service-mode-with-systemctl/m-p/412851#M253730</guid>
      <dc:creator>ThierryOfNantes</dc:creator>
      <dc:date>2025-11-13T11:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Error launching NIFI(v1.26) in service mode with  systemctl: Permission denied</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Error-launching-NIFI-v1-26-in-service-mode-with-systemctl/m-p/412853#M253731</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/134637"&gt;@ThierryOfNantes&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The "install" option for nifi.sh was removed as of NiFi 2.x release because of the nuisances of the many different linux distributions that exist today.&lt;BR /&gt;&lt;BR /&gt;I am not implying that is your issue here, but wanted you to be aware that I could be a contributing factor to your issue.&lt;BR /&gt;&lt;BR /&gt;Since you can successfully start NiFi manually using the ./bin/nifi.sh start command, NiFi is working fine.&amp;nbsp; So the permission issue is outside of NiFi.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;What user are you logged in as when you issue the command systemctl start nifi?&amp;nbsp;&lt;BR /&gt;Is that user able to sudo to your run.as user?&lt;BR /&gt;&lt;BR /&gt;Perhaps try enabling debug on your journalctl log to see ifget more detail on where the permission denied is coming from.&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Matt&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 14:08:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Error-launching-NIFI-v1-26-in-service-mode-with-systemctl/m-p/412853#M253731</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2025-11-13T14:08:40Z</dc:date>
    </item>
  </channel>
</rss>

