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

Shawn Heisey commented on SOLR-12737:
-------------------------------------

The patch assumes that every variable definition is at the very beginning of 
the line in the include script, but that is not a strict requirement for that 
file.  Things defined in that file still work if there is whitespace at the 
beginning of every line, but this directory creation wouldn't work if that were 
the case.

Seems much better to source the file like bin/solr does, setting the variables 
in the environment, rather than rely on a very strict format requirement.

The init script is the correct place to do this.  If it were done in bin/solr, 
it wouldn't work because a regular user typically doesn't have permission to 
create directories in system locations like /run.

I wonder if the group permission should be changed to $RUNAS as well (with 
output redirected to /dev/null just in case there's not a group with the same 
name as the user).

> Let Solr init script create SOLR_PID_DIR
> ----------------------------------------
>
>                 Key: SOLR-12737
>                 URL: https://issues.apache.org/jira/browse/SOLR-12737
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: scripts and tools
>    Affects Versions: 6.6.5, 7.4
>         Environment: CentOS 7.5
>            Reporter: Andreas Hubold
>            Priority: Major
>              Labels: patch, patch-available
>         Attachments: init-script-mkdir-pid-dir.patch
>
>
> It would be great if the Solr init script could create the configured 
> SOLR_PID_DIR with permissions for the Solr user, if it doesn't exist.
> The use case is to store the PID file for the Solr service in a directory 
> below the /run directory, which is typically mounted as tmpfs file system and 
> empty after reboot. For example, with "{{SOLR_PID_DIR=/run/solr}}" in 
> solr.in.sh, Solr will be unable to write its PID file after reboot because 
> the solr subdirectory does not exist.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to