How do I get them to autostart back up. I don’t think the systemctl scripts are working for me.
cardano-node.service - Cardano node service
Loaded: loaded (/etc/systemd/system/cardano-node.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Thu 2021-02-25 03:16:57 UTC; 2s ago
Process: 28982 ExecStart=/bin/bash -c /home/dii/cardano-my-node/startBlockProducingNode.sh (code=exited, status=127)
Main PID: 28982 (code=exited, status=127)
~
1 Like
Hi!
Can you please share your systemctl script?
Thanks for replaying, I think its in the cardano-node.service?
the ExecStart line would be interesting - could you please copy your screen as text? Select the lines with your mouse then CTRL+SHIFT+C and then CTRL+V or right click and copy
The Cardano node service (part of systemd)
file: /etc/systemd/system/cardano-node.service
[Unit]
Description = Cardano node service
Wants = network-online.target
After = network-online.target
[Service]
User = xxx
Type = simple
WorkingDirectory= /home/xxx/cardano-my-node
ExecStart = /bin/bash -c ‘/home/xxx/cardano-my-node/startBlockProducingNode.sh’
KillSignal=SIGINT
RestartKillSignal=SIGINT
TimeoutStopSec=2
LimitNOFILE=32768
Restart=always
RestartSec=5
[Install]
WantedBy= multi-user.target
Funny it seems my nodes stayed up the entire time I was asleep, thats a first.
do you need an environment file to execute the startBlockProducingNone.sh? does the script contain environment variables? If so add a new line after WorkingDirectory= /home/xxx/cardano-my-node
EnvironmentFile=/path/to/the/env/file
1 Like
Alright I added the line . I do have a ENV file, but i dont know if its tied to the .sh script
cat > $NODE_HOME/startBlockProducingNode.sh << EOF
DIRECTORY=NODE_HOME
PORT=6000
HOSTADDR=0.0.0.0
TOPOLOGY=\${DIRECTORY}/{NODE_CONFIG}-topology.json
DB_PATH=${DIRECTORY}/db
SOCKET_PATH=${DIRECTORY}/db/socket
CONFIG=${DIRECTORY}/${NODE_CONFIG}-config.json
KES=${DIRECTORY}/kes.skey
VRF=${DIRECTORY}/vrf.skey
CERT=${DIRECTORY}/node.cert
cardano-node run --topology ${TOPOLOGY} --database-path ${DB_PATH} --socket-path ${SOCKET_PATH} --host-addr ${HOSTADDR} --port ${PORT} --config ${CONFIG} --shelley-kes-key ${KES} --shelley-vrf-key ${VRF} --shelley-operational-certificate ${CERT}
EOF
what is the content of the startBlockProducingNode.sh?
DIRECTORY=/home/xxx/cardano-my-node
PORT=6000
HOSTADDR=0.0.0.0
TOPOLOGY={DIRECTORY}/mainnet-topology.json
DB_PATH={DIRECTORY}/db
SOCKET_PATH={DIRECTORY}/db/socket
CONFIG={DIRECTORY}/mainnet-config.json
KES={DIRECTORY}/kes.skey
VRF={DIRECTORY}/vrf.skey
CERT=${DIRECTORY}/node.cert
cardano-node run --topology {TOPOLOGY} --database-path {DB_PATH} --socket-path {SOCKET_PATH} --host-addr {HOSTADDR} --port {PORT} --config {CONFIG} --shelley-kes-key ${KES} --shelley>
ok - the script does not contain env variable - just local variables - but the syntax of variable substitution is ${VARIABLE_NAME}
or $VARIABLE
and not {VARIABLE}
but maybe I am wrong…
I’m not following what I should do.
for example the TOPOLOGY variable should be defined in this way:
TOPOLOGY=${DIRECTORY}/mainnet-topology.json
The $
character is missing from a lot of places
This is how my start Producernode.sh looks

im not sure why it copied that way