Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
curl -O https://woky.pyr8.io:8080/rnurse
chmod +x rnurse
# set the following environment variables as described above
export RDOCTOR_API_KEY="...YOUR_API_KEY..."
export RDOCTOR_SESSION_KEY="...YOUR_SESSION_KEY..."
export RCHAINRNODE_DATA_DIR="...YOUR_DATA_DIR..."
./rnurse

Now when you start RNode in another terminal (or as a system service) the log file found in $RCHAIN$RNODE_DATA_DIR you specified will be continuously uploaded to RDoctor. The script doesn't print anything in absence of failures.

...

Code Block
curl -O https://woky.pyr8.io:8080/rnurse >/usr/local/bin/rnurse
chmod +x /usr/local/bin/rnurse

mkdir /var/lib/rnurse
touch /var/lib/rnurse/env
chown 600 /var/lib/rnurse/env
cat >/var/lib/rnurse/env <EOF
export RDOCTOR_API_KEY="...YOUR_API_KEY..."
export RDOCTOR_SESSION_KEY="...YOUR_SESSION_KEY..."
export RCHAINRNODE_DATA_DIR="...YOUR_DATA_DIR..."
EOF

cat >/usr/local/bin/rnurse.wrapper <EOF
#!/bin/sh -e
source /var/lib/rnurse/env
exec /usr/local/bin/rnurse
EOF
chmod +x /usr/local/bin/rnurse.wrapper

cat >/etc/systemd/system/rnurse.service <EOF
[Unit]
After=network.target
[Service]
ExecStart=/usr/local/bin/rnurse
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable rnurse
systemctl start rnurse

RNurse is now running as system daemon and will start and monitor the log file in $RCHAIN$RNODE_DATA_DIR you specified on every boot. You may be thinking that systemd's EnvironmentFile could make this clearer and shorter. It could indeed if the systemd project was maintained by adults.

...