Bug 228532 - databases/neo4j: Various fixes and improvements
Summary: databases/neo4j: Various fixes and improvements
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Wen Heping
URL: https://www.freshports.org/databases/...
Keywords: easy, feature
Depends on:
Blocks: 228526 268526
  Show dependency treegraph
 
Reported: 2018-05-27 05:07 UTC by Mateusz Piotrowski
Modified: 2025-05-25 19:58 UTC (History)
7 users (show)

See Also:
0mp: maintainer-feedback?
ACCOUNT_DELETED: maintainer-feedback? (wen)


Attachments
Patch with various fixes and improvements for databases/neo4j (3.08 KB, patch)
2018-05-27 05:07 UTC, Mateusz Piotrowski
0mp: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mateusz Piotrowski freebsd_committer freebsd_triage 2018-05-27 05:07:48 UTC
Created attachment 193749 [details]
Patch with various fixes and improvements for databases/neo4j

Changes:
 * Bump PORTREVISION.
 * Describe licensing in more detail:
  * Add licenses of dependencies.
  * Define LICENSE_FILE*.
 * Silence MKDIR's.
 * Use "/bin/sh" instead of "/usr/bin/env bash" in the launch script. 
   It looks like there's no need to use Bash here.
 * Install bin/tools/* under ${PREFIX}/neo4j/lib instead of 
   ${PREFIX}/neo4j/libexec. This fixes the cypher-shell issue from 228526[1]. 
   I am not sure if this is a correct solution.

QA:
 * portlint -AC
 * manual testing on FreeBSD 12.0-CURRENT r333659 amd64
 * port test on FreeBSD 12.0-CURRENT r333659 amd64

[1]: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228526
Comment 1 Walter Schwarzenfeld 2019-08-14 09:33:08 UTC
Maintainer feedback, please!
Comment 2 devnull freebsd_committer freebsd_triage 2023-01-02 20:56:35 UTC
Triage: 

* bug 268526 comment 4 requests a review of this bug 228532 prior to 
  progress on 268526

* flag for feedback from the new maintainer of databases/neo4j

* clear the flag for feedback from the former maintainer

* the patch keyword is deprecated.
Comment 3 Borja Marcos 2023-01-18 10:52:23 UTC
I´d like to add something.

This port runs as root, which is a Bad Idea™.

It´s simple to correct the rc script so that it accepts a username and group.

It´s also a good idea to offer some flexibility for choosing the JVM.

I have added these variables:


---
: ${neo4j_java_home:=/usr/local/openjdk11}
: ${neo4j_user:=neo4j}
: ${neo4j_group:=neo4j}
---

command should be:
---
command=/usr/local/bin/neo4j
command_args="start"
---

And for precmd,

---
        /usr/bin/install -d -o ${neo4j_user} -g ${neo4j_group} -m 755 ${NEO4J_LOGS}
        /usr/bin/install -d -o ${neo4j_user} -g ${neo4j_group} -m 755 ${NEO4J_RUN}
---
Comment 4 Borja Marcos 2023-01-18 11:18:27 UTC
(In reply to Borja Marcos from comment #3)
Sorry, it needs the pid file fixed as well.

---
pidfile=/var/run/neo4j.pid
----

on prestart()

---
/usr/bin/install -o ${neo4j_user} -g ${neo4j_group} -m 755 /dev/null /var/run/neo4j.pid
---
Comment 5 Michael Osipov 2023-01-19 10:43:34 UTC
Guys, please note https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268526
I hope I can address most of those issues.
Comment 6 commit-hook freebsd_committer freebsd_triage 2025-05-25 14:54:04 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=882cb317da85522cbf2462ec264ff07112e58309

commit 882cb317da85522cbf2462ec264ff07112e58309
Author:     Juraj Lutter <otis@FreeBSD.org>
AuthorDate: 2025-05-25 13:53:13 +0000
Commit:     Juraj Lutter <otis@FreeBSD.org>
CommitDate: 2025-05-25 14:53:35 +0000

    databases/neo4j: Fix run-time

    - Assign UID and GIT to neo4j (both 369)
    - Instruct neo4j to run as neo4j user
    - Move config directory to PREFIX/etc/neo4j
    - Move certificates base directory to PREFIX/etc/neo4j/certificates
    - Move data directory to /var/db/neo4j/data
    - Move metrics directory to /var/db/neo4j/metrics
    - Move import directory to /var/db/neo4j/import
    - Fix rc.d script accordingly

    Partially based on information from [1] and [2]

    PR:             268526 [1]
    PR:             228532 [2]

    Sponsored by:   resulta.sk

 GIDs                                        |  2 +-
 UIDs                                        |  2 +-
 databases/neo4j/Makefile                    | 61 +++++++++++++++++++++------
 databases/neo4j/files/neo4j.in              | 31 +++++++++++---
 databases/neo4j/files/neo4j.sh.in           |  4 +-
 databases/neo4j/files/patch-conf_neo4j.conf | 64 ++++++++++++++++++++++++++---
 databases/neo4j/pkg-plist                   |  9 ++--
 7 files changed, 142 insertions(+), 31 deletions(-)
Comment 7 Juraj Lutter freebsd_committer freebsd_triage 2025-05-25 19:58:40 UTC
Thanks for the valuable inputs!