Trying to build a Tor Browser snap - getting permission denied on exec

Hey all,

I’ve started a Tor Browser snap here github.com/joedborg/snap-tor-browser

When trying to run the snap (even in classic), I get:

/snap/tor-browser/x1/command-tor-browser.wrapper: 6: exec: /snap/tor-browser/x1/./Browser/start-tor-browser: Permission denied

Reading that shell script, it seems to fork stuff, could this be what’s getting permission denied?

This is why (ls-ing the snap directory):

drwx------ 8 root root  845 Jun  8 10:25 Browser/

Any way to fix this in the snapcraft yaml?

Should be possible with scriptlets.

I think I have the same problem but I don’t understand your solution. :confused:

I am trying to snap ngrok as an exercise. My current snapcraft.yml looks like:

[...snip...]
apps:
  ngrok:
    command: ngrok

parts:
  ngrok:
    source: https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
    source-type: zip
    plugin: dump

Snapped and installed with --devmode, but when I run the ngrok command:

/snap/ngrok/x1/command-ngrok.wrapper: 4: exec: /snap/ngrok/x1/ngrok: Permission denied

And yes, the snapped directories are owned by root but so are all other snaps I have installed. New to snaps and Linux, still trying to understand how it all works so probably something obvious I am not understanding…

UPDATE Writing this down pointed me to something new… the binary is not executable! Aha! That’s what you meant with using scriptlets!

FYI the new URL is https://snapcraft.io/docs/scriptlets :wink:

1 Like