Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/goal/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const (
errorNodeRunning = "Node must be stopped before writing APIToken"
errorNodeFailGenToken = "Cannot generate API token: %s"
errorNodeCreation = "Error during node creation: %v"
errorNodeManagedBySystemd = "This node is managed by systemd, you must run the following command to make your desired state change to your node:\n\nsystemctl %s algorand.service"
errorNodeManagedBySystemd = "This node is using systemd and should be managed with systemctl. For additional information refer to https://developer.algorand.org/docs/run-a-node/setup/install/#installing-algod-as-a-systemd-service"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly add "Detected system.json file in the data directory, this node is using systemd and should be ..."

errorKill = "Cannot kill node: %s"
errorCloningNode = "Error cloning the node: %s"
infoNodeCloned = "Node cloned successfully to: %s"
Expand Down
6 changes: 3 additions & 3 deletions cmd/goal/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ var startCmd = &cobra.Command{
}
onDataDirs(func(dataDir string) {
if libgoal.AlgorandDaemonSystemdManaged(dataDir) {
reportErrorf(errorNodeManagedBySystemd, "start")
reportErrorf(errorNodeManagedBySystemd)
}

nc := nodecontrol.MakeNodeController(binDir, dataDir)
Expand Down Expand Up @@ -237,7 +237,7 @@ var stopCmd = &cobra.Command{
}
onDataDirs(func(dataDir string) {
if libgoal.AlgorandDaemonSystemdManaged(dataDir) {
reportErrorf(errorNodeManagedBySystemd, "stop")
reportErrorf(errorNodeManagedBySystemd)
}

nc := nodecontrol.MakeNodeController(binDir, dataDir)
Expand Down Expand Up @@ -268,7 +268,7 @@ var restartCmd = &cobra.Command{
}
onDataDirs(func(dataDir string) {
if libgoal.AlgorandDaemonSystemdManaged(dataDir) {
reportErrorf(errorNodeManagedBySystemd, "restart")
reportErrorf(errorNodeManagedBySystemd)
}

nc := nodecontrol.MakeNodeController(binDir, dataDir)
Expand Down
1 change: 1 addition & 0 deletions installer/algorand@.service.template
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ After=network.target
AssertPathExists=%I

[Service]
ExecStartPre=bash -c "[[ ! -f %I/system.json ]] && echo '{\"shared_server\":true,\"systemd_managed\":true}' > %I/system.json || :"
ExecStart=@@BINDIR@@/algod -d %I
User=@@USER@@
Group=@@GROUP@@
Expand Down