Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#4077 - ERROR level instead of INFO level in syslog messages from BusyBox components (crond) #9059

Open
openwrt-bot opened this issue Oct 10, 2021 · 1 comment
Labels

Comments

@openwrt-bot
Copy link

salexa74:

The [[https://git.busybox.net/busybox/tree/Config.in?h=1_31_0#n342|FEATURE_SYSLOG_INFO]] option appeared in BusyBox v. 1.31.0. But in OpenWRT this option is disabled by default: [[https://github.com/openwrt/openwrt/blob/master/package/utils/busybox/Config-defaults.in#L82-L84|master]], [[https://github.com/openwrt/openwrt/blob/openwrt-21.02/package/utils/busybox/Config-defaults.in#L82-L84|openwrt-21.02 branch]] (in order to save about 200 bytes?!). As a result, BusyBox components (for example, crond) in syslog write all messages with the ERROR level instead of INFO level, which misleads users:
Sun Oct 10 19:07:35 2021 cron.err crond[8795]: crond (busybox 1.31.0) started, log level 5
Sun Oct 10 19:08:00 2021 cron.err crond[8795]: USER root pid 9035 cmd /usr/bin/test.sh
Sun Oct 10 19:08:00 2021 cron.err crond[8795]: USER root pid 9036 cmd echo "hello"

@openwrt-bot
Copy link
Author

chder:

I noticed this as well when it confused me into thinking the cron was somehow failing to run.

I have openwrt forwarding to a syslog server and the logs viewer over there is showing "Severity: Error"

Taking a peek at logread on the router itself I get:

Tue Feb 1 21:45:00 2022 cron.err crond[1636]: USER root pid 22437 cmd flock -n /var/lock/persist.lock /etc/package-list/persist.sh
Tue Feb 1 21:50:00 2022 cron.err crond[1636]: USER root pid 22515 cmd flock -n /var/lock/persist.lock /etc/package-list/persist.sh
Tue Feb 1 21:55:00 2022 cron.err crond[1636]: USER root pid 22586 cmd flock -n /var/lock/persist.lock /etc/package-list/persist.sh
Tue Feb 1 22:00:00 2022 cron.err crond[1636]: USER root pid 22664 cmd flock -n /var/lock/persist.lock /etc/package-list/persist.sh

According to ps crond is running with:

/usr/sbin/crond -f -c /etc/crontabs -l 8

root@ROUTER:~# crond --help + crond --help BusyBox v1.33.2 (2022-01-23 10:30:30 UTC) multi-call binary.

Usage: crond [-fbS] [-l N] [-L LOGFILE] [-c DIR]

    -f      Foreground
    -b      Background (default)
    -S      Log to syslog (default)
    -l N    Set log level. Most verbose 0, default 8
    -L FILE Log to FILE
    -c DIR  Cron dir. Default:/etc/crontabs

Badintral added a commit to Badintral/openwrt that referenced this issue Nov 8, 2023
Solve FS#4077 (Github issue openwrt#9059) by allowing users to also log at INFO level instead of only ERROR level.

Signed-off-by: Badintral <79549469+Badintral@users.noreply.github.com>
Badintral added a commit to Badintral/openwrt that referenced this issue Nov 12, 2023
Solve FS#4077 (Github issue openwrt#9059) by allowing users to also log at INFO level instead of only ERROR level.

Signed-off-by: Badintral <79549469+Badintral@users.noreply.github.com>
Badintral added a commit to Badintral/openwrt that referenced this issue Nov 14, 2023
Solve FS#4077 (Github issue openwrt#9059) by allowing users to also log at INFO level instead of only ERROR level.

Signed-off-by: Badintral <79549469+Badintral@users.noreply.github.com>
Badintral added a commit to Badintral/openwrt that referenced this issue Nov 17, 2023
Solve FS#4077 (Github issue openwrt#9059) by allowing users to also log at INFO level instead of only ERROR level.

Signed-off-by: Badintral <79549469+Badintral@users.noreply.github.com>
Badintral added a commit to Badintral/openwrt that referenced this issue Nov 19, 2023
Solve FS#4077 (Github issue openwrt#9059) by allowing users to also log at INFO level instead of only ERROR level.

Signed-off-by: Badintral <79549469+Badintral@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant