Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

**scribe** is a **syslog-ng** and **logrotate** installer for ASUS routers running **Asuswrt-Merlin**

## v3.2.6
### Updated on 2025-Dec-22
## v3.2.7
### Updated on 2026-Jan-03

## Getting Started

Expand Down
38 changes: 22 additions & 16 deletions init.d/rc.func.syslog-ng
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh -
#
# NB: rc.func only runs PRECMD on "start"
# Last Modified: 2025-Nov-23
# VERSION="3.1.2"
# Last Modified: 2026-Jan-02
# VERSION="3.1.3"
#-------------------------------------------

## Run the F/W built-in native commands ##
Expand All @@ -14,9 +14,10 @@ pidofCmd="$(which -a pidof | grep -v '^/opt/')"
loggerCmd="$(which -a logger | grep -v '^/opt/')"
logTagStr="Scribe:kill_logger[$$]"
logPrioNum="-p 4"
prevSysLog_Loc=""

##----------------------------------------##
## Modified by Martinski W. [2025-Nov-21] ##
## Modified by Martinski W. [2026-Jan-02] ##
##----------------------------------------##
kill_logger()
{
Expand All @@ -31,9 +32,10 @@ kill_logger()
then postLogMsgs=true
else postLogMsgs=false
fi
prevSysLog_Loc="$syslog_loc"

# figure out where syslogd expects log file to live #
if [ -z "$syslog_loc" ] # don't look for config file if $syslog_loc is defined #
if [ -z "$syslog_loc" ] # do NOT look for config file if $syslog_loc is defined #
then
if [ -s "$script_conf" ] && $grepCmd -q "^SYSLOG_LOC=" "$script_conf"
then
Expand Down Expand Up @@ -63,6 +65,22 @@ kill_logger()

[ "$syslog_loc" = "$jffslog" ] && isjffs=true

# touch 'logrotate.status' if it doesn't exist so syslog-ng doesn't whine #
[ ! -f /var/lib/logrotate.status ] && touch /var/lib/logrotate.status

##----------------------------------------##
## Modified by Martinski W. [2025-Jun-16] ##
##----------------------------------------##
# Set correct permissions to avoid "world-readable" status #
chmod 600 /var/lib/logrotate.status

# export timezone if not already set #
[ -z "${TZ:+xSETx}" ] && export TZ="$(/bin/cat /etc/TZ)"

if [ "$prevSysLog_Loc" = "$syslog_loc" ] && ! "$postLogMsgs"
then return 0
fi

# kill any/all running klogd and/or syslogd #
count=30
klgk=false
Expand Down Expand Up @@ -116,18 +134,6 @@ kill_logger()
# create /opt/var/run/syslog-ng/ directory if it doesn't exist #
# not needed for older versions of syslog-ng, but doesn't hurt anything #
[ ! -d "/opt/var/run/syslog-ng" ] && mkdir "/opt/var/run/syslog-ng"

# touch 'logrotate.status' if it doesn't exist so syslog-ng doesn't whine #
[ ! -f /var/lib/logrotate.status ] && touch /var/lib/logrotate.status

##----------------------------------------##
## Modified by Martinski W. [2025-Jun-16] ##
##----------------------------------------##
# Set correct permissions to avoid "world-readable" status #
chmod 600 /var/lib/logrotate.status

# export timezone if not already set #
[ -z "${TZ:+xSETx}" ] && export TZ="$(/bin/cat /etc/TZ)"
}

PRECMD="kill_logger"
Expand Down
Loading