packages icon indicating copy to clipboard operation
packages copied to clipboard

syslog-ng add logread alternative and minor config update

Open stokito opened this issue 8 months ago • 13 comments

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 https://github.com/openwrt/openwrt/pull/14775

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

stokito avatar Nov 27 '23 07:11 stokito

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.

BKPepe avatar Dec 05 '23 10:12 BKPepe

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.

stokito avatar Dec 05 '23 12:12 stokito

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.

BKPepe avatar Dec 05 '23 13:12 BKPepe

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

stokito avatar Dec 05 '23 18:12 stokito

@BKPepe friendly reminder on this

stokito avatar Feb 04 '24 08:02 stokito

@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.

dibdot avatar Mar 03 '24 19:03 dibdot

I agree with @dibdot move your logread changes to different PR and leave this PR only for minor config update

Dne ne 3. 3. 2024 20:12 uživatel Dirk Brenken @.***> napsal:

@stokito https://github.com/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 ...

@.***:~# ./logread.sh tail: can't open '/var/log/messages': No such file or directory tail: no files

  • An unknown option ends up with ...

@.***:~# ./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 ...

@.***:~# ./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.

— Reply to this email directly, view it on GitHub https://github.com/openwrt/packages/pull/22763#issuecomment-1975267717, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7IDVDEXVHFN5WG5RQDQ6TYWNYYVAVCNFSM6AAAAAA73R6VOWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZVGI3DONZRG4 . You are receiving this because you were mentioned.Message ID: @.***>

BKPepe avatar Mar 03 '24 21:03 BKPepe

I removed last commits for the logread

stokito avatar Mar 03 '24 21:03 stokito

Commit: https://github.com/openwrt/packages/commit/37d2d69595e2e454c2562c3d963dc8065a24db70 pushed to master, thanks!

The other two, I will look into it.

BKPepe avatar Mar 05 '24 19:03 BKPepe

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 avatar Mar 08 '24 12:03 stokito

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

stokito avatar Mar 24 '24 11:03 stokito

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.

trippleflux avatar Mar 24 '24 21:03 trippleflux

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

stokito avatar May 02 '24 06:05 stokito