#!/bin/sh /etc/rc.common
#
# Copyright (C) 2026 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
#
# syslog-ng reads the remote log server settings (system.@system[0].log_ip,
# log_port, log_proto) through the omr_remote_log() confgen each time it
# loads its config, but its init has no service trigger: reload it when the
# system config is applied, as logd's init does for logd.
#
# The run itself is a one-shot procd instance: procd drops a service that
# registers no instance at all, and its reload triggers go with it.

START=51
USE_PROCD=1

start_service() {
	procd_open_instance
	procd_set_param command /bin/true
	procd_close_instance
}

reload_service() {
	pidof syslog-ng >/dev/null 2>&1 || return 0
	/etc/init.d/syslog-ng reload
}

service_triggers() {
	procd_add_reload_trigger "system"
}
