Bug#670585: "ok hat location is writable"

Tito farmatito at tiscali.it
Thu May 9 21:35:17 BST 2019



On 5/9/19 9:35 AM, Dmitry Bogatov wrote:
> 
> [2019-05-08 14:57] Tito <farmatito at tiscali.it>
>>> Problem is that I do not understand, when /var/log/fsck exist for sure.
>>>
>>> Collegues, I need help with evaluating proposed change.
>>>
>> Hi,
>> I guess if it is a one partition only setup /var/log will
>> exist as soon as as root is switched from initrd and/or
>> remounted read-write, if it is a multi-partition setup
>> with separated partitions for /tmp, /home and /var,
>> /var will exist as soon as root is switched from
>> initrd but /var/log will exist only after /var is mounted.
> 
> So it means, that check 'test -w "${FSCK_LOGFILE}"' that you proposed is
> only meaningful after 'mountall', but not in 'checkfs'. So I have to
> keep more vague
> 
> 	"Log is being saved in ${FSCK_LOGFILE} if that location is writable"
> 
> Did I miss something?
> 
Hi,
No you didn't. An alternative approach could be:

test if we are in a single-partition environment
and /var/log/ exists, maybe it is not writable yet
but we are optimistic that we can write to it

if test -d `dirname ${FSCK_LOGFILE}` ; then
	"Log is being saved in ${FSCK_LOGFILE}"
else
	/var/log doesnt' exist yet and we really cannot say
         if it ever will, stay more vague
	"Trying to save log to ${FSCK_LOGFILE}"
fi

but that is only cosmetic.

The KISS solution would be to use always

	"Trying to save log to ${FSCK_LOGFILE}"

and so if the user really needs to read the file
he will go to see if it is there, if the user
doesn't care it makes no difference if it was
"being saved" or "Trying to be saved".

Ciao,
Tito






  


   




More information about the Debian-init-diversity mailing list