Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
NFS KDE freezing issue
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Gooberpatrol66
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jul 2014
Posts: 143

PostPosted: Sat Dec 01, 2018 5:31 am    Post subject: NFS KDE freezing issue Reply with quote

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
View user's profile Send private message
Perfect Gentleman
Veteran
Veteran


Joined: 18 May 2014
Posts: 1246

PostPosted: Sat Dec 01, 2018 5:56 am    Post subject: Reply with quote

Quote:
Anyone else encounter this?

Yep
Quote:
Any way to prevent it?

Keep connection alive
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Sat Dec 01, 2018 12:16 pm    Post subject: Reply with 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?
Back to top
View user's profile Send private message
Gooberpatrol66
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jul 2014
Posts: 143

PostPosted: Sat Dec 01, 2018 5:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 8935

PostPosted: Sat Dec 01, 2018 5:59 pm    Post subject: Reply with quote

Where is that NFS share mounted exactly? There's not a lot of info here to begin with.
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Sat Dec 01, 2018 6:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
Gooberpatrol66
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jul 2014
Posts: 143

PostPosted: Sun Dec 02, 2018 11:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3922
Location: Hamburg

PostPosted: Mon Dec 03, 2018 8:16 am    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21601

PostPosted: Tue Dec 04, 2018 2:14 am    Post subject: Reply with quote

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
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3922
Location: Hamburg

PostPosted: Tue Dec 04, 2018 8:35 am    Post subject: Reply with quote

Interesting hint, FWIW this seems to be enough here:
Code:
mkdir -m 0700 -p a/{,b,c,d};
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Tue Dec 04, 2018 11:23 pm    Post subject: Reply with quote

@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
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21601

PostPosted: Wed Dec 05, 2018 2:37 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum