blob: 2e4a1f47db13766d5f690b89809587eb1720acf7 [file] [log] [blame]
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
description "systemd-journald"
author "chromeos-core-services@google.com"
start on started dbus
expect fork
respawn
pre-start script
mkdir -m 0775 -p /run/systemd/journal
mkdir -p /run/systemd/journal/pids
chown -R syslog /run/systemd/journal
mkdir -p /run/log
chown syslog /run/log
ln -sf /run/systemd/journal/dev-log /dev/log
end script
#TODO(b/181169861): miniOs: Run minijail with pivot root and bind mount
exec minijail0 -T static -u syslog -g syslog \
-i -l --uts -f /run/systemd-journald.pid \
-v /usr/lib/systemd/systemd-journald
post-start script
# The timeout is high, but it should never be hit unless there's a serious
# problem, in which case we want to fall over anyways. We can't set it too
# low because we also run in slow environments like VMs.
net_poll_tool --timeout=60 --unix_socket=/run/systemd/journal/socket
pkill -SIGUSR1 --pidfile /run/systemd-journald.pid
end script
post-stop script
rm /run/systemd-journald.pid || true
end script