LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-23-2021, 05:36 AM   #1
buchinski
LQ Newbie
 
Registered: Jul 2021
Location: Belgium
Distribution: Debian, Ubuntu, Antix
Posts: 5

Rep: Reputation: Disabled
/run directory , what is it + multiple questions


When downloading photos directly from within a Gmail message, I noticed that instead of putting them in my home folder, Debian insisted on putting them time and again in /run/user/documents/1000/some_alphanumerical_name. Afterwards, I paid attention to always changing the download path to /home/Pictures, but if I do not do this, the system saves them in that /run directory. OK so...

1/ what does this run directory do? It only seems to save stuff in /run form within Gmail, not when downloading photos from a website
2/ it is filled with a lot of subdirectories, most of them empty. Can I just delete these files and directories in /run/user/ ?
3/ apparently they are created at boot, but do they ever get cleaned up, e.g. on a reboot?

The system is a Debian 10 buster, the browser I use is Firefox 88

Thanks in advance for any answers!
 
Old 07-23-2021, 06:23 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,650
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480
Quote:
Originally Posted by buchinski View Post
When downloading photos directly from within a Gmail message, I noticed that instead of putting them in my home folder, Debian insisted on putting them time and again in /run/user/documents/1000/some_alphanumerical_name. Afterwards, I paid attention to always changing the download path to /home/Pictures, but if I do not do this, the system saves them in that /run directory. OK so...
Once upon a time, when you plugged in a memory stick, you mounted it somewhere like /media/usb0 and that's where you put your downloaded pictures. Nowadays when you plug in a memory stick, your file manager automatically mounts it somewhere like /run/media/yourname/the_stick's_manuafacturer's_name. I don't like this but people coming over from Windows apparently prefer it that way. They are used to the system doing everything for them..
Quote:
1/ what does this run directory do? It only seems to save stuff in /run form within Gmail, not when downloading photos from a website
2/ it is filled with a lot of subdirectories, most of them empty. Can I just delete these files and directories in /run/user/ ?
3/ apparently they are created at boot, but do they ever get cleaned up, e.g. on a reboot?
This tree is for temporary files that are created after boot and scrapped before shutdown. It's all on a ramdisk so there's no point in deleting anything. Besides, some of those directories get used in specific circumstances.
 
Old 07-23-2021, 08:20 AM   #3
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,834
Blog Entries: 17

Rep: Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642
Quote:
Originally Posted by buchinski View Post
When downloading photos directly from within a Gmail message, I noticed that instead of putting them in my home folder, Debian insisted on putting them time and again in /run/user/documents/1000/some_alphanumerical_name. Afterwards, I paid attention to always changing the download path to /home/Pictures, but if I do not do this, the system saves them in that /run directory. OK so...

1/ what does this run directory do? It only seems to save stuff in /run form within Gmail, not when downloading photos from a website
2/ it is filled with a lot of subdirectories, most of them empty. Can I just delete these files and directories in /run/user/ ?
3/ apparently they are created at boot, but do they ever get cleaned up, e.g. on a reboot?

The system is a Debian 10 buster, the browser I use is Firefox 88

Thanks in advance for any answers!
https://refspecs.linuxfoundation.org...s/ch03s15.html
Quote:
3.15. /run : Run-time variable data
3.15.1. Purpose

This directory contains system information data describing the system since it was booted. Files under this directory must be cleared (removed or truncated as appropriate) at the beginning of the boot process.

The purposes of this directory were once served by /var/run. In general, programs may continue to use /var/run to fulfill the requirements set out for /run for the purposes of backwards compatibility. Programs which have migrated to use /run should cease their usage of /var/run, except as noted in the section on /var/run.

Programs may have a subdirectory of /run; this is encouraged for programs that use more than one run-time file. Users may also have a subdirectory of /run, although care must be taken to appropriately limit access rights to prevent unauthorized use of /run itself and other subdirectories. [17]
3.15.2. Requirements

Process identifier (PID) files, which were originally placed in /etc, must be placed in /run. The naming convention for PID files is <program-name>.pid. For example, the crond PID file is named /run/crond.pid.

The internal format of PID files remains unchanged. The file must consist of the process identifier in ASCII-encoded decimal, followed by a newline character. For example, if crond was process number 25, /run/crond.pid would contain three characters: two, five, and newline.

Programs that read PID files should be somewhat flexible in what they accept; i.e., they should ignore extra whitespace, leading zeroes, absence of the trailing newline, or additional lines in the PID file. Programs that create PID files should use the simple specification located in the above paragraph.

System programs that maintain transient UNIX-domain sockets must place them in this directory or an appropriate subdirectory as outlined above.
As to why your distro and browser saves them to /run I can only guess, but it might have something to do with HOW you "save" or "download" them perhaps. Normally these kind of things are first copied to /tmp, then moved to the specified location (/home/user/downloads). My guess is that you are not "downloading" them, but doing something else.
 
1 members found this post helpful.
Old 07-23-2021, 08:52 AM   #4
buchinski
LQ Newbie
 
Registered: Jul 2021
Location: Belgium
Distribution: Debian, Ubuntu, Antix
Posts: 5

Original Poster
Rep: Reputation: Disabled
Hi, thx for the replies and reference. So, if I put two and two together, I conclude:
1/ no worries, because it is all ramdisk and so the system creates and cleans it when needed
2/ nothing is significantly "wrong" with the system
3/ I will keep an eye on it to see which files it wants to save to /run

Zeebra may be on to something because the photos were included in a press release and amongst the options were "download" and "save to Drive" (= the windows cloud service). Now I am sure I clicked "download" but maybe it gets the images from "Drive".

So we learn something every single day.

If nothing has to be added further, we can consider this "solved"
 
Old 07-24-2021, 03:16 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by buchinski View Post
/run/user/documents/1000/some_alphanumerical_name
Are you sure about the "documents" part of the path? Because that's something I've never seen before.
In other words, I only ever get /run/user/1000/..." paths.
1000 is the numerical ID of my "normal" user, you can check with the 'id' command.

FWIW, File save dialogs often propose the last location you used for a particular filetype, so just telling it once to save the file elsewhere might fix it for subsequent saves.
 
1 members found this post helpful.
Old 07-24-2021, 12:31 PM   #6
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Often browsers have an option for the default download path.
Mine has a choice of a fixed path that I specify, or the last used directory.
That option can be found in the browser settings and can be changed to your preferred choice.

I find this setting in both firefox and chrome.
 
1 members found this post helpful.
Old 07-25-2021, 08:24 AM   #7
buchinski
LQ Newbie
 
Registered: Jul 2021
Location: Belgium
Distribution: Debian, Ubuntu, Antix
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
Are you sure about the "documents" part of the path? Because that's something I've never seen before.
In other words, I only ever get /run/user/1000/..." paths.
1000 is the numerical ID of my "normal" user, you can check with the 'id' command.

FWIW, File save dialogs often propose the last location you used for a particular filetype, so just telling it once to save the file elsewhere might fix it for subsequent saves.
You are right, I was working on my laptop and misquoted the path, the 1000 indeed comes first in the path, before the docs like for instance /run/user/1000/Docs/Y8AEM1456m

The "last used download location" is bypassed in that particular mail and that is what I found peculiar. Now, as far as I can tell the phenomenom only occurs on Debian10 (not on my laptop that runs Ubuntu) and only in certain press releases that are sent in some "mail chimp" style method. I will keep an eye on it.
 
Old 07-25-2021, 09:05 AM   #8
EdGr
Senior Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 1,000

Rep: Reputation: 472Reputation: 472Reputation: 472Reputation: 472Reputation: 472
/run/user/1000 is your $XDG_RUNTIME_DIR. See the description at https://specifications.freedesktop.o...ec-latest.html.

This directory is for small temporary files, sockets, and pipes. It is more secure than using /tmp.
Ed
 
2 members found this post helpful.
Old 07-25-2021, 09:25 PM   #9
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,679
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
Quote:
Originally Posted by EdGr View Post
This directory is for small temporary files, sockets, and pipes. It is more secure than using /tmp.
Ed
It also avoids some conflicts, since there's a more thought-out scheme for dividing the space among processes and users. It is "your" temporary area.
 
Old 07-27-2021, 03:08 AM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by buchinski View Post
The "last used download location" is bypassed in that particular mail and that is what I found peculiar. Now, as far as I can tell the phenomenom only occurs on Debian10 (not on my laptop that runs Ubuntu) and only in certain press releases that are sent in some "mail chimp" style method. I will keep an eye on it.
Could be a quirk of the mail client software used?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Tar multiple folder to multiple files to another directory and delete original folder zeroize Linux - Newbie 6 03-31-2016 07:36 PM
Multiple Autologins; Multiple Users; Multiple Sessions mrclisdue Linux - Desktop 1 09-26-2007 05:50 AM
Questions, Questions, Questions Nappa Slackware 6 11-18-2003 02:56 PM
questions,questions,questions harddrive37 Linux - Networking 1 07-21-2003 10:21 PM
Multiple multiple questions Werelock Linux - Newbie 8 08-22-2001 11:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration