Le 21.05.2012 12:18, Roger Leigh a écrit : >> FANCYTTY=$([ -e /etc/default/rcS ] && . /etc/default/rcS && echo $FANCYTTY) > > I'm not sure why you need to do this BTW, none of the existing users > do. If you want to avoid polluting your environment with settings > you don't need, then it's fine, but otherwise I don't see the need. I'm not sure I see the need either; looks cleaner to avoid cruft though. >> Just to make sure I understand that correctly: would it be possible to >> let lsb-base's /lib/lsb/init-functions read FANCYTTY from /e/d/rcS right >> now ? > > You can do it right now, it's just that it's not guaranteed to be set. See the log_use_fancy_output function in /l/l/init-functions. The current default for FANCYTTY is "not set": if the terminal is capable and FANCYTTY is unset, then fancy output is enabled. If the terminal is not capable or FANCYTTY is set to anything not in "1|Y|yes|true", then the fancy output is disabled. > So you'd need to set a default, then source the script. E.g.: > > FANCYTTY=defaultval > [ -e /etc/default/rcS ] && . /etc/default/rcS What is done currently is: FANCYTTY= [ -e /etc/lsb-base-logging.sh ] && . /etc/lsb-base-logging.sh || true >> c) writing maintainer scripts to make sure an already defined FANCYTTY >> in /e/lsb-base-logging.sh gets written to /e/d/rcS (Policy doesn't >> really allow this). > > Actually, you are probably OK, since it's not (yet) a conffile. > But it would be better to have it provided as part of the initscripts > defaults. UTC got moved out yesterday (by util-linux). We can now > (if there is agreement) make rcS a regular conffile--the primary > reason for it not being a conffile having been removed. I think that this would be vastly better than modifying a foreign conffile. That said; /e/lsb-base-logging.sh will keep being sourced as being the documented file to override the functions defined in /l/l/init-functions. How do we ensure that any FANCYTTY (possibly scripted) definition in there gets reflected in /e/d/rcS ? I would tend to foresee that the code would look like: FANCYTTY= [ -e /etc/default/rcS ] && . /etc/default/rcS || true [ -e /etc/lsb-base-logging.sh ] && . /etc/lsb-base-logging.sh || true ... with some maintainer script code in lsb-base and/or sysvinit to copy an existing value of FANCYTTY from /e/lsb-base-logging.sh to /e/d/rcS . Opinions ? OdyX
Attachment:
signature.asc
Description: OpenPGP digital signature