<div dir="ltr">Hi Seth,<div><br></div><div>Thanks. You are right. I just created a new dir under the root, and I tried to access it, and it was successful this time.</div><div><br></div><div><div>liuxg@liuxg:~/snappy/desktop$ sudo snap run --shell hello.env</div><div>[sudo] password for liuxg: </div><div>root@liuxg:/home/liuxg/snappy/desktop# cd /run/user/0/snap.hello</div><div>root@liuxg:/run/user/0/snap.hello# ls</div></div><div><br></div><div>Many thanks</div><div>Best regards,</div><div>XiaoGuo</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 4, 2017 at 10:40 AM, Seth Arnold <span dir="ltr"><<a href="mailto:seth.arnold@canonical.com" target="_blank">seth.arnold@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, Feb 04, 2017 at 10:33:20AM +0800, XiaoGuo Liu wrote:<br>
> liuxg@liuxg:~/snappy/desktop/<wbr>ss$ hello.env | grep XDG_RUNTIME<br>
> XDG_RUNTIME_DIR=/run/user/<wbr>1000/snap.hello<br>
</span><span class="">> $ sudo snap run --shell hello.env<br>
</span><span class="">> # env | grep XDG_RUNTIME_DIR<br>
> XDG_RUNTIME_DIR=/run/user/0/<wbr>snap.hello<br>
<br>
</span>Your first command was run as a standard user, probably the first user<br>
installed on the system, since it is user 1000.<br>
<br>
Your second command was run as root via the sudo tool, thus you get a<br>
different directory. Every user's data should be stored in a place where<br>
it won't collide with other users, and root is no different in this case.<br>
<br>
Thanks<br>
<br>--<br>
Snapcraft mailing list<br>
<a href="mailto:Snapcraft@lists.snapcraft.io">Snapcraft@lists.snapcraft.io</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/snapcraft" rel="noreferrer" target="_blank">https://lists.ubuntu.com/<wbr>mailman/listinfo/snapcraft</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">XiaoGuo, Liu </div></div></div></div>
</div>