diff --git a/scripts/packaging/octez/debian/octez-baker.install b/scripts/packaging/octez/debian/octez-baker.install index b19e135f8e795ebe0a5debe32f4498d6fe3d7a92..1af12c8c04f4ed6cdfdc9dafe813d1fb7ce097c8 100644 --- a/scripts/packaging/octez/debian/octez-baker.install +++ b/scripts/packaging/octez/debian/octez-baker.install @@ -1,5 +1,6 @@ binaries/octez-baker-P* /usr/bin/ binaries/octez-baker /usr/bin/ binaries/octez-accuser-P* /usr/bin/ +binaries/octez-accuser /usr/bin/ scripts/wait-for-node-up.sh /usr/share/octez-baker/ scripts/systemd-octez-bakers.sh /usr/share/octez-baker/ diff --git a/scripts/packaging/octez/debian/octez-baker.octez-agnostic-accuser.service b/scripts/packaging/octez/debian/octez-baker.octez-agnostic-accuser.service new file mode 100644 index 0000000000000000000000000000000000000000..488353f93ccc07375373603361e6285af6d22bb2 --- /dev/null +++ b/scripts/packaging/octez/debian/octez-baker.octez-agnostic-accuser.service @@ -0,0 +1,21 @@ +[Unit] +Description=Octez accuser service +Documentation=https://octez.tezos.com/docs/ +After=network.target + +[Service] +EnvironmentFile=-/etc/default/octez-baker +EnvironmentFile=-/etc/default/octez-accuser +WorkingDirectory=~ +Restart=on-failure +User=tezos +ExecStart=/bin/sh -c "/usr/bin/octez-accuser run $RUNTIME_OPTS" + +ExecStartPre=+touch /var/log/tezos/accuser.log +ExecStartPre=+chown tezos:tezos /var/log/tezos/accuser.log + +StandardOutput=append:/var/log/tezos/accuser.log +StandardError=inherit + +[Install] +WantedBy=multi-user.target diff --git a/scripts/packaging/octez/debian/rules b/scripts/packaging/octez/debian/rules index 7476841c1f5817158de4e74563c761bb8717a0f1..7b52f11bc9939f317c6b3afe244dec93a5039d91 100755 --- a/scripts/packaging/octez/debian/rules +++ b/scripts/packaging/octez/debian/rules @@ -37,6 +37,7 @@ override_dh_installsystemd: dh_installsystemd -p octez-baker --no-start dh_installsystemd -p octez-baker --no-enable --no-start --name octez-accuser@ dh_installsystemd -p octez-baker --no-enable --no-start --name octez-agnostic-baker + dh_installsystemd -p octez-baker --no-enable --no-start --name octez-agnostic-accuser override_dh_installlogrotate: dh_installlogrotate --package=octez-node diff --git a/scripts/packaging/octez/rpm/SPECS/octez-baker.spec b/scripts/packaging/octez/rpm/SPECS/octez-baker.spec index 5c2f52ce945ea49d6ff445e0372e7a251592e03c..0f55f65999bf3ed32f684864db27654e8dc5495c 100644 --- a/scripts/packaging/octez/rpm/SPECS/octez-baker.spec +++ b/scripts/packaging/octez/rpm/SPECS/octez-baker.spec @@ -22,6 +22,7 @@ mkdir -p %{buildroot}/usr/share/octez-baker install -m 0755 $HOME/rpmbuild/SPECS/binaries/octez-baker-P* %{buildroot}/usr/bin/ install -m 0755 $HOME/rpmbuild/SPECS/binaries/octez-baker %{buildroot}/usr/bin/ install -m 0755 $HOME/rpmbuild/SPECS/binaries/octez-accuser-P* %{buildroot}/usr/bin/ +install -m 0755 $HOME/rpmbuild/SPECS/binaries/octez-accuser %{buildroot}/usr/bin/ install -m 0755 $HOME/rpmbuild/SPECS/scripts/wait-for-node-up.sh %{buildroot}/usr/share/octez-baker/ install -m 0755 $HOME/rpmbuild/SPECS/scripts/systemd-octez-bakers.sh %{buildroot}/usr/share/octez-baker/ install -D -m 644 $HOME/rpmbuild/SPECS/manpages/octez-baker.1 %{buildroot}%{_mandir}/man1/octez-baker.1 @@ -32,12 +33,14 @@ install -D -m 644 $HOME/rpmbuild/SPECS/octez-baker.octez-accuser@.service %{buil install -D -m 644 $HOME/rpmbuild/SPECS/octez-baker@.service %{buildroot}/usr/lib/systemd/system/octez-baker@.service install -D -m 644 $HOME/rpmbuild/SPECS/octez-baker.service %{buildroot}/usr/lib/systemd/system/octez-baker.service install -D -m 644 $HOME/rpmbuild/SPECS/octez-baker.octez-agnostic-baker.service %{buildroot}/usr/lib/systemd/system/octez-baker.octez-agnostic-baker.service +install -D -m 644 $HOME/rpmbuild/SPECS/octez-baker.octez-agnostic-accuser.service %{buildroot}/usr/lib/systemd/system/octez-baker.octez-agnostic-accuser.service install -D -m 644 $HOME/rpmbuild/SPECS/octez-baker.octez-accuser.default %{buildroot}/etc/default/octez-accuser install -D -m 644 $HOME/rpmbuild/SPECS/octez-baker.default %{buildroot}/etc/default/octez-baker %files /usr/bin/octez-baker-* /usr/bin/octez-baker /usr/bin/octez-accuser-* +/usr/bin/octez-accuser /usr/share/octez-baker/wait-for-node-up.sh /usr/share/octez-baker/systemd-octez-bakers.sh %{_mandir}/man1/octez-baker.1* @@ -46,6 +49,7 @@ install -D -m 644 $HOME/rpmbuild/SPECS/octez-baker.default %{buildroot}/etc/def /usr/lib/systemd/system/octez-baker@.service /usr/lib/systemd/system/octez-baker.service /usr/lib/systemd/system/octez-baker.octez-agnostic-baker.service +/usr/lib/systemd/system/octez-baker.octez-agnostic-accuser.service /etc/default/octez-accuser /etc/default/octez-baker %postun diff --git a/scripts/packaging/octez/scripts/systemd-octez-bakers.sh b/scripts/packaging/octez/scripts/systemd-octez-bakers.sh index e3ac2e789497734f5b610eadddc148f405904d3b..b0fafcb8076d95d0f40885908c42562deb761e66 100755 --- a/scripts/packaging/octez/scripts/systemd-octez-bakers.sh +++ b/scripts/packaging/octez/scripts/systemd-octez-bakers.sh @@ -22,20 +22,23 @@ for file in /usr/bin/octez-baker-P*; do if [ "$AGNOSTIC_BAKER" = "true" ]; then systemctl enable "octez-agnostic-baker" systemctl start "octez-agnostic-baker" + systemctl enable "octez-agnostic-accuser" + systemctl start "octez-agnostic-accuser" else systemctl enable "octez-baker@$proto" systemctl start "octez-baker@$proto" + systemctl enable "octez-accuser@$proto" + systemctl start "octez-accuser@$proto" fi - systemctl enable "octez-accuser@$proto" - systemctl start "octez-accuser@$proto" elif [ "$1" = "stop" ]; then if [ "$AGNOSTIC_BAKER" = "true" ]; then systemctl stop "octez-agnostic-baker" + systemctl stop "octez-agnostic-accuser" else systemctl stop "octez-baker@$proto" + systemctl stop "octez-accuser@$proto" fi - systemctl stop "octez-accuser@$proto" if grep -q "\-\-dal-node" /etc/default/octez-baker; then systemctl stop octez-dal-node fi diff --git a/scripts/packaging/tests/tests-systemd-common.inc.sh b/scripts/packaging/tests/tests-systemd-common.inc.sh index 2eae8027c707ea09fa7e5a4391bff80faccdf2ad..cf926214296ed65ddce999d067aacb31cfcb3b0b 100644 --- a/scripts/packaging/tests/tests-systemd-common.inc.sh +++ b/scripts/packaging/tests/tests-systemd-common.inc.sh @@ -50,10 +50,18 @@ else done fi -for logfile in /var/log/tezos/accuser-P*.log; do - proto=$(basename "$logfile" | sed -E 's/accuser-(P[^.]+).log/\1/') - systemctl status "octez-accuser@$proto.service" - echo "Log: $logfile" +if [ "${AGNOSTIC_BAKER:-}" = "true" ]; then + systemctl status octez-agnostic-baker.service + + echo "Log: /var/log/tezos/accuser.log" echo "-----------------------" - tail "$logfile" -done + tail /var/log/tezos/accuser.log +else + for logfile in /var/log/tezos/accuser-P*.log; do + proto=$(basename "$logfile" | sed -E 's/accuser-(P[^.]+).log/\1/') + systemctl status "octez-accuser@$proto.service" + echo "Log: $logfile" + echo "-----------------------" + tail "$logfile" + done +fi