symlinks to snap commands no longer working
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Triaged
|
Medium
|
Unassigned |
Bug Description
(OS Tested and found on: Ubuntu Server 16.04)
Commands defined in snapcraft.yaml get prefixed with the snap name. For example, with the Quagga Snap, the vtysh command is prefixed with quagga and ends up as quagga.vtysh
To support existing scripts which expect the command to just be "vtysh", I've recommended users to create a symlink from vtysh to quagga.vtysh.
This worked fine up to (incl) snapd version 2.14.2
Up to this version, the resulting quagga.vtysh is a shell script which sets the environment and
starts the app.
After the latest upgrade to snapd version 2.16ubuntu3 this does no longer work.
quagga.vtysh is now itself a symlink to /usr/bin/snap (a binary) and all other apps
are a symlink to this same binary.
Running quagga.vtysh directly still works and is detected as calling the right app, but the symlink no longer works and gets interpreted as calling /usr/bin/snap directly
root@ubuntu1604
/snap/bin/
root@ubuntu1604
lrwxrwxrwx 1 root root 13 Nov 15 18:28 /snap/bin/
root@ubuntu1604
root@ubuntu1604
error: Please specify one command of: abort, ack, buy, change, changes, connect, create-user, disable, disconnect, download, enable, find, get, help, install, interfaces, known, list, login, logout, refresh, remove, revert, run, set or try
Changed in snappy: | |
importance: | Undecided → Medium |
status: | Confirmed → Triaged |
affects: | snappy → snapd |
This is caused by "snap run" using symlink logic to know which application to run.
As a workaround you can always "snap run $SNAP_NAME" or "snap run $SNAP_NAME.appname" and put that in a script under any name.