#!/bin/bash

set -eu
set -o pipefail

# Enable persistent logging for the systemd journal
mkdir -p /var/log/journal

# TODO(marios): temporarily +e for +bug/1564471 then check service restarted
set +e
systemctl restart systemd-journald.service
set -e
sleep 2
is_active=$(systemctl is-active systemd-journald)
if  [[ $is_active != "active" ]]; then
    set +x
    echo "*** Error *** Couldn't restart systemd-journald"
    exit 1
fi
