PATH does not include /usr/local/bin and /usr/local/sbin

Bug #1661023 reported by Harald Sitter
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Snapcraft
Invalid
High
Sergio Schvezov
snap-confine
Fix Released
Undecided
Zygmunt Krynicki

Bug Description

The xdg-open shim is placed in /usr/local/bin/xdg-open in the ubuntu-core snap. Since /usr/local/{sbin,bin} is not in the default PATH of snaps the shim is however not found unless explicitly called with full path.

PATH should include /local/ variants to make the shim work.

Tags: isv
Changed in snapcraft:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Sergio Schvezov (sergiusens)
milestone: none → 2.27
Revision history for this message
Seth Arnold (seth-arnold) wrote :

I dislike the idea that packaging-owned files are being placed in /usr/local/ -- this has historically been entirely uncontrolled by all distros and left for administrators to do as they wish.

We don't want to overwrite local changes. We should use snap-specific paths when the more customary /bin /sbin /usr/bin /usr/sbin aren't appropriate.

Thanks

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

@seth: note that this is a path inside the readonly core and that we need to override the identical xdg-open in /usr/bin if apps ship it inside the snap. this is a script to actually call the xdg-open of the host system outside of the core snap. if you have any better idea regarding the binaries the core snap ships in /usr/local without additionally needing to mangle the host path (there are others) we'll happily implement them.

Zygmunt Krynicki (zyga)
Changed in snap-confine:
status: New → In Progress
assignee: nobody → Zygmunt Krynicki (zyga)
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

this will be fixed in snap-confine

Changed in snapcraft:
status: In Progress → Invalid
Revision history for this message
Seth Arnold (seth-arnold) wrote :

Thanks Ogra, I guess I'm just getting very confused about the number of permutations that are under discussion:

- We want snapd and snaps to run on 14.04 LTS, 16.04 LTS, 16.10, Arch, Fedora, etc
- We want snapd and snaps to run on Ubuntu Core 16

Some of these systems exist because snapd exists. In these cases a /usr/local/bin/xdg-open is perfectly fine. There's no admin who might have put something else there and no one is going to be looking under the hood.

On some of these systems, snapd is one way to try to get something done. It might be the most important thing on the system or a user may install it for ten minutes to find out if it solves a problem. We shouldn't be writing into /usr/local/ on these systems.

So, I guess that's the crux of my comment -- if this file may go onto a system that is 'traditional' in any sense of the word, then a new location would be nice. If this file will only exist on the newer IOT-style devices then it doesn't really matter.

Thanks

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

@setth: how would that file get ever out of the readonly squashfs file to land in the actual /usr/local ? it does get cretaed during the build of the core snap by the core build scripts and does not come with any package anyone could install on either distro:
...
echo "I: Creating xdg helper"

PREFIX=binary/boot/filesystem.dir

mkdir -p $PREFIX/usr/local/bin
cat >$PREFIX/usr/local/bin/xdg-open <<EOF
#!/bin/sh
dbus-send --print-reply --session --dest=com.canonical.SafeLauncher / com.canonical.SafeLauncher.OpenURL string:"\$1"
EOF
chmod 755 $PREFIX/usr/local/bin/xdg-open
...

Zygmunt Krynicki (zyga)
Changed in snap-confine:
status: In Progress → Fix Committed
tags: added: isv
Zygmunt Krynicki (zyga)
Changed in snap-confine:
status: Fix Committed → Fix Released
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.