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

syslog-ng add logread alternative and minor config update #22763

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stokito
Copy link
Contributor

@stokito stokito commented Nov 27, 2023

Maintainer: @BKPepe @flyn-org
Compile tested: not complied, only config
Run tested: Turris Omnia

Description:
When started the syslog-ng prints the message:

WARNING: Your configuration file uses an obsoleted keyword, please update your configuration; keyword='stats_freq', change='Use the stats() block. E.g. stats(freq(1));', location='/etc/syslog-ng.conf:18:6'

The PR fixes it.

Also I added sample of destination for remote logs and made comments shorter.

UPD Added a fix for "syslog-ng: conflicts with logd package" #22451

Closes: #11535
Closes: #22451

See also https://gitlab.nic.cz/turris/os/packages/-/issues/307

The corresponding PR to the ubox loread here openwrt/openwrt#14775

UPD2
I also improved the logread script and made it more stable and shorter.
Dear @dibdot please review

@stokito stokito changed the title Syslog ng syslog-ng minor configuration update Nov 27, 2023
@BKPepe BKPepe self-assigned this Dec 5, 2023
@BKPepe
Copy link
Member

BKPepe commented Dec 5, 2023

Hello,

Thank you for your contribution. I briefly looked at it.

1st commit - yeah, it can go. 👍
2nd commit - I will need to check it more to be sure tha tit does not break anything else.

@stokito
Copy link
Contributor Author

stokito commented Dec 5, 2023

The second is disabled by default as previously. It will work only if uncomment the source.
You can use telnet 192.168.1.1 514 write anything, then Ctrl+K, quit to leave telnet.
Then on the router you will see the message that you sent in the /var/log/remote/ folder.

@BKPepe
Copy link
Member

BKPepe commented Dec 5, 2023

Yeah, I know also how to use telnet and get from it, heh. However, syslog-ng is at least from my point of view critical process on the router and once you don't have logs, you are completely blind. So, I wanted to test it on my end before merging it. Rather safe than regret.

@stokito stokito requested a review from BKPepe December 5, 2023 16:28
@stokito
Copy link
Contributor Author

stokito commented Dec 5, 2023

CC @bkil you a contrubutor to both the OpenWrt and syslog-ng so kindly review

@stokito
Copy link
Contributor Author

stokito commented Feb 4, 2024

@BKPepe friendly reminder on this

@stokito stokito changed the title syslog-ng minor configuration update syslog-ng add logread alternative and minor config update Mar 2, 2024
@dibdot
Copy link
Contributor

dibdot commented Mar 3, 2024

@stokito
Regardless of your logread changes, I don't understand why you have extended the already faltering pull request with this?
Anyway, I briefly tested your changes on a current Openwrt (not Turris) ... i.e. without "/var/log/messages".

  • printf to echo migration - why? "Simple" for whom?

  • No longer check for log file existence ends up with ...

root@blackhole:~# ./logread.sh 
tail: can't open '/var/log/messages': No such file or directory
tail: no files
  • An unknown option ends up with ...
root@blackhole:~# ./logread.sh -s
Illegal option -s
Unsupported option ?. See ./logread.sh -h
tail: can't open '/var/log/messages': No such file or directory
tail: no files

Please note: getopts transfers an unknown option in a question mark

  • A non number count as input ends up with ...
root@blackhole:~# ./logread.sh -l dsfds
tail: invalid number 'dsfds'

So it might be not the best idea to remove such checks from the original wrapper.

Bottom line: ATM, this looks quite unfinished.

@BKPepe
Copy link
Member

BKPepe commented Mar 3, 2024 via email

@stokito
Copy link
Contributor Author

stokito commented Mar 3, 2024

I removed last commits for the logread

@BKPepe
Copy link
Member

BKPepe commented Mar 5, 2024

Commit: 37d2d69 pushed to master, thanks!

The other two, I will look into it.

@stokito
Copy link
Contributor Author

stokito commented Mar 8, 2024

I fixed the merge conflict, dropped one commit, and now the PR should be ready to be merged.
The related PR to ubox was already merged.

@stokito
Copy link
Contributor Author

stokito commented Mar 24, 2024

Fixed merge conflict. The PR to ubox was merged openwrt/openwrt#14775
So please take a look on the PR. It will close two issues.

@trippleflux
Copy link

trippleflux commented Mar 24, 2024

Getting :

Error: logfile not found!

[EDIT]
I need to make all available bash script files to become executable (chmod +x) inside the ./feeds/packages/admin/syslog-ng directory.

or make /usr/share/syslog-ng/include/scl/network_localhost/detect.sh as a executable in the running OpenWRT.

When the syslog-ng installed it records all messages to /var/log/messages.
This makes the default OpenWrt's ubox /sbin/logread useless and return nothing.

The logread script was added to the syslog-ng as a shim.
It's based on `tail /var/log/messages` and repeats basic options that the ubox logread have.
The script is installed instead of the /sbin/logread and this is causes an error.

Instead install it to /usr/libexec/logread.sh and specify as an alternative /sbin/logread.

The ubox logread also needs to be made as alternative in /usr/libexec/logread-ubox.

So we need to give it a separate name.
The most simple and clear would be logread-shell or just logread.sh.

Suggested-by: Andreas Gnau <andreas.gnau@iopsys.eu>
Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
@stokito
Copy link
Contributor Author

stokito commented May 2, 2024

@BKPepe I rebased on top of latest changes. Please merge

@stokito
Copy link
Contributor Author

stokito commented Jul 27, 2024

Friendly reminder on this.

@stokito
Copy link
Contributor Author

stokito commented Oct 20, 2024

Friendly remind on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

syslog-ng: conflicts with logd package syslog-ng: clash with ubox logd when both are required
4 participants