Using LXC running a systemd based container, one automatically gets dropped into a console session on the container. By creating and modifying
/etc/systemd/system/console-getty.service to have an
ExecStart line such as the following:
ExecStart=-/sbin/agetty --noclear -a <username> -s console 115200,38400,9600
It's possible to skip the login session and directly drop in to a session running as a particular user.
What I would like is for the machine to be automatically halted when this session ends. Is there a way to configure this, either in systemd or agetty? For reference, the host is Ubuntu 12.04 and the container is running a pretty recent Arch basis.