Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-14585

Check the current user in SysV init script

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 8.5.2
    • None
    • scripts and tools

    Description

      While SOLR-14410 is still open I propose a quick fix/improvement for init.d script - check the current user and, if it is the same as RUNAS user, then don't execute "su".

       

      Background:

      Systemd has backward compatibility with SysV and able to run scripts from /etc/init.d, but SELinux policies in many distros encourage changing user before this stage and prohibits executing of "su" binary, so it would be logical to do this at systemd level (/etc/systemd/system/solr.service.d/override.conf). In this case, the current init.d script for Solr is missing one very trivial check - `"$RUNAS" != "$USER"`. See the diff-file in the attachment.

       

      Pull request: https://github.com/apache/lucene-solr/pull/1627

      Attachments

        1. init.d-solr.diff
          0.4 kB
          Roman Kosenko

        Issue Links

          Activity

            People

              Unassigned Unassigned
              roman.kosenko Roman Kosenko
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m