I used this perl script to convert the neo4j systemd init script to an OpenRC version, and it appears to be working when I run
$ sudo rc-service neo4j start
[sudo] password for USERNAME:
* Caching service dependencies ... [ ok ]
* Starting neo4j ...Directories in use:
home: /var/lib/neo4j
config: /etc/neo4j
logs: /var/lib/neo4j/logs
plugins: /var/lib/neo4j/plugins
import: /var/lib/neo4j/import
data: /var/lib/neo4j/data
certificates: /var/lib/neo4j/certificates
licenses: /var/lib/neo4j/licenses
run: /var/lib/neo4j/run
Starting Neo4j.
2024-10-03 01:34:51.527+0000 INFO Logging config in use: Embedded default config 'default-user-logs.xml'
2024-10-03 01:34:51.548+0000 INFO Starting...
2024-10-03 01:34:52.282+0000 INFO This instance is ServerId{65e54120} (65e54120-0341-40f9-8b73-1cb1104a1843)
2024-10-03 01:34:53.266+0000 INFO ======== Neo4j 5.24.0 ========
2024-10-03 01:34:55.300+0000 INFO Anonymous Usage Data is being sent to Neo4j, see https://neo4j.com/docs/usage-data/
2024-10-03 01:34:55.329+0000 INFO Bolt enabled on localhost:7687.
2024-10-03 01:34:55.769+0000 INFO HTTP enabled on localhost:7474.
2024-10-03 01:34:55.769+0000 INFO Remote interface available at http://localhost:7474/
2024-10-03 01:34:55.772+0000 INFO id: C0A3C6D86D12C57FD02A9D581050097A3B638BCDD14FF15249878B50674CB519
2024-10-03 01:34:55.772+0000 INFO name: system
2024-10-03 01:34:55.772+0000 INFO creationDate: 2024-10-03T01:34:54.182Z
2024-10-03 01:34:55.772+0000 INFO Started.
It just shows it running at CLI and doesn't return back to the prompt as is expected from OpenRC init scripts. Then when I try to "sudo rc-service neo4j stop" it, it does not stop, so I try ctrl+C and that bring me back to interactive CLI:
^C * neo4j: caught SIGINT, aborting
* start-stop-daemon: caught SIGINT, aborting
Then I try to start neo4j back up with "sudo rc-service neo4j start" and I get
* Starting neo4j ...Neo4j is already running (pid:23821).
Run with '--verbose' for a more detailed error message.
* start-stop-daemon: failed to start `/usr/bin/neo4j'
* Failed to start neo4j
[ !! ]
* ERROR: neo4j failed to start
When I run "sudo rc-service neo4j status", it shows
* status: stopped
It is still running with a check from "ps aux | grep neo4j"
This init script the perl script above created is:
#!/sbin/openrc-run
command=/usr/bin/neo4j
command_args="console"
pidfile=
name="neo4j"
description="Neo4j Graph Database"
Any help getting this OpenRC init script working?