[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cvs commit to debian-installer/tools/ddetect by pere

pere@debian.org wrote:
> @@ -39,7 +38,7 @@
>      db_input low hw-detect/module_params || [ $? -eq 30 ]
>      db_go
>      db_get hw-detect/module_params
> -    if modprobe -v "$module" $RET >> /var/log/messages 2>&1 ; then
> +    if modprobe -v "$module" $RET 2>&1 | logger -t hw-detect ; then
>  	# Not sure if this is usefull.  After all, 'discover' is installed
>  	# in /target/. [pere 2003-04-18]
>  	#prebaseconfig=/usr/lib/prebaseconfig.d/40ethdetect

Careful! By piping to logger here you are discarding the return code
of modprobe, so the if never fires even if modprobe fails.

This is why we need some way to call logger in a shell script that does
not discard return code. I think it can be done using a nasty shell
function that redirects to a file, but I hope there is a better way, and
someone is apparently working on something in C that preserves return
codes while logging output. Probably something along the lines of:

/usr/bin/log_output 'shell command here'

The above change should probably be reverted in the meantime.

see shy jo

Attachment: pgpBq8wpcD_xM.pgp
Description: PGP signature

Reply to: