[
https://issues.apache.org/jira/browse/SOLR-7826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jan Høydahl updated SOLR-7826:
------------------------------
Attachment: SOLR-7826_sameuser.patch
Experimented with Java 8's file attribute API, which works well and avoids
using stat in bash. See attached SOLR-7826_sameuser.patch for a solution where
we don't look for root or -force, but bail out if not same user as SOLR_HOME.
I created a new AssertTool for this, which can also be used for other
scripting, such as to assert that Solr is runing:
{noformat}
usage: bin/solr assert [-r] [-s <url>] [-u <dir>] [-x <dir>]
-help Print this message
-r,--not-root Makes sure we are not the root user
-s,--started <url> Makes sure Solr is started on a certain URL
-u,--same-user <directory> Makes sure we run as same user that owns
<directory>
-verbose Generate verbose log messages
-x,--exists <directory> Requires directory <directory> to exist
{noformat}
> Permission issues when creating cores with bin/solr as root user
> ----------------------------------------------------------------
>
> Key: SOLR-7826
> URL: https://issues.apache.org/jira/browse/SOLR-7826
> Project: Solr
> Issue Type: Improvement
> Reporter: Shawn Heisey
> Assignee: Jan Høydahl
> Priority: Minor
> Labels: newdev
> Fix For: 6.3, master (7.0)
>
> Attachments: SOLR-7826.patch, SOLR-7826.patch,
> SOLR-7826_sameuser.patch
>
>
> Ran into an interesting situation on IRC today.
> Solr has been installed as a service using the shell script
> install_solr_service.sh ... so it is running as an unprivileged user.
> User is running "bin/solr create" as root. This causes permission problems,
> because the script creates the core's instanceDir with root ownership, then
> when Solr is instructed to actually create the core, it cannot create the
> dataDir.
> Enhancement idea: When the install script is used, leave breadcrumbs
> somewhere so that the "create core" section of the main script can find it
> and su to the user specified during install.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]