[ 
https://issues.apache.org/jira/browse/NIFI-1709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16019959#comment-16019959
 ] 

ASF GitHub Bot commented on NIFI-1709:
--------------------------------------

Github user jfrazee commented on the issue:

    https://github.com/apache/nifi/pull/1794
  
    @trixpan @apiri Few things. It seems like we should be using lsb_release to 
grab the OS as well as chkconfig to handle creating run level symlinks instead 
of on on our own, at least for most of the OSes. And, while we install an 
init.d script and systemd can run those, we actually don't create a systemd 
unit today, so for many of the latest releases service and systemctl won't 
actually start nifi.
    
    So I guess what I'm saying is that I think there might be 3 issues here: OS 
detection improvement, change how we set run levels, and add systemd unit and 
upstart scripts for OSes that aren't really doing sysv init anymore.
    
    FWIW I've been using something like this for the systemd unit:
    ```
    [Unit]
    Description=Apache NiFi
    After=network.target
    
    [Service]
    Type=forking
    User={{ nifi_run_as }}
    Group={{ nifi_run_as }}
    ExecStart={{ nifi_install_dir }}/bin/nifi.sh start
    ExecStop={{ nifi_install_dir }}/bin/nifi.sh stop
    Restart=on-failure
    RestartSec=60s
    ```


> The nifi.sh install script assumes RHEL directories
> ---------------------------------------------------
>
>                 Key: NIFI-1709
>                 URL: https://issues.apache.org/jira/browse/NIFI-1709
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Tools and Build
>         Environment: SUSE
>            Reporter: David A. Wynne
>            Assignee: Andre F de Miranda
>            Priority: Minor
>
> When setting up NiFi, the command: 
> bin/nifi.sh install
> The following error occurs:
> ln: failed to create symbolic link `/etc/rc2.d/S65nifi': No such file or 
> directory
> ln: failed to create symbolic link `/etc/rc2.d/K65nifi': No such file or 
> directory
> Service nifi installed
> Looking in the  nifi.sh, around line 145 - 148, you see: 
>         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}"
> It tries to symlink from /etc/init.d/nifi to /etc/rc2.d/S65nifi  (and 
> K65nifi). 
> The problem is that the script assumes that /etc/rc2.d exists in a SUSE 
> system, which it doesn't. 
> In Suse11, this directory is /etc/init.d/rc2.d/
> The script, especially the "install" option should correctly identify the OS 
> flavor it runs on, and install the files in the correct location. 
> The next version of RHEL (8, not out yet), and Ubuntu 16.02 LTS (releasing 
> next month), will use systemD, which does not have the concept of /etc/rc2.d 
> directories, but works with "targets". The script will not be compatible with 
> these OS changes. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to