View previous topic :: View next topic |
Author |
Message |
Gooberpatrol66 Tux's lil' helper
Joined: 20 Jul 2014 Posts: 143
|
Posted: Sat Dec 01, 2018 5:31 am Post subject: NFS KDE freezing issue |
|
|
When I have an NFS share mounted and lose connection, my entire DE freezes. I can only assume this is because KDE is using the storage for something. Anyone else encounter this? Any way to prevent it? |
|
Back to top |
|
|
Perfect Gentleman Veteran
Joined: 18 May 2014 Posts: 1246
|
Posted: Sat Dec 01, 2018 5:56 am Post subject: |
|
|
Quote: | Anyone else encounter this? |
Yep
Quote: | Any way to prevent it? |
Keep connection alive |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Sat Dec 01, 2018 12:16 pm Post subject: |
|
|
Before you start KDE: is XDG_CACHE_HOME defined and does it point to a directory on a local filesystem or (even better) on a tmpfs? |
|
Back to top |
|
|
Gooberpatrol66 Tux's lil' helper
Joined: 20 Jul 2014 Posts: 143
|
Posted: Sat Dec 01, 2018 5:57 pm Post subject: |
|
|
Perfect Gentleman wrote: | Quote: | Anyone else encounter this? |
Yep
Quote: | Any way to prevent it? |
Keep connection alive |
That sucks. XFCE doesn't do this.
Quote: | Before you start KDE: is XDG_CACHE_HOME defined and does it point to a directory on a local filesystem or (even better) on a tmpfs? |
It's empty. |
|
Back to top |
|
|
asturm Developer
Joined: 05 Apr 2007 Posts: 8935
|
Posted: Sat Dec 01, 2018 5:59 pm Post subject: |
|
|
Where is that NFS share mounted exactly? There's not a lot of info here to begin with. |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Sat Dec 01, 2018 6:35 pm Post subject: |
|
|
Quote: | Quote: | Before you start KDE: is XDG_CACHE_HOME defined and does it point to a directory on a local filesystem or (even better) on a tmpfs? |
It's empty.
|
What is empty? The environment variable XDG_CACHE_HOME? Or the directory, to which XDG_CACHE_HOME points?
If the environment variable XDG_CACHE_HOME is not set or if it's empty, add the lines below to ~/.profile or ~/.bash/profile:
Code: | TEMP_BASE_DIR="/tmp/temp-${USER}"
if ! test -d "${TEMP_BASE_DIR}"
then
mkdir -m 0700 "${TEMP_BASE_DIR}"
fi
for SUB_DIR in cache thumbnails runtime
do
if ! test -d "${TEMP_BASE_DIR}/${SUB_DIR}"
then
mkdir -m 0700 "${TEMP_BASE_DIR}/${SUB_DIR}"
fi
done
export XDG_CACHE_HOME="${TEMP_BASE_DIR}/cache" |
|
|
Back to top |
|
|
Gooberpatrol66 Tux's lil' helper
Joined: 20 Jul 2014 Posts: 143
|
Posted: Sun Dec 02, 2018 11:11 pm Post subject: |
|
|
asturm wrote: | Where is that NFS share mounted exactly? There's not a lot of info here to begin with. |
/media/store |
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3922 Location: Hamburg
|
Posted: Mon Dec 03, 2018 8:16 am Post subject: |
|
|
mike155 wrote: |
Code: | TEMP_BASE_DIR="/tmp/temp-${USER}"
if ! test -d "${TEMP_BASE_DIR}"
then
mkdir -m 0700 "${TEMP_BASE_DIR}"
fi
for SUB_DIR in cache thumbnails runtime
do
if ! test -d "${TEMP_BASE_DIR}/${SUB_DIR}"
then
mkdir -m 0700 "${TEMP_BASE_DIR}/${SUB_DIR}"
fi
done
|
| Why not sth like Code: | mkdir -m 0700 -p a/{b,c,d} |
|
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21601
|
Posted: Tue Dec 04, 2018 2:14 am Post subject: |
|
|
While OP arguably does not care about permissions (since the older fragment does not change permissions on preexisting directories), there is a slight problem with using -p: mkdir only respects -m for the directories you requested directly. Example: Code: | $ (umask 022; mkdir -m700 -p a/b)
$ find . -printf '%m %p\n'
755 .
755 ./a
700 ./a/b | As a workaround, a slight modification to toralf's command: Code: | $ (umask 022; mkdir -m700 -p a/{,b})
$ find . -printf '%m %p\n'
755 .
700 ./a
700 ./a/b | The comma immediately after the opening brace causes the parent directory to be an explicit target, so the -m affects it. |
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3922 Location: Hamburg
|
Posted: Tue Dec 04, 2018 8:35 am Post subject: |
|
|
Interesting hint, FWIW this seems to be enough here: Code: | mkdir -m 0700 -p a/{,b,c,d}; |
|
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Tue Dec 04, 2018 11:23 pm Post subject: |
|
|
@toralf: you are right: a simple mkdir statement is better then the code I posted. Thank you for pointing that out!
On the other hand, it's not that simple.
Hu already showed that 'mkdir -m 0700 -p a/{b,c,d}' may create 'a' with wrongs permissions. Adding a comma (e.g. 'mkdir -m 0700 -p a/{,b,c,d};') seems to help, but leads to the next problem. It's not self-explaining - and it's error-prone. The next user who edits the statement will see a list inside the curly braces and he may think: why does this list start with a comma??? Well, maybe there was something in front of the comma, my colleague deleted it, but he forgot to delete the comma - so let's remove it...
The version I like best is:
Code: | mkdir -m 0700 -p a a/b a/c a/d
|
A better version of my recommendation posted above is: if your home directory is located on a network volume and if the environment variable XDG_CACHE_HOME is not set or if it's empty, add the lines below to ~/.profile or ~/.bash/profile:
Code: | TEMP_BASE_DIR="/tmp/temp-${USER}"
mkdir -m 0700 -p \
"${TEMP_BASE_DIR}" \
"${TEMP_BASE_DIR}/cache" \
"${TEMP_BASE_DIR}/runtime" \
"${TEMP_BASE_DIR}/thumbnails"
export XDG_CACHE_HOME="${TEMP_BASE_DIR}/cache" |
|
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21601
|
Posted: Wed Dec 05, 2018 2:37 am Post subject: |
|
|
I dislike repeating the parent directory name. If you are worried someone will mangle your brace expansion list, leave a comment explaining why the leading comma is correct.
How do you handle the case that the directory cannot be created because someone else already created it with incompatible permissions? As shown, your mkdir will fail, then you will set the environment variable anyway. |
|
Back to top |
|
|
|