Koozali.org formerly Contribs.org

"Cron Daemon" error: bad line 4 in state

Hasan Muhammad

"Cron Daemon" error: bad line 4 in state
« on: July 25, 2000, 05:48:12 PM »
I get the following mail message every day...

Any debug ideas?

From: "Cron Daemon" To:
Subject: Cron run-parts /etc/cron.daily

"Cron Daemon" error: bad line 4 in state file /var/lib/logrotate.status

Hasan

Charlie Brady

RE: "Cron Daemon" error: bad line 4 in s
« Reply #1 on: July 25, 2000, 05:55:24 PM »
Hasan Muhammad wrote:

> Any debug ideas?
...
> "Cron Daemon" error: bad line 4 in state file
> /var/lib/logrotate.status

Log in as root and have a look at /var/lib/logrotate.status:

cat /var/lib/logrotate.status

My file looks like this ...

logrotate state -- version 1
/var/log/cron 2000-7-23
/var/log/messages 2000-7-23
/var/log/secure 2000-7-23
/var/log/maillog 2000-7-23
...

I strongly suspect that you can delete that file, and logrotate will create a new one, with correct syntax.

Charlie

Hasan Muhammad

RE: "Cron Daemon" error: bad line 4 in s
« Reply #2 on: July 25, 2000, 06:02:08 PM »
Charlie,

That file on my machine looked to have the identical format, but what the heck...

However, all its  entries were dated 2000-7-19.

I renamed it as suggested... results to follow.

Thanks,

Hasan

Hasan Muhammad

RE: "Cron Daemon" error: bad line 4 in s
« Reply #3 on: July 30, 2000, 01:16:23 AM »
I found the problem.

Among the entries in the logrotate.status file are a
  /var/log/samba/log.workstation_name 2000-7-26
where workstation_name corresponds to a windows computer name as listed under network neighborhood.

Apparently the format of entries in logrotate.status is for two fields per line separated by whitespace, which means the fields should not contain whitespace.

A computer on our network was named 'Tech Dev Workstation' (control panel/network/identification/computer name).  Since this name contained spaces, the entry for that workstation in the logrotate.status file contained more than two fields.

Hasan Muhammad

RE: "Cron Daemon" error: bad line 4 in s
« Reply #4 on: September 15, 2000, 08:05:27 PM »
Here's the fix:

Notice the line number

   error: bad line 19 in state file /var/lib/logrotate.status

Edit /var/lib/logrotate.status
  - go to that line number
  - Note the name of the Windows machine listed on that line (the name will include an embedded space--which is the source of the problem).

Go to the /var/log/samba directory and remove the file associated with that machine name (and remove the files for any other Windows machines with an embedded space in the name).

Remove the /var/lib/logrotate.status file.

Go to every Windows machine whose name includes an embedded space:
   - rename the machine (Control Panel/Network/Identification/Computer Name)
   - reboot the computer

That should fix the problem.

Hasan

Charlie Brady

RE: Cron Daemon; error: bad line 4 in s
« Reply #5 on: September 16, 2000, 02:16:02 AM »
Hasan Muhammad wrote:

> Here's the fix:

"Here's a fix" would be more accurate - there's more than one way to skin a cat, as the old saying goes..

> Notice the line number
>
> error: bad line 19 in state file /var/lib/logrotate.status
>
> Edit /var/lib/logrotate.status - go to that line number - Note
> the name of the Windows machine listed on that line (the name
> will include an embedded space--which is the source of the
> problem).

That, and a bug in the logrotate program.

The bug has been recognised and fixed in a later version of logrotate.
I've built that version for e-smith, and put it in my contrib directory on ftp.e-smith.org. The directory is:

ftp://ftp.e-smith.org/pub/e-smith/contrib/charlieb/RPMS/i386

and the two filenames you need are:

logrotate-3.5-1.i386.rpm
popt-1.5-9.6x.i386.rpm

Update those files using "rpm -Uhv .....", then remove /var/lib/logrotate.status, and you should see no more such messages.

This has had only minimal testing with e-smith, so if you have a mission critical server, just put up with the harmless email messages, or rename your windows machines as suggested by Hasan.

Regards

Charlie