OLD | NEW |
1 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 # | 4 # |
5 | 5 |
6 description "Syslog daemon" | 6 description "Syslog daemon" |
7 author "chromium-os-dev@chromium.org" | 7 author "chromium-os-dev@chromium.org" |
8 | 8 |
9 start on runlevel 2 | 9 start on runlevel 2 |
10 stop on starting halt or starting reboot | 10 stop on starting halt or starting reboot |
11 | 11 |
12 pre-start script | 12 pre-start script |
| 13 SYSLOG_RUN="/var/run/rsyslog" |
| 14 KMSG_PIPE="${SYSLOG_RUN}/kmsg" |
13 | 15 |
14 SYSLOG_RUN="/var/run/rsyslog" | 16 if [ ! -d "${SYSLOG_RUN}" ]; then |
15 KMSG_PIPE="${SYSLOG_RUN}/kmsg" | 17 install --owner=syslog --group=syslog -d "${SYSLOG_RUN}" |
16 | 18 fi |
17 mkdir -p "$SYSLOG_RUN" | 19 if [ ! -p "${KMSG_PIPE}" ]; then |
18 test -p "$KMSG_PIPE" || mkfifo -m 600 "$KMSG_PIPE" | 20 mkfifo -m 600 "${KMSG_PIPE}" |
19 chown -R syslog:syslog "$SYSLOG_RUN" | 21 chown syslog:syslog "${KMSG_PIPE}" |
20 | 22 fi |
21 end script | 23 end script |
22 | 24 |
23 respawn | 25 respawn |
24 expect fork | 26 expect fork |
25 exec /usr/sbin/rsyslogd -c4 -f /etc/rsyslog.chromeos | 27 exec rsyslogd -c4 -f /etc/rsyslog.chromeos |
OLD | NEW |