console-conf uses 20+MB memory at rest on embedded systems

Bug #1618239 reported by Steve Langasek
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
subiquity (Ubuntu)
Fix Released
High
Michael Hudson-Doyle

Bug Description

As reported in https://bugs.launchpad.net/ubuntu/+source/subiquity/+bug/1617232/comments/2, console-conf uses around 25MB of memory on an arm64 system, which is excessive for an idle process on an embedded device. And console-conf will be idle on a significant number of such systems, since some device manufacturers will not pre-configure an account and the vast majority of these devices will never have the end user log in on console to take ownership.

To avoid this gratuitous memory usage, I suggest we change the systemd unit to wrap the console-conf python program in a simple shell script prompting the user to hit enter.

Strawman implementation to get us started - wording to be confirmed on snapcraft list:

#!/bin/sh
set -e

echo -n 'Press enter to configure: '
read
exec console-conf "$@"

Steve Langasek (vorlon)
Changed in subiquity (Ubuntu):
assignee: nobody → Michael Hudson-Doyle (mwhudson)
Steve Langasek (vorlon)
Changed in subiquity (Ubuntu):
status: New → Triaged
importance: Undecided → High
Changed in subiquity (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Oliver Grawert (ogra) wrote :

while the above will indeed help with the idling process,
it will still bump our minimal requirements by these 25MB since it needs this amount when actually running.

Revision history for this message
Mark Shuttleworth (sabdfl) wrote : Re: [Bug 1618239] [NEW] console-conf uses 20+MB memory at rest on embedded systems

Good catch. Only question from me is whether (essentially) direct shell
access presents a security risk we may regret later. A minimalist "press
enter" app would be much easier to audit, and if written in something
more likely to be input-safe and yet still compiled would take very
little in the way of resources.

Is there already an "inetd" for consoles?

Mark

Revision history for this message
Steve Langasek (vorlon) wrote :

Turns out agetty actually already has options to pause before spawning its 'login' process. That's probably the way to go, using the -f option to specify a custom 'issue' file with the "Press enter" message.

Revision history for this message
Mark Shuttleworth (sabdfl) wrote : Re: [Bug 1618239] Re: console-conf uses 20+MB memory at rest on embedded systems

Perfect outcome :)

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Is the workaround considered sufficient for now? Can we close this?

Revision history for this message
Oliver Grawert (ogra) wrote :

i dont think using 20+ MB for such a tool is reasonable (1-2MB or even less would be...)
but given that the constant RAM occupation is gone for now at least ...

Steve Langasek (vorlon)
Changed in subiquity (Ubuntu):
status: Fix Committed → Fix Released
John Lenton (chipaca)
no longer affects: snappy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.