From dbb3ee4b85f6fce9b1a00e8d18ae80730cb3d7d9 Mon Sep 17 00:00:00 2001 From: Reneta Popova Date: Wed, 9 Jul 2025 15:10:22 +0100 Subject: [PATCH] Improve enabling command expansion section (#2470) --- .../configuration/command-expansion.adoc | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/modules/ROOT/pages/configuration/command-expansion.adoc b/modules/ROOT/pages/configuration/command-expansion.adoc index d6b4c69ca..1e25dfde6 100644 --- a/modules/ROOT/pages/configuration/command-expansion.adoc +++ b/modules/ROOT/pages/configuration/command-expansion.adoc @@ -41,14 +41,31 @@ Scripts and their syntax differ between operating systems. == Enabling -The Neo4j startup script and the `neo4j` service can expand and execute the external commands by using the argument `--expand-commands`. +To enable command expansion, you must add the `--expand-commands` argument to the Neo4j startup script or _neo4j.service_ file. + +=== Starting Neo4j with command expansion + +To start Neo4j with command expansion enabled, you can use the following command: [source, shell] ---- bin/neo4j start --expand-commands ---- -If the startup script does not receive the `--expand-commands` argument, commands in the configuration file are treated as invalid settings. +=== Enabling command expansion in Neo4j as a service + +If you are using Neo4j as a service, you can enable command expansion by adding the `--expand-commands` argument to the _/etc/systemd/system/neo4j.service_  file. +Otherwise, the commands in the configuration file are treated as invalid settings. + +You must also add `Type=forking` under the `[Service]` section of _/etc/systemd/system/neo4j.service_ to allow for the command expansion. + +[source] +---- +[Service] +Type=forking +---- + +=== Security checks Neo4j performs the following basic security checks on the _neo4j.conf_ file. If they fail, Neo4j does not evaluate the script commands in _neo4j.conf_, and the Neo4j process does not start.