Bug#673207: /etc/default/rcS is perhaps a better place for FANCYTTY variable

"Didier 'OdyX' Raboud" <[email protected]>
Newsgroups gmane.linux.debian.devel.lsb
Organization Debian, the Universal OS
Message-ID <4FBA2947.3080808__47292.3273490325$1337600551$gmane$org@debian.org>
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
signature.asc (application/pgp-signature, 663 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)

iQGcBAEBAgAGBQJPuilHAAoJEIvPpx7KFjRVreoL/2jIkt2knTvrlciUvLXcPJbM
k09BgKqgG+LzIU9BouU1NvKPZmaaWnIdJZCXAQQz/S+aJa1T81Zx5/McQPagpDCd
lFMhm7sz5qRpMSJcWzkyW3JIOaPrTyIvDCVujlaP1u6bJGic4vqCKhAiQA0JGUky
E8I0gj5I33411+/CSnUnqfdBhSBf4fJEU8PurXIwmApajjg2+U9XW7G27TDqgpFV
g2DySpXemZZ8GahMG/3zzfbwM8liTZNhxJsMh80Z0XZ5Z1nCm0bOu3c/o35NU0Lq
Ze+zNmmR71vvc6OMD5RvgJ8U+3N9fhP9a8Nk8KaxWi9KPBGMeG+jwWn/M1mQOb5c
1+pV0E26oOEeWyo0XMzj2jOpEiVygNiVeyKQzyLEifhoH9GlzifiGzQFYnNWrSit
IjOpxpnR8Hz7XCpn0+9VVEtchRjRod955JNX1rj8ekh07Pkeh4Nh0Ar+M3MFyIe3
K+kB68GZ3v56b7XPUWILZDJhZYWKaWXfbGeJN33pdQ==
=2nRp
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.