Bug 220001 - textproc/apache-solr fix ownership of log and db directory
Summary: textproc/apache-solr fix ownership of log and db directory
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Richard Gallamore
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-06-15 07:27 UTC by Reshad Patuck
Modified: 2017-07-06 19:46 UTC (History)
2 users (show)

See Also:
reshadpatuck1: maintainer-feedback+
mfechner: maintainer-feedback+


Attachments
fix ownership of solar var dirs (837 bytes, patch)
2017-06-15 07:27 UTC, Reshad Patuck
no flags Details | Diff
Completed previous sent patch to remove the post install script (1.38 KB, patch)
2017-06-15 10:51 UTC, Matthias Fechner
mfechner: maintainer-approval+
Details | Diff
Fix permission of folders and config files (1.77 KB, patch)
2017-07-03 15:40 UTC, Matthias Fechner
mfechner: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Reshad Patuck 2017-06-15 07:27:41 UTC
Created attachment 183489 [details]
fix ownership of solar var dirs

Directories /var/db/solr and /var/log/solr are owned by root:wheel.

Change these to solr:solr in pkg-plist so that the solr user can write to them.
Comment 1 Matthias Fechner freebsd_committer 2017-06-15 10:51:11 UTC
Created attachment 183496 [details]
Completed previous sent patch to remove the post install script

The previous version sets the permission of the folders /var/db/solr and /var/log/solr with the help of a post install script, which seems to not work for at least one user.
Logic changed to set permission using pkg-plist.

Thanks for this!
Comment 2 Reshad Patuck 2017-06-15 11:53:27 UTC
(In reply to Matthias Fechner from comment #1)
Oh, I didnt see that script at all.

I think you have to also have a PKGINSTALL directive in the Makefile for that to apply.
Comment 3 Matthias Fechner freebsd_committer 2017-06-15 12:34:34 UTC
You are right, I have started a test build, but it requires some time, as some other updates are included in the poudiere build.
Comment 4 Matthias Fechner freebsd_committer 2017-06-15 17:39:36 UTC
It will not be that simple as I thought at first.
Can you provide with an improved patch for this?

If not I would suggest the already attached to be used. It is not perfect but better than the first version.
Comment 5 Reshad Patuck 2017-06-23 11:19:22 UTC
(In reply to Matthias Fechner from comment #4)
Hey, tried it too, could not get it working.
Comment 6 Matthias Fechner freebsd_committer 2017-06-24 07:43:10 UTC
Could you please be a little bit more specific?
What is not working?
Do you get an error message?
Comment 7 Reshad Patuck 2017-06-24 08:00:28 UTC
(In reply to Matthias Fechner from comment #6)
Sorry for being vague,

I could not get the pkg-install script to chdir the /var/db/solr and /var/log/solr directory.

It does work with the pkg-plist chowning the dir to solr,solr
Comment 8 Matthias Fechner freebsd_committer 2017-06-24 08:03:15 UTC
But if you apply the patch attach to this PR it should work or?
Comment 9 Richard Gallamore freebsd_committer 2017-06-30 22:41:11 UTC
After testing the patch, it still needs a little bit of work. Before patch would change everything in directory /var/db/solr to solr:solr. It now remains root:wheel. Was this intended?

root@103amd64-test:/var/db/solr # ls -l /var/log /var/log/solr /var/db /var/db/solr
/var/db:
total 271
drwx------  2 operator  operator      2 Mar 25  2016 entropy
drwxr-xr-x  3 root      wheel         4 Mar 25  2016 etcupdate
drwxr-xr-x  2 root      wheel         5 Jun 30 18:32 fontconfig
drwx------  7 root      wheel        14 Jun  6 19:23 freebsd-update
drwx------  2 root      wheel         2 Mar 25  2016 hyperv
drwx------  2 root      wheel         2 Mar 25  2016 ipf
-rw-r--r--  1 nobody    wheel         0 Mar 25  2016 locate.database
-rw-------  1 root      wheel     28642 Jan  1 16:10 mergemaster.mtree
drwx------  2 root      wheel         2 Mar 25  2016 ntp
drwxr-xr-x  2 root      wheel         3 Jun 30 18:33 pkg
drwxr-xr-x  2 root      wheel         2 Jun 28 16:11 ports
drwxr-xr-x  2 root      wheel         2 Mar 25  2016 portsnap
drwxr-xr-x  2 solr      solr          6 Jun 30 18:33 solr

/var/db/solr:
total 34
-rw-r--r--  1 root  wheel  1390 Jun 30 18:28 log4j.properties
-rw-r--r--  1 root  wheel  1390 Jun 30 18:28 log4j.properties-dist
-rw-r--r--  1 root  wheel  2117 Jun 30 18:28 solr.xml
-rw-r--r--  1 root  wheel  2117 Jun 30 18:28 solr.xml-dist

/var/log:
total 27
-rw-r-----  1 root  wheel    0 Mar 25  2016 sendmail.st
drwxr-xr-x  2 solr  solr     2 Jun 30 18:28 solr
-rw-------  1 root  wheel  151 Jun 30 18:32 userlog
-rw-r--r--  1 root  wheel  197 Jun 30 18:33 utx.lastlogin
-rw-r--r--  1 root  wheel   60 Jun 30 18:33 utx.log

/var/log/solr:
total 0
Comment 10 Matthias Fechner freebsd_committer 2017-07-03 15:40:28 UTC
Created attachment 184036 [details]
Fix permission of folders and config files

Thanks a lot Richard,

now I understand what the reported problem is. Attached a new patch that should fix it.
Comment 11 commit-hook freebsd_committer 2017-07-06 19:31:47 UTC
A commit references this bug:

Author: ultima
Date: Thu Jul  6 19:31:02 UTC 2017
New revision: 445166
URL: https://svnweb.freebsd.org/changeset/ports/445166

Log:
  * Fixed uid:gid of solr directories

  PR:		220001
  Submitted by:	Matthias Fechner <idefix@fechner.net> (maintainer), Reshad Patuck <reshadpatuck1@gmail.com>
  Reviewed by:	lifanov (mentor)
  Approved by:	lifanov (mentor)
  Differential Revision:	https://reviews.freebsd.org/D11501

Changes:
  head/textproc/apache-solr/Makefile
  head/textproc/apache-solr/files/pkg-install.in
  head/textproc/apache-solr/pkg-plist
Comment 12 Richard Gallamore freebsd_committer 2017-07-06 19:46:06 UTC
(In reply to Matthias Fechner from comment #10)
Not a problem!



Committed, thanks!