Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#18759 - [initscripts] Obsolete escape sequence aborts backgrounded daemons

Attached to Project: Arch Linux
Opened by kujub (kujub) - Saturday, 20 March 2010, 12:58 GMT
Last edited by Roman Kyrylych (Romashka) - Tuesday, 04 May 2010, 09:48 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Thomas Bächler (brain0)
Roman Kyrylych (Romashka)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
When backgrounding slow custom scripts in DAEMONS, these are silently aborted as soon as the set_consolefont function gets called. (Bash shell exit without sigterm verified with 'trap'.) This happens with both fbsplash-scripts and initscripts-extras-fbsplash which need to defer 'setfont' to the end of rc.multi. I was able to track this down to printf '\033(K' which is the escape sequence to make console maps active. According to the man pages this sequence seems to be only needed to be sent by the scripts when using 'mapscrn' whereas 'setfont' sends it by itself. Therefore the printf if obsolete and should be dropped AFAIKS. Stuff works as normal here without this.

Additional info:
* package version(s)
initscripts git
* config and/or log files etc.
/etc/rc.conf
CONSOLEFONT=ter-v16n
CONSOLEMAP=cp850 # just for testing

Steps to reproduce:
Use initscripts hooks deferring setfont to rc.multi by unsetting CONSOLEFONT in rc.sysinit and calling set_consolefont from multi_end hook together with some slow script backgrounded in DAEMONS.
This task depends upon

Closed by  Roman Kyrylych (Romashka)
Tuesday, 04 May 2010, 09:48 GMT
Reason for closing:  Fixed
Additional comments about closing:  applied the correcting patch to git
Comment by Thomas Bächler (brain0) - Saturday, 20 March 2010, 15:52 GMT
I never understood what those sequences did. Patch applied to git.
Comment by Roman Kyrylych (Romashka) - Monday, 03 May 2010, 19:33 GMT
While it is true that \e(K is not needed when using setfont (thanks for spotting that!),
the patch breaks the current behaviour in the following scenario:
1) let the system be configured in a non-UTF8 mode and with consolemap
2) reset the terminal (either run `reset` or use any broken app that does it for you)
3) now you have a broken console (this is only the case for non-UTF8 mode, because in recent kernels UTF8 is the default)
4) exit and login back on the same console
now, \e%@ will be executed, because it is written in locale.sh, but \e(K won't (because the patch removed it)
- the console will still be broken, while before the patch it would be restored back to the configured state

I think that removing the 'for' loop is enough to solve the problem you described, but please keep
echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\033(K"; fi' >>/etc/profile.d/locale.sh


P.S.: whether locale.sh should restore the broken-after-reset console is another question.
I think it's convenient and does not hurt, but if people think that it should be removed - then the same should be done for other magic echos that are written to locale.sh, because they are only really needed for restoring the console after a reset.
Comment by Roman Kyrylych (Romashka) - Monday, 03 May 2010, 22:24 GMT
@Kurt: please check if after applying this patch your issue is still fixed.
Comment by kujub (kujub) - Tuesday, 04 May 2010, 07:07 GMT
OK, appears still fixed after applying.

Loading...