mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Use Busybox syslogd
This commit is contained in:
parent
193a98bb7f
commit
5f8f4ee4fd
3 changed files with 84 additions and 1 deletions
59
syslogd/Makefile
Normal file
59
syslogd/Makefile
Normal file
|
@ -0,0 +1,59 @@
|
|||
#
|
||||
# Copyright (C) 2023 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3 or later.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=syslogd
|
||||
PKG_VERSION:=1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/syslogd
|
||||
SECTION:=utilities
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Busybox syslogd OpenWRT init script
|
||||
DEPENDS:=+busybox
|
||||
KCONFIG:=\
|
||||
CONFIG_BUSYBOX_CUSTOM=y \
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_SYSLOG=y \
|
||||
CONFIG_BUSYBOX_CONFIG_LOGREAD=y \
|
||||
CONFIG_BUSYBOX_CONFIG_SYSLOGD=y \
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_SYSLOGD_CFG=y \
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_SYSLOGD_PRECISE_TIMESTAMPS=y \
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=256 \
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_IPC_SYSLOG=y \
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=64
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Package/syslogd/description
|
||||
Busybox syslogd package with init script for OpenWRT
|
||||
endef
|
||||
|
||||
define Package/syslogd/conffiles
|
||||
/etc/syslog.conf
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/syslogd/install
|
||||
$(INSTALL_DIR) $(1)
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,syslogd))
|
24
syslogd/files/etc/init.d/syslogd
Executable file
24
syslogd/files/etc/init.d/syslogd
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=11
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=syslogd
|
||||
PROG=/sbin/syslogd
|
||||
|
||||
start_service() {
|
||||
local log_size=$(uci -q get system.@system[0].log_size)
|
||||
local log_ip=$(uci -q get system.@system[0].log_ip)
|
||||
local log_port=$(uci -q get system.@system[0].log_port || echo '514')
|
||||
local log_file=$(uci -q get system.@system[0].log_file)
|
||||
local conloglevel=$(uci -q get system.@system[0].conloglevel)
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG" -n ${log_size:+-C"$log_size"} ${log_ip:+-R"$log_ip":"$log_port"} ${log_file:+-O "$log_file"} ${conloglevel:+-l "$conloglevel"}
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
procd_send_signal syslogd
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue