Porteus 5.0rc2 /var/log/messages

Please reproduce your error on a second machine before posting, and check the error by running without saved changes or extra modules (See FAQ No. 13, "How to report a bug"). For unstable Porteus versions (alpha, beta, rc) please use the relevant thread in our "Development" section.
User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Porteus 5.0rc2 /var/log/messages

Post#1 by Ed_P » 15 Sep 2020, 14:54

I have entries in my /var/log/messages file going back to August. I don't recall this problem in 4.0. I thought there was a command in the shutdown process to trim them. Is there a command to trim the size of the 5.0rc2 files in /var/log/? :%)
Ed

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

5.0rc2 /var/log/messages

Post#2 by donald » 15 Sep 2020, 18:10

Normally this is done by a cron job [logrotate] every day at 19:30
if the file size exceeds 500k
Obviously it does not work.
Run the command manually [root] and you can see why

Code: Select all

/usr/bin/run-parts /etc/cron.daily 1> /dev/null
Create a /var/log/spooler file and the command does its job.
at least if run manually.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

5.0rc2 /var/log/messages

Post#3 by Ed_P » 15 Sep 2020, 20:04

Thank you donald. :)

Confused with the

Code: Select all

/usr/bin/run-parts /etc/cron.daily 1> /dev/null
suggestion. /etc/cron.daily for me is a folder with 2 files in it,

Code: Select all

guest@porteus:/etc/cron.daily$ ls
certwatch*  logrotate*
guest@porteus:/etc/cron.daily$ 
how does the run-parts command know which file to execute?

Added in 13 minutes 22 seconds:
Ok, the results of your suggestions.

Code: Select all

guest@porteus:/etc/cron.daily$ ls
certwatch*  logrotate*
guest@porteus:/etc/cron.daily$ su
Password: 
root@porteus:/etc/cron.daily# /usr/bin/run-parts /etc/cron.daily 1> /dev/null
error: /etc/logrotate.conf:40 duplicate log entry for /var/log/wtmp
error: /etc/logrotate.conf:48 duplicate log entry for /var/log/btmp
error: stat of /var/log/spooler failed: No such file or directory
root@porteus:/etc/cron.daily# ls /var/log/s*
/var/log/scripts@  /var/log/setup@    /var/log/spooler
/var/log/secure    /var/log/slim.log  /var/log/syslog

/var/log/samba:
root@porteus:/etc/cron.daily# /usr/bin/run-parts /etc/cron.daily 1> /dev/null
error: /etc/logrotate.conf:40 duplicate log entry for /var/log/wtmp
error: /etc/logrotate.conf:48 duplicate log entry for /var/log/btmp
root@porteus:/etc/cron.daily# cat /var/log/messages
Sep 15 16:10:11 porteus syslogd[885]: syslogd v2.1.2: restart.
Sep 15 16:10:11 porteus logrotate: ALERT - exited abnormally.
Sep 15 16:12:04 porteus kernel: [23693.013287] xed[5517]: segfault at 7fe0c225cd40 ip 00007fe0d573c9b4 sp 00007ffdf7455c90 error 4 in libglib-2.0.so.0.6400.4[7fe0d570a000+7e000]
Sep 15 16:12:04 porteus kernel: [23693.013320] Code: 44 24 08 48 85 c0 74 03 44 89 28 31 c0 85 db 0f 9f c0 48 83 c4 48 5b 5d 41 5c 41 5d 41 5e 41 5f c3 0f 1f 44 00 00 48 8b 41 10 <48> 8b 00 48 85 c0 0f 84 90 00 00 00 41 83 46 58 01 4c 89 f7 48 89
root@porteus:/etc/cron.daily# 
So the message are now current only.

Is there an option to delete messages older than say 48 hrs?
Ed

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Porteus 5.0rc2 /var/log/messages

Post#4 by donald » 17 Sep 2020, 11:07

Ed_P wrote:
15 Sep 2020, 20:18
how does the run-parts command know which file to execute?
# run-parts: Runs all the scripts found in a directory.
The command posted is what would/should be executed daily -- see:

Code: Select all

crontab -l
...........
# Run daily cron jobs at 19:30 every day:
30 19 * * * /usr/bin/run-parts /etc/cron.daily 1> /dev/null
...........
so it doesn't do any harm if run manually -- IMO
Is there an option to delete messages older than say 48 hrs?
Yes, your preferred text editor. :)

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Porteus 5.0rc2 /var/log/messages

Post#5 by Ed_P » 17 Sep 2020, 13:45

donald wrote:
17 Sep 2020, 11:07
Yes, your preferred text editor. :)
:lol: Thank you donald. :beer:

