| 1 | #!/sbin/openrc-run |
| 2 | # This file is part of inetutils-syslogd |
| 3 | # Created for Alpine Linux by Stuart Cardall <[email protected]> |
| 4 | # Distributed under the terms of the GNU General Public License v2 |
| 5 | |
| 6 | name=syslogd |
| 7 | config_file="/etc/syslog.conf" |
| 8 | pid_file=/var/run/syslog.pid |
| 9 | command=/sbin/$name |
| 10 | command_args=${SYSLOGD_OPTS} |
| 11 | extra_started_commands="reload" |
| 12 | |
| 13 | depend() { |
| 14 | need clock hostname localmount |
| 15 | provide logger |
| 16 | } |
| 17 | |
| 18 | check_config() { |
| 19 | [ -f "$config_file" ] || error "$config_file is missing" |
| 20 | } |
| 21 | |
| 22 | start_pre() { |
| 23 | check_config || return 1 |
| 24 | } |
| 25 | |
| 26 | reload() { |
| 27 | if [ ! -f "${pid_file}" ]; then |
| 28 | eerror "inetutils-$name is not running" |
| 29 | return 1 |
| 30 | fi |
| 31 | |
| 32 | ebegin "Re-opening intetutils-$name log files" |
| 33 | pkill -HUP -f "$command $command_args" |
| 34 | eend $? |
| 35 | } |
| 36 | |