Page 1 of 1

Porteus 5.0rc2 /var/log/messages

Posted: 15 Sep 2020, 14:54
by Ed_P
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/? :%)

5.0rc2 /var/log/messages

Posted: 15 Sep 2020, 18:10
by donald
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.

5.0rc2 /var/log/messages

Posted: 15 Sep 2020, 20:04
by Ed_P
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?

Porteus 5.0rc2 /var/log/messages

Posted: 17 Sep 2020, 11:07
by donald
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. :)

Porteus 5.0rc2 /var/log/messages

Posted: 17 Sep 2020, 13:45
by Ed_P
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)

Porteus 5.0rc2 /var/log/messages

Posted: 18 Sep 2020, 13:55
by ncmprhnsbl
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

Porteus 5.0rc2 /var/log/messages

Posted: 18 Sep 2020, 17:54
by Ed_P
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
}

Porteus 5.0rc2 /var/log/messages

Posted: 18 Sep 2020, 19:23
by donald
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.

Porteus 5.0rc2 /var/log/messages

Posted: 18 Sep 2020, 22:22
by Ed_P
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? :%)

Porteus 5.0rc2 /var/log/messages

Posted: 20 Sep 2020, 13:55
by donald
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.

Porteus 5.0rc2 /var/log/messages

Posted: 20 Sep 2020, 19:17
by Ed_P
Thank you donald. :) Any comment on the need for the logs?

Porteus 5.0rc2 /var/log/messages

Posted: 21 Sep 2020, 16:11
by donald
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.

Porteus 5.0rc2 /var/log/messages

Posted: 21 Sep 2020, 22:47
by Ed_P
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. :)