From b0164caa0b4a9bbcbf7c48162d3efa54d3dad77f Mon Sep 17 00:00:00 2001 From: rdlrt <3169068+rdlrt@users.noreply.github.com> Date: Wed, 31 Jul 2024 11:51:28 +1000 Subject: [PATCH] Remove StandardOutput/StandardError (currently pointing to deprecated syslog) from systemd definitions, closes #1792 --- docs/Build/node-cli.md | 2 +- docs/Scripts/blockperf.md | 2 +- docs/Scripts/cncli.md | 2 +- docs/Scripts/logmonitor.md | 2 +- scripts/cnode-helper-scripts/blockPerf.sh | 2 -- scripts/cnode-helper-scripts/cncli.sh | 2 -- scripts/cnode-helper-scripts/dbsync.sh | 2 -- .../cnode-helper-scripts/deploy-as-systemd.sh | 18 ------------------ scripts/cnode-helper-scripts/mithril-signer.sh | 2 -- scripts/cnode-helper-scripts/ogmios.sh | 2 -- scripts/cnode-helper-scripts/submitapi.sh | 2 -- scripts/grest-helper-scripts/setup-grest.sh | 4 ---- 12 files changed, 4 insertions(+), 38 deletions(-) diff --git a/docs/Build/node-cli.md b/docs/Build/node-cli.md index 7f91c55b1..f7b9ec559 100644 --- a/docs/Build/node-cli.md +++ b/docs/Build/node-cli.md @@ -247,7 +247,7 @@ sudo systemctl status cnode-submit-api.service ``` !!! important - In case you see the node exit unsuccessfully upon checking status, please verify you've followed the transition process correctly as documented below, and that you do not have another instance of node already running. It would help to check your system logs (`/var/log/syslog` for debian-based and `/var/log/messages` for Red Hat/CentOS/Fedora systems, you can also check `journalctl -f -u ` to examine startup attempt for services) for any errors while starting node. + In case you see the node exit unsuccessfully upon checking status, please verify you've followed the transition process correctly as documented below, and that you do not have another instance of node already running. It would help to check your system logs, you can also check `journalctl -f -u cnode` to examine startup attempt for services, and scroll up until you see output for node startup attempt) for any errors while starting node. You can use [gLiveView](../Scripts/gliveview.md) to monitor your node that was started as a systemd service. diff --git a/docs/Scripts/blockperf.md b/docs/Scripts/blockperf.md index 30d348792..ad5eccc7f 100644 --- a/docs/Scripts/blockperf.md +++ b/docs/Scripts/blockperf.md @@ -28,7 +28,7 @@ The script is best run as a background process. This can be accomplished in many #### Run as service Use the `deploy-as-systemd.sh` script to create a systemd unit file. -In this setup the script is started in "service" mode. Error/Warn level log output is handled by syslog and end up in the systems standard syslog file, normally `/var/log/syslog`. `journalctl -f -u cnode-tu-blockperf.service` can be used to check service output (follow mode). +In this setup the script is started in "service" mode. Error/Warn level log output is handled by journald. `journalctl -f -u cnode-tu-blockperf.service` can be used to check service output (follow mode). Outside the cnTools environment call `blockPerf.sh -d` to install it as a systemd service. diff --git a/docs/Scripts/cncli.md b/docs/Scripts/cncli.md index eaaf1059e..b8e3e03a6 100644 --- a/docs/Scripts/cncli.md +++ b/docs/Scripts/cncli.md @@ -50,7 +50,7 @@ You can override the values in the script at the User Variables section shown be Services are controlled by `sudo systemctl ` All services are configured as child services to `cnode.service` and as such, when an action is taken against this service it's replicated to all child services. E.g running `sudo systemctl start cnode.service` will also start all child services. -Log output is handled by syslog and end up in the systems standard syslog file, normally `/var/log/syslog`. `journalctl -f -u ` can be used to check service output (follow mode). Other logging configurations are not covered here. +Log output is handled by journald. `journalctl -f -u ` can be used to check service output (follow mode). Other logging configurations are not covered here. Recommended workflow to get started with CNCLI blocklog. diff --git a/docs/Scripts/logmonitor.md b/docs/Scripts/logmonitor.md index 2c39aada5..dacc3ff64 100644 --- a/docs/Scripts/logmonitor.md +++ b/docs/Scripts/logmonitor.md @@ -12,7 +12,7 @@ For optimal coverage, it's best run together with [CNCLI](../Scripts/cncli.md) s The script is best run as a background process. This can be accomplished in many ways but the preferred method is to run it as a systemd service. A terminal multiplexer like tmux or screen could also be used but not covered here. Use the `deploy-as-systemd.sh` script to create a systemd unit file (deployed together with [CNCLI](../Scripts/cncli.md)). -Log output is handled by syslog and end up in the systems standard syslog file, normally `/var/log/syslog`. `journalctl -f -u cnode-logmonitor.service` can be used to check service output (follow mode). Other logging configurations are not covered here. +Log output is handled by journald. `journalctl -f -u cnode-logmonitor.service` can be used to check service output (follow mode). Other logging configurations are not covered here. ##### View Blocklog Best viewed in CNTools or gLiveView. See [CNCLI](../Scripts/cncli.md) for example output. diff --git a/scripts/cnode-helper-scripts/blockPerf.sh b/scripts/cnode-helper-scripts/blockPerf.sh index 25b63a592..3508b546c 100755 --- a/scripts/cnode-helper-scripts/blockPerf.sh +++ b/scripts/cnode-helper-scripts/blockPerf.sh @@ -43,8 +43,6 @@ User=$USER WorkingDirectory=${CNODE_HOME}/scripts ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/blockPerf.sh -s\" KillSignal=SIGINT -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${CNODE_VNAME}-tu-blockperf TimeoutStopSec=5 KillMode=mixed diff --git a/scripts/cnode-helper-scripts/cncli.sh b/scripts/cnode-helper-scripts/cncli.sh index 7db963483..76e30ef6d 100755 --- a/scripts/cnode-helper-scripts/cncli.sh +++ b/scripts/cnode-helper-scripts/cncli.sh @@ -609,8 +609,6 @@ WorkingDirectory=${CNODE_HOME}/scripts ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/cncli.sh metrics serve\" KillSignal=SIGINT SuccessExitStatus=143 -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${CNODE_VNAME}_cncli_exporter TimeoutStopSec=5 KillMode=mixed diff --git a/scripts/cnode-helper-scripts/dbsync.sh b/scripts/cnode-helper-scripts/dbsync.sh index d3e9e057a..1317fcfaa 100755 --- a/scripts/cnode-helper-scripts/dbsync.sh +++ b/scripts/cnode-helper-scripts/dbsync.sh @@ -94,8 +94,6 @@ deploy_systemd() { WorkingDirectory=${CNODE_HOME}/scripts ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/dbsync.sh\" KillSignal=SIGINT - StandardOutput=syslog - StandardError=syslog SyslogIdentifier=${CNODE_VNAME}-dbsync TimeoutStopSec=5 KillMode=mixed diff --git a/scripts/cnode-helper-scripts/deploy-as-systemd.sh b/scripts/cnode-helper-scripts/deploy-as-systemd.sh index bd23d74c4..36ab9dd95 100755 --- a/scripts/cnode-helper-scripts/deploy-as-systemd.sh +++ b/scripts/cnode-helper-scripts/deploy-as-systemd.sh @@ -71,8 +71,6 @@ Type=oneshot User=$USER WorkingDirectory=${CNODE_HOME}/scripts ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/topologyUpdater.sh -f\" -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${vname}-tu-push EOF" sudo bash -c "cat << 'EOF' > /etc/systemd/system/${vname}-tu-push.timer @@ -103,8 +101,6 @@ User=$USER WorkingDirectory=${CNODE_HOME}/scripts ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/topologyUpdater.sh -p\" ExecStartPost=/bin/sleep 5 -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${vname}-tu-fetch [Install] @@ -118,8 +114,6 @@ Description=Cardano Node - Topology Updater - restart ${vname}.service for topol Type=oneshot WorkingDirectory=${CNODE_HOME}/scripts ExecStart=/bin/bash -c \"/bin/systemctl try-restart ${vname}.service 2>/dev/null || /usr/bin/systemctl try-restart ${vname}.service 2>/dev/null\" -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${vname}-tu-restart EOF" sudo bash -c "cat << 'EOF' > /etc/systemd/system/${vname}-tu-restart.timer @@ -185,8 +179,6 @@ ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/cncli.sh sync\" ExecStop=/bin/bash -l -c \"exec kill -2 \$(ps -ef | grep [c]ncli.sync.*.${CNODE_HOME}/ | tr -s ' ' | cut -d ' ' -f2) &>/dev/null\" KillSignal=SIGINT SuccessExitStatus=143 -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${vname}-cncli-sync TimeoutStopSec=5 KillMode=mixed @@ -207,8 +199,6 @@ User=$USER WorkingDirectory=${CNODE_HOME}/scripts ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/cncli.sh leaderlog\" SuccessExitStatus=143 -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${vname}-cncli-leaderlog TimeoutStopSec=5 KillMode=mixed @@ -231,8 +221,6 @@ WorkingDirectory=${CNODE_HOME}/scripts ExecStartPre=/bin/sleep 5 ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/cncli.sh validate\" SuccessExitStatus=143 -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${vname}-cncli-validate TimeoutStopSec=5 KillMode=mixed @@ -264,8 +252,6 @@ ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/cncli.sh ptsendslots\" ExecStop=/bin/bash -l -c \"exec kill -2 \$(ps -ef | grep [c]ncli.sendslots.*.${vname}-pooltool.json | tr -s ' ' | cut -d ' ' -f2) &>/dev/null\" KillSignal=SIGINT SuccessExitStatus=143 -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${vname}-cncli-ptsendslots TimeoutStopSec=5 KillMode=mixed @@ -306,8 +292,6 @@ ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/logMonitor.sh\" ExecStop=/bin/bash -l -c \"exec kill -2 \$(ps -ef | grep -m1 ${CNODE_HOME}/scripts/logMonitor.sh | tr -s ' ' | cut -d ' ' -f2) &>/dev/null\" KillSignal=SIGINT SuccessExitStatus=143 -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${vname}-logmonitor TimeoutStopSec=5 KillMode=mixed @@ -373,8 +357,6 @@ ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/cncli.sh ptsendtip\" ExecStop=/bin/bash -l -c \"exec kill -2 \$(ps -ef | grep [c]ncli.sendtip.*.${vname}-pooltool.json | tr -s ' ' | cut -d ' ' -f2) &>/dev/null\" KillSignal=SIGINT SuccessExitStatus=143 -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=${vname}-cncli-ptsendtip TimeoutStopSec=5 KillMode=mixed diff --git a/scripts/cnode-helper-scripts/mithril-signer.sh b/scripts/cnode-helper-scripts/mithril-signer.sh index 9329bf6e1..f8f24cb0a 100755 --- a/scripts/cnode-helper-scripts/mithril-signer.sh +++ b/scripts/cnode-helper-scripts/mithril-signer.sh @@ -68,8 +68,6 @@ deploy_systemd() { ExecStart=/bin/bash -l -c \"exec ${HOME}/.local/bin/$(basename "${0::-3}") -vv\" KillSignal=SIGINT SuccessExitStatus=143 - StandardOutput=syslog - StandardError=syslog SyslogIdentifier=${CNODE_VNAME}-$(basename "${0::-3}") TimeoutStopSec=5 KillMode=mixed diff --git a/scripts/cnode-helper-scripts/ogmios.sh b/scripts/cnode-helper-scripts/ogmios.sh index 97fe7bab4..ba92dcfb2 100755 --- a/scripts/cnode-helper-scripts/ogmios.sh +++ b/scripts/cnode-helper-scripts/ogmios.sh @@ -82,8 +82,6 @@ deploy_systemd() { ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/ogmios.sh \" KillSignal=SIGINT SuccessExitStatus=143 - StandardOutput=syslog - StandardError=syslog SyslogIdentifier=${CNODE_VNAME}-ogmios TimeoutStopSec=5 KillMode=mixed diff --git a/scripts/cnode-helper-scripts/submitapi.sh b/scripts/cnode-helper-scripts/submitapi.sh index 80347e8f3..33341e6de 100755 --- a/scripts/cnode-helper-scripts/submitapi.sh +++ b/scripts/cnode-helper-scripts/submitapi.sh @@ -65,8 +65,6 @@ deploy_systemd() { ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/submitapi.sh\" KillSignal=SIGINT SuccessExitStatus=143 - StandardOutput=syslog - StandardError=syslog SyslogIdentifier=${CNODE_VNAME}-submit-api TimeoutStopSec=5 KillMode=mixed diff --git a/scripts/grest-helper-scripts/setup-grest.sh b/scripts/grest-helper-scripts/setup-grest.sh index 3372923cf..3e3e1573e 100755 --- a/scripts/grest-helper-scripts/setup-grest.sh +++ b/scripts/grest-helper-scripts/setup-grest.sh @@ -476,8 +476,6 @@ SGVERSION=1.2.0a LimitNOFILE=1048576 ExecStart=/home/authenticator/.local/bin/postgrest ${CNODE_HOME}/priv/grest.conf ExecReload=/bin/kill -SIGUSR1 \\\$MAINPID - StandardOutput=syslog - StandardError=syslog SyslogIdentifier=postgrest [Install] @@ -520,8 +518,6 @@ SGVERSION=1.2.0a ExecStart=/bin/bash -l -c \"exec ${CNODE_HOME}/scripts/grest-exporter.sh\" KillSignal=SIGINT SuccessExitStatus=143 - StandardOutput=syslog - StandardError=syslog SyslogIdentifier=grest_exporter TimeoutStopSec=5 KillMode=mixed