blob: 81f13ad271c4bc1f0802ebba253694d99702a022 [file] [log] [blame]
# Copyright (c) 2012 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 "Syslog daemon"
author "chromium-os-dev@chromium.org"
start on started journald
stop on stopping journald
expect fork
respawn
pre-start script
setup() {
touch "$1"
chown syslog "$1"
}
setup /var/log/messages
setup /var/log/net.log
setup /var/log/secure
setup /var/log/boot.log
setup /var/log/tlsdate.log
setup /var/log/authpolicy.log
setup /var/log/arc.log
setup /var/log/upstart.log
mkdir -p /var/lib/timezone
end script
# We don't use --mount-dev because of the way the /dev/log unix socket works.
# See https://crbug.com/764455#c6 for details.
#
# rsyslogd creates it's unix domain socket at /run/systemd/journal/syslog.
# Journald forwards messages to that address.
#
# We don't use a pid namespace because that breaks syslog's ability to log the
# remote pid. Otherwise the logs would look like (where [0] is the pid):
# INFO sshd[0]: ...
exec /sbin/minijail0 -l --uts -i -v -e -t -P /mnt/empty -T static \
-b / -b /dev,,1 -b /proc \
-k 'tmpfs,/run,tmpfs,MS_NOSUID|MS_NODEV|MS_NOEXEC' \
-b /run/systemd/journal,,1 \
-k 'tmpfs,/var,tmpfs,MS_NOSUID|MS_NODEV|MS_NOEXEC' \
-b /var/log,,1 -b /var/lib/timezone \
/usr/sbin/rsyslogd -n -f /etc/rsyslog.chromeos -i /tmp/rsyslogd.pid