5

i'm trying to run a node as a service using systemctl start node-relay.service

i get this error, can anyone advise what i'm doing wrong.

/home/ec2-user/.local/bin/cardano-node: error while loading shared libraries: libsodium.so.23: cannot open shared object file: No such file or directory

my node-relay.service file looks like this

Description= relay node
After=multi-user.target

[Service]
Type=simple
EnvironmentFile=/home/ec2-user/relay/node.environment
ExecStart=/home/ec2-user/.local/bin/cardano-node run --config $CONFIG --topology $TOPOLOGY --database-path $DBPATH --socket-path $SOCKETPATH --host-addr $HOSTADDR --port $PORT
KillSignal = SIGINT
RestartKillSignal = SIGINT
StandardOutput=journal
StandardError=journal
SyslogIdentifier=cardano-node

LimitNOFILE=32768

Restart=on-failure
RestartSec=15s
WorkingDirectory=~
User=ec2-user
Group=ec2-user

[Install]
WantedBy=multi-user.target

my .bashrc file contains

export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
export PATH="~/.local/bin:$PATH"

the node starts fine if it run it like this;

cardano-node run --config ~/relay/testnet-config.json --database-path ~/relay/db --socket-path ~/relay/db/node.socket --host-addr 0.0.0.0 --port 3000

1
2

The environment variables need to be added to the /home/ec2-user/relay/node.environment file. Or you can specify them directly in node-relay.service file.

[Service]
Type=simple
Environment="LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH"
Environment="PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"

...

1
  • thanks, all makes sense now.
    – rob
    Aug 11 at 2:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.