BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001267 [BusyBox] Other minor always 03-09-07 12:40 03-09-07 14:48
Reporter espakman View Status public  
Assigned To BusyBox
Priority normal Resolution fixed  
Status closed   Product Version
Summary 0001267: Rev ision 18018, ifstate warning printed with first time boot
Description Revision 18018 added the following code:

/* Read the previous state from the state file */
state_fp = fopen_or_warn("/var/run/ifstate", "r");

If the system is booted for the first time, no state file is present and an ugly warning is printed.
Additional Information
Attached Files

- Relationships

- Notes
(0002224)
vda
03-09-07 13:08

Replace fopen_or_warn with plain fopen. Is this looks ok to you?
 
(0002225)
espakman
03-09-07 13:41

That works, but I'm not sure what the desired behavior should be. In Debian the statefile is cleaned/recreated at every boot with an init.d script.

The patch (rev 18018) to read the previous statefile can be tricky, what happens if no ifdown -a is done at reboot or halt time? The state is kept and after booting (and no clean of the statefile with an init script) ifup -a will think the interfaces are up. Or am I wrong?
 
(0002226)
vda
03-09-07 13:49

I think /var/run is supposed to be cleaned up on each boot. It contains pidfiles and similar information, not permanent data.

As for the idea of keeping info in such a file in general, well... I find the whole idea (design) of ifup/ifdown fragile, and therefore I personally don't use it. Thus cannot vouch on the correctness of that change in rev 18018.
 
(0002227)
espakman
03-09-07 14:04

Agree. I just checked, in Debian the statefile is placed in /etc/network/run/ instead of /var/run/. So that should be the reason why it's explicitly cleaned there.

I think the correct fix is not to warn if the file doesn't exist so "fopen" instead of "fopen_or_warn".
 
(0002228)
vda
03-09-07 14:48

Fixed in rev 18059. Thanks!
 

- Issue History
Date Modified Username Field Change
03-09-07 12:40 espakman New Issue
03-09-07 12:40 espakman Status new => assigned
03-09-07 12:40 espakman Assigned To  => BusyBox
03-09-07 13:08 vda Note Added: 0002224
03-09-07 13:41 espakman Note Added: 0002225
03-09-07 13:49 vda Note Added: 0002226
03-09-07 14:04 espakman Note Added: 0002227
03-09-07 14:48 vda Status assigned => closed
03-09-07 14:48 vda Note Added: 0002228
03-09-07 14:48 vda Resolution open => fixed


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker