This closes Corrects issue were RPM profile run.as property was not being used
This supersedes
@@ -485,6 +485,15 @@ language governing permissions and limitations under the License. -->
<defaultFilemode>640</defaultFilemode>
<defaultUsername>nifi</defaultUsername>
<defaultGroupname>nifi</defaultGroupname>
+ <!-- This allows the stanza to produce bootstrap.conf that is pre-configured with run.as=nifi
+ given the uid is created by the preinstallScriptlet below. Meanwhile, normal zip and tar.gz
+ ship without this particular property set -->
+ <installScriptlet>
+ <!-- It is important to note because of the way the plugin calls the command, the sed backup
+ parameter -i and the sed command do not beed to be wrapped by single or double quotes.
+ Also note maven properties are processed before RPM variables and before sed commands -->
+ <script>sed -i s/^run\.as=$/run\.as=${nifi.run.as}/ $RPM_BUILD_ROOT/opt/nifi/nifi-${project.version}/conf/bootstrap.conf</script>
+ </installScriptlet>
<preinstallScriptlet>
<script>
/usr/bin/getent group nifi &gt;/dev/null || /usr/sbin/groupadd -r nifi; /usr/bin/getent passwd nifi &gt;/dev/null || /usr/sbin/useradd -r -g nifi -d /opt/nifi -s /sbin/nologin -c "NiFi System User" nifi