Added in 16 hours 51 minutes 13 seconds:
In the past logrotate used a file in /etc/ named logrotate.conf. But that file isn't in 5.0rc2.

Re: What Makes save.dat File Grow? There A "Prune" App For I (Post by Ed_P #21470)
Ed

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

Porteus 5.0rc2 /var/log/messages

Post#6 by ncmprhnsbl » 18 Sep 2020, 13:55

Ed_P wrote:
18 Sep 2020, 06:36
In the past logrotate used a file in /etc/ named logrotate.conf. But that file isn't in 5.0rc2.
are you sure?

Code: Select all

$ ls /mnt/live/memory/images/001-core.xzm/etc/logrotate*
/mnt/live/memory/images/001-core.xzm/etc/logrotate.conf

/mnt/live/memory/images/001-core.xzm/etc/logrotate.d:
syslog  wpa_supplicant
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Porteus 5.0rc2 /var/log/messages

Post#7 by Ed_P » 18 Sep 2020, 17:54

ncmprhnsbl wrote:
18 Sep 2020, 13:55
are you sure?

Code: Select all

$ ls /mnt/live/memory/images/001-core.xzm/etc/logrotate*
/mnt/live/memory/images/001-core.xzm/etc/logrotate.conf

/mnt/live/memory/images/001-core.xzm/etc/logrotate.d:
syslog  wpa_supplicant
:o Apparently not. :oops: I must have mistyped it last night. Thank you ncmp. :)

Any ideas about these msgs?

Code: Select all

root@porteus:/etc/cron.daily# /usr/bin/run-parts /etc/cron.daily 1> /dev/null
error: /etc/logrotate.conf:40 duplicate log entry for /var/log/wtmp
error: /etc/logrotate.conf:48 duplicate log entry for /var/log/btmp
I don't see dupes in the file's code.

Code: Select all

# Rotate /var/log/wtmp:
/var/log/wtmp {
    monthly
    create 0664 root utmp
	minsize 1M
    rotate 1
}

# Rotate /var/log/btmp:
/var/log/btmp {
    monthly
    create 0600 root root
    rotate 1
}
Ed

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Porteus 5.0rc2 /var/log/messages

Post#8 by donald » 18 Sep 2020, 19:23

Ed_P wrote:
18 Sep 2020, 17:54
Any ideas about these msgs?
I don't see dupes in the file's code.
Not there, but
In /etc/logrotate.conf is this:
# some packages install log rotation information in this directory:
include /etc/logrotate.d
> go there:
The instruction to rotate /var/log/wtmp and /var/log/btmp is also in
/etc/logrotate.d/syslog
...that's the reason.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Porteus 5.0rc2 /var/log/messages

Post#9 by Ed_P » 18 Sep 2020, 22:22

donald wrote:
18 Sep 2020, 19:23
The instruction to rotate /var/log/wtmp and /var/log/btmp is also in
/etc/logrotate.d/syslog
...that's the reason.
Yes indeed! Thank you donald. :beer:

So, create a /var/log/spooler file and comment out the dupe lines in /etc/logrotate.conf and we have a functioning system. Do I need to add a command in one of the autorun files for it to run regularly?

Added in 7 hours 28 minutes 35 seconds:
Why do I need logs and 4 weeks of backups of them? I run Porteus as an ISO with a savedat file which means, if I understand correctly, all these logs and backups reside in my RAM when I am running. What purpose do the logs serve the normal user? :%)
Ed

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Porteus 5.0rc2 /var/log/messages

Post#10 by donald » 20 Sep 2020, 13:55

Ed_P wrote:
19 Sep 2020, 05:50
So, create a /var/log/spooler file
Yes
and comment out the dupe lines in /etc/logrotate.conf
I don't know if there is / was a reason to have entries in both files.
Do I need to add a command in one of the autorun files for it to run regularly?
No, only the spooler file is required.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Porteus 5.0rc2 /var/log/messages

Post#11 by Ed_P » 20 Sep 2020, 19:17

Thank you donald. :) Any comment on the need for the logs?
Ed

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Porteus 5.0rc2 /var/log/messages

Post#12 by donald » 21 Sep 2020, 16:11

The collection of log files could be considered useless by a "normal user"
-- [ define "normal user" ] -- if everything runs smoothly.
But if not, some of these log files are quite valuable.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Porteus 5.0rc2 /var/log/messages

Post#13 by Ed_P » 21 Sep 2020, 22:47

donald wrote:
21 Sep 2020, 16:11
-- [ define "normal user" ] --
normal user : someone who boots and uses the system for 3 days without issues. Able to access the Internet, print files, play games, check the weather, access other systems on a network, uses a notebook and closes the lid when he/she leaves it. :)
Ed

Post Reply