RFC: Snappy shell

Zygmunt Krynicki zygmunt.krynicki at canonical.com
Mon Jun 15 17:20:23 UTC 2015


On Mon, Jun 15, 2015 at 5:50 PM, Loïc Minier <loic.minier at ubuntu.com> wrote:
> User experience
>
>
> When you SSH into a Snappy system, you currently end up on a shell prompt.
> Wouldn’t it be great to actually land in Snappy itself?

As long as you can still run the real shell for all kinds of scripting
and automation, maybe.

Personally, I would rather have a curses-like interface that I can
enable with a command that gets printed on login. As Gustavo replied
later, my experience with environments like that is rather mixed. It's
useful to some people but to virtually everyone it's an unexpected
step and it feels like everything has to be re-learned.

Thanks
ZK




>
> Welcome to Snappy Ubuntu Core 15.04
>
> snappy#
>
>
> How do I get started?
>
>
> snappy# help
>
> Usage:
>
>  <command> [<arg>...]
>
>
> Available commands
>
>  booted              Flag that rootfs booted successfully
>
>  build               Builds a snap package (aliases: bu)
>
>  config              Set configuration for an installed package.
>
> [... edited for brievety...]
>
>  shell               Start a shell
>
>  update              Update all installed parts
>
>  versions            (deprecated) please use "list"
>
>
> Simple commands like install, update etc. work as expected:
>
>
> snappy# info
>
> release: ubuntu-core/15.04/stable
>
> architecture: amd64
>
> frameworks: webdm
>
> apps:
>
> snappy# list -v
>
> Name          Date       Version Developer
>
> ubuntu-core   2015-06-11 3       ubuntu*
>
> webdm         2015-06-11 0.9     *
>
> generic-amd64 2015-06-11 1.1.1   *
>
>
> We should revisit some commands or aliases to have a friendlier, more
> rewarding user experience, e.g. update could provide some output when no
> update is available and entering a shell command like ls would hint at using
> help:
>
>
> snappy# update
>
> System is up-to-date!
>
> snappy# ls
>
> No such command; “help” for a list of commands
>
>
> Configuration is only possible for snaps that have the required hook and may
> be set manually by key or globally from an URL, and of course immutable
> configs can’t be changed.
>
>
> snappy# config
>
> (config)# list
>
> Name           Date       Version Developer
>
> ubuntu-core    2015-06-11 3       ubuntu
>
> config-example 2015-06-15 1.0.6   canonical
>
> webdm          2015-06-11 0.9
>
> (config)# config xkcd-webserver
>
> No config found for this snap
>
> (config)# config ubuntu-core
>
> (ubuntu-core)# show
>
> autopilot: true
>
> timezone: Etc/UTC
>
> hostname: localhost.localdomain
>
> (ubuntu-core)# set autopilot false
>
> Config set
>
> (ubuntu-core)# exit
>
> snappy# config config-example set -u
> https://conf.example.com/config-example.yaml
>
> Config set
>
>
> A new shell command is provided to start the default user’s interactive
> shell or to run commands ( under “sh -c”).
>
>
> Goals of snappy shell
>
>
> Deliver a slick console user experience as found when SSH-ing (or
> telnet-ing) into network equipments such as switches, routers, firewalls
> etc.
>
> Allows restricting access to the shell while allowing for useful features
> such as update, install etc. (could be controlled by a new
> allowed-cli-commands ubuntu-core config or similar)
>
> Smoothes transition into a Comfy world where the regular rootfs becomes
> smaller and smaller.
>
>
> Implementation
>
>
> This user experience would be delivered by the main “snappy” binary when
> it’s launched as “snappy-cli” as the basename of argv[0]. If this feature is
> not enabled by default, or from a shell, you would run “snappy cli” to start
> an interactive snappy shell session. NB: cli is to avoid confusion with the
> shell command to run a command or an interactive shell.
>
>
> SSH integration could be done in multiple ways:
>
> integrate a SSH server in snappy itself; I don’t know how hard this is in go
> today; this might be a worthwhile exercise long-term to get a smaller rootfs
>
> configure SSH server and login to always start /bin/snappy-cli instead of
> the user’s shell, then lookup the user’s shell in the passwd database to run
> the preferred shell with “snappy shell”
>
> (preferred) configure the user’s shell to /bin/snappy-cli and create a new
> snappy-only ubuntu-core config for the preferred interactive shell (defaults
> to /bin/bash); drawback: this would be system-wide as we don’t have per-user
> configs
>
>
> Questions? Comments? Pile on at:
> https://docs.google.com/document/d/1DeR2JoCBDX2C1r6a2wV60uqvi7a89OwHh5gJ19tBZvM/edit
>
>
> Cheers,
> --
> Loïc Minier
>
> --
> snappy-devel mailing list
> snappy-devel at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/snappy-devel
>



More information about the snappy-devel mailing list