After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 646391 - gvfs should use g_get_user_runtime_dir
gvfs should use g_get_user_runtime_dir
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: burn backend
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
: 646493 646512 (view as bug list)
Depends on:
Blocks: 523057
 
 
Reported: 2011-03-31 22:53 UTC by William Jon McCann
Modified: 2013-01-30 10:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use user runtime dir instead of tmp for burning (1.50 KB, patch)
2011-04-01 20:47 UTC, William Jon McCann
committed Details | Review
Use user runtime dir for gvfs mounts (1.86 KB, patch)
2011-04-03 01:25 UTC, William Jon McCann
committed Details | Review

Description William Jon McCann 2011-03-31 22:53:12 UTC
Would be good to use the XDG runtime directory provided by
g_get_user_runtime_dir() instead of /tmp for sockets etc.
Comment 1 William Jon McCann 2011-04-01 20:47:04 UTC
Created attachment 184901 [details] [review]
Use user runtime dir instead of tmp for burning
Comment 2 William Jon McCann 2011-04-03 01:25:13 UTC
Created attachment 185010 [details] [review]
Use user runtime dir for gvfs mounts
Comment 3 William Jon McCann 2011-04-03 18:21:13 UTC
*** Bug 646512 has been marked as a duplicate of this bug. ***
Comment 4 Alexander Larsson 2011-04-05 06:51:03 UTC
*** Bug 646493 has been marked as a duplicate of this bug. ***
Comment 5 Alexander Larsson 2011-04-05 06:56:46 UTC
Looks good to me, we should land this post branching though.
Comment 6 André Klapper 2012-01-12 15:17:07 UTC
(In reply to comment #5)
> Looks good to me, we should land this post branching though.

Alex: Has this happened? If not, can this get in?
Comment 7 Matthias Clasen 2012-01-12 16:20:38 UTC
Tomas,

can you take care of this ?
Comment 8 Kay Sievers 2012-01-23 17:30:27 UTC
(In reply to comment #1)
> Use user runtime dir instead of tmp for burning

Is "burning" the huge image file? Not sure about /tmp or /run for burning DVDs.
/run is required to be a tmpfs, and can not carry more than half of the system's
RAM at maximum. /tmp should ideally a tmpfs by default too (I have that on all
of my boxes).

The only safe bet for storing gigabytes of temporary files is usually /var/tmp,
which needs to reside on disk. We might need to consider /var/tmp to use as
storage for large temporary files.
Comment 9 Kay Sievers 2012-01-23 17:31:00 UTC
(In reply to comment #2)
> Use user runtime dir for gvfs mounts

That looks great. Thanks!
Comment 10 William Jon McCann 2012-01-23 17:57:56 UTC
> The only safe bet for storing gigabytes of temporary files is usually /var/tmp,
> which needs to reside on disk. We might need to consider /var/tmp to use as
> storage for large temporary files.

Ok. Should probably still be per user though.
Comment 11 Tomas Bzatek 2012-01-24 16:11:33 UTC
Both patches look good to me and things seem to be working fine. A fallback path is assured when $XDG_RUNTIME_DIR is not set, e.g. for systems having no /run.

(In reply to comment #8)
> (In reply to comment #1)
> > Use user runtime dir instead of tmp for burning
> 
> Is "burning" the huge image file? Not sure about /tmp or /run for burning DVDs.
> /run is required to be a tmpfs, and can not carry more than half of the
> system's
> RAM at maximum. /tmp should ideally a tmpfs by default too (I have that on all
> of my boxes).

Looking at the burn backend sources, I see traces of temp files and dir creation however there's no way how to actually copy/move data there. No write operations are implemented and the Push operation returns error when trying to move data into the backend. So basically the burn backend is pure virtual. 

Correct me if I'm wrong, I expect the burning application to read burn:/// structure and handling temporary image file itself (which is not really needed usually).

> The only safe bet for storing gigabytes of temporary files is usually /var/tmp,
> which needs to reside on disk. We might need to consider /var/tmp to use as
> storage for large temporary files.

Lots of people I know links /var/tmp to /tmp for not having temporary files spread all over the disk. While it's their problem, they might not be aware of that and turning /tmp to tmpfs might come as a surprise. But hey, I guess we don't care about this situation.
Comment 12 Tomas Bzatek 2012-02-07 11:24:32 UTC
I went ahead and committed both patches in master. I'm still convinced the burn backend not storing anything in its temporary folder. If that's not the case feel free to reopen this bugreport.


commit 989d0889afe34a0ce072edf9840b6d18314a00b3
Author: William Jon McCann <jmccann@redhat.com>
Date:   Tue Feb 7 12:15:43 2012 +0100

    burn: Use user runtime dir instead of /tmp
    
    https://bugzilla.gnome.org/show_bug.cgi?id=646391
    
    Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>

commit f81e381b58bf4dc8ea42ceb50311d4ef92677f72
Author: William Jon McCann <jmccann@redhat.com>
Date:   Tue Feb 7 12:14:48 2012 +0100

    Use user runtime dir for gvfs mounts
    
    https://bugzilla.gnome.org/show_bug.cgi?id=646391
    
    Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
Comment 13 David Zeuthen (not reading bugmail) 2012-02-09 17:01:52 UTC
Reopening because we now show a gvfs entry called 'gvfs' (by design we want to show mounts in $XDG_RUNTIME_DIR)

 Mount(0): gvfs -> file:///run/user/davidz/gvfs
   Type: GProxyMount (GProxyVolumeMonitorUDisks2)
   default_location=file:///run/user/davidz/gvfs
   themed icons:  [drive-removable-media]  [drive-removable]  [drive]
   can_unmount=1
   can_eject=0
   is_shadowed=0
   sort_key=gvfs.time_detected_usec.1328727771883490

 http://people.freedesktop.org/~david/nautilus-with-gvfs-dir.png

So we need to either blacklist this mount or prefix with a dot, e.g. use $XDG_USER_RUNTIME_DIR/.gvfs .. I suggest the latter
Comment 14 William Jon McCann 2012-02-09 17:36:15 UTC
Oh mounts go right under $XDG_USER_RUNTIME_DIR by default? Perhaps another option is to move them under a mounts subdirectory?
Comment 15 David Zeuthen (not reading bugmail) 2012-02-11 00:30:17 UTC
(In reply to comment #14)
> Oh mounts go right under $XDG_USER_RUNTIME_DIR by default? Perhaps another
> option is to move them under a mounts subdirectory?

It's $XDG_USER_RUNTIME_DIR/media actually, but the point is that we show all mounts in $XDG_USER_RUNTIME_DIR just like we have always shown everything in $HOME
Comment 16 David Zeuthen (not reading bugmail) 2012-02-18 18:00:54 UTC
OK, I've changed the udisks2 monitor to only show $XDG_RUNTIME_DIR mounts if they are in $XDG_RUNTIME_DIR/media

 http://git.gnome.org/browse/gvfs/commit/?id=60968576962f10212caf9e59a41ef0a9f77e6165

which resolves the problem mentioned in comment 13. Closing.
Comment 17 Tomas Bzatek 2012-02-21 16:12:38 UTC
*** Bug 669797 has been marked as a duplicate of this bug. ***
Comment 18 David Liang 2013-01-30 10:21:28 UTC
Hi, 
I have a question about the tempdir.
It is used only for file.XXXXXX right?
But in the code, it seems never reach the 301 line.
 294   file = virtual_node_new (name, VIRTUAL_NODE_FILE);
 295 
 296   if (backing_file != NULL)
 297     {
 298       file->backing_file = g_strdup (backing_file);
 299       file->owned_file = FALSE;
 300     }
 301   else
 302     {
 303       template = g_build_filename (backend->tempdir, "file.XXXXXX", NULL);
 304 

When the local_path is NULL, it will return immediately. 
 831   if (g_stat (local_path, &stat_buf) == -1)
 832     {
 839       return TRUE;
 840     }

Thanks,
David
(In reply to comment #0)
> Would be good to use the XDG runtime directory provided by
> g_get_user_runtime_dir() instead of /tmp for sockets etc.