make application go to the symlink

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

make application go to the symlink

Postby johng » Dec 11th, '11, 23:46

I have set my Document path to /home/john/Data using Systems Settings/Account Detail/Paths. /home/john/Data is a symlink in my home directory pointing to a directory on another partition, /sdb3/Data.

When using Mandriva applications go to the symlink (ie /home/john/Data). When using Mageia, applications go to /sdb3/Data.

How do I make Mageia applications go to the symlink, and not to where it's pointing?
johng
 
Posts: 61
Joined: Dec 1st, '11, 11:42

Re: make application go to the symlink

Postby doktor5000 » Dec 12th, '11, 01:47

Huh? Actually you do a symlink, to use the object which it's pointing at, under another name.
I.e. there is no differentiation between the name and the target for the symlink, how could there be?

Could you please explain or reword this problem?
And for reference, would you please show the output of
Code: Select all
ls -la /home/john/Data
and
Code: Select all
ls -la /home/john
?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18066
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: make application go to the symlink

Postby johng » Dec 12th, '11, 05:14

/sdb3/Data is where my files are saved.

/home/john/Data is a symlink

Using Mandriva, applications (by default) look at /home/john/Data

Using Mageia, applications (by default) look at /sdb3/Data

Although it might appear to not matter, the two OS function differently. Both 'Data' directories have the same files, but that's not the point. On the /home/john partition there are different directories either side of the Data directory compared with the corresponding Data directory on /sdb3. Most applications first look at Documents, which in my case is named Data. Sometimes I need to access another directory on /home/john, which I can do with two clicks on Mandriva, but on Mageia I have to go up the sdb3 directory tree to root and then down the Mandriva tree.
johng
 
Posts: 61
Joined: Dec 1st, '11, 11:42

Re: make application go to the symlink

Postby JoesCat » Dec 15th, '11, 05:19

The "other" partition must be mounted first.
Since the "other" partition is part of a Mandriva partition, rather than it's own separate partition, it would make sense to mount it somewhere out of the ordinary.

Go to the command line and create a new directory.
Code: Select all
su
password: ********
cd /mnt
md /mnt/mandriva
exit


Next, you want this existing partition to be mounted. Either copy fstab to your home directory, edit it, and re-save it, or edit it on the spot. I'll use kwrite here (don't forget the "-" after su. Go to the command line, edit the file:
Code: Select all
su -
password: ********
cd ~
kwrite /etc/fstab
exit


In kwrite, add a new mount location:
/sdb3 /mnt/mandriva defaults

I'm doing this from memory, so it's likely incorrect. Please use man fstab to see proper method to add options on the added line.

Save the edited /etc/fstab file so that it gets mounted on boot next time.

Next, check that it works. On the command line:
Code: Select all
su
password: ********
mount /mnt/mandriva
ls -l /mnt/mandriva


You should see the mandriva "/" directory at this point. If not, review where you might have gone wrong up above.

Next, you need to make sure that the user and group id values are the same for John (on Mandriva), and John (on Mageia). If they are the same, then that is good, you can provide a simple link. If not, you need to decide if you want to change the user ID on Mandriva, Mageia, or if you want to change the data to permission "other" =6 or 7.

Assuming that John was user 500 on Mandriva, and also 500 on Mageia, the next step is simple. remove the Data you have right now, and next, create the symlink.
Code: Select all
cd ~
ln -s /mnt/mandriva/home/John/Data /home/John/Data


Should work, but not tested, so, sorry about any typo errors above if you find them.
User avatar
JoesCat
 
Posts: 177
Joined: Sep 15th, '11, 04:27
Location: Richmond, BC, Canada

Re: make application go to the symlink

Postby johng » Dec 15th, '11, 07:25

Thank you for your detailed reply.

Unfortunately you have misunderstood the situation.

I have three partitions: one has Mageia OS, one has Mandriva OS, the other (sdb3) has the Data directory.

When using Mandriva, I have a symlink named /home/john/Data pointing at /sdb3/Data. When I set the Document path to /home/john/Data using Systems Settings/Account Detail/Paths, Applications look at /home/john/Data

When using Mageia, I have a symlink named /home/john/Data pointing at /sdb3/Data. When I set the Document path to /home/john/Data using Systems Settings/Account Detail/Paths, Applications look at /sdb3/Data

In other words, why do symlinks in Mandriva and Mageia function differently, and how do I make Mageia symlinks function like they do in Mandriva?
johng
 
Posts: 61
Joined: Dec 1st, '11, 11:42

Re: make application go to the symlink

Postby Ken-Bergen » Dec 15th, '11, 08:53

Sorry but I don't see the problem /home/john/Data and /sdb3/Data are the same thing. :shock:
Ken
Ken-Bergen
 
Posts: 1019
Joined: Mar 30th, '11, 02:45
Location: Chilliwack, BC, Canada

Re: make application go to the symlink

Postby johng » Dec 15th, '11, 09:34

THEY ARE NOT
johng
 
Posts: 61
Joined: Dec 1st, '11, 11:42

Re: make application go to the symlink

Postby JoesCat » Dec 15th, '11, 11:50

Okay, the more information you provided here, the more it makes sense.
So, what we're talking about is relative and absolute paths.
You're asking to display/see relative path, but you're shown/given absolute path.

Are we talking about only KDE? If yes, are we talking about Konqueror? or Dolphin?
Is this also affecting the command line?
When you mention Mandriva, are you using KDE 4.3? When using Mageia, is it using KDE 4.6.5?
User avatar
JoesCat
 
Posts: 177
Joined: Sep 15th, '11, 04:27
Location: Richmond, BC, Canada

Re: make application go to the symlink

Postby wobo » Dec 15th, '11, 12:41

johng wrote:THEY ARE NOT

Yes, they are. Difference is: one is a mere symlink (/home/john/Data) while the other (dev/sdb3/Data) is the real place where the data is stored. I am doing this all the time. I have one large data partition and with all installations on my machine (Mageia, Mandriva, Ubuntu) I replace the default folders in /home/wobo with symlinks to the matching folders on that data partition. Works with all, no problems. I do not care where the applications look because it does not matter.
wobo
---
And a new day will dawn for those who stand long
And the forests will echo with laughter
(Stairway to Heaven, Led Zeppelin)
User avatar
wobo
 
Posts: 1649
Joined: Mar 22nd, '11, 17:13

Re: make application go to the symlink

Postby doktor5000 » Dec 15th, '11, 12:59

Ken-Bergen wrote:Sorry but I don't see the problem /home/john/Data and /sdb3/Data are the same thing. :shock:

That's what i've already mentioned:
doktor5000 wrote:Huh? Actually you do a symlink, to use the object which it's pointing at, under another name.
I.e. there is no differentiation between the name and the target for the symlink, how could there be?


Seems the problem of the OP is the change in behavior as i understood:

johng wrote:Although it might appear to not matter, the two OS function differently. Both 'Data' directories have the same files, but that's not the point. On the /home/john partition there are different directories either side of the Data directory compared with the corresponding Data directory on /sdb3. Most applications first look at Documents, which in my case is named Data. Sometimes I need to access another directory on /home/john, which I can do with two clicks on Mandriva, but on Mageia I have to go up the sdb3 directory tree to root and then down the Mandriva tree.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18066
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: make application go to the symlink

Postby johng » Dec 15th, '11, 13:03

Thank you JoesCat, I think you're onto it.

Yes Mandriva is using KDE 4.3 and Mageia KDE 4.6.5. It's not about Konqueror/Dolphin/command line. It's about opening/saving in applications like Kwrite/Gwenview/Gqview/Okular/Gimp, which I guess boils down to relative versus absolute paths. Where is that defined?
johng
 
Posts: 61
Joined: Dec 1st, '11, 11:42

Re: make application go to the symlink

Postby JoesCat » Dec 16th, '11, 11:55

Okay, I sort of ran into something like this myself but I didn't think much about it then. I thought it was perhaps normal behaviour between different partitions (for me it was a link to a SDcard), but since you have a good example where you're seeing the differences, it is worth looking into this further.
Using your example, I created a new user, then changed "System Settings->"Account Details"->/home/user/Documents to /home/user/xyz where xyz was a symlink to another directory on another partition. The problem is there, tried Kwrite, Gimp, Okular and a couple other programs, and instead of showing the relative /home/user/xyz/* it was showing the absolute location as per root "/"

Going to google, I first found this:
http://trueg.wordpress.com/2011/12/07/symbolic-links-in-nepomuk-a-solution/ is a recent blog which indicates that trueg migrated a lot of relative to absolute links. It seems there was some problems with doing one method, while the other method worked. What you'll also notice is a reference to Symlink handling in the blog.

Searching further, there are a couple more references to symlink and KDE, and they seem to circle around KDE 4.3 http://forum.kde.org/viewtopic.php?f=22&t=84150, http://forum.kde.org/brainstorm.php#idea84173_page1. This solution to "To me it seems like this is coming from a Windows point of view with Windows shortcuts" may possibly be where someone else's good idea becomes the problem you see now. ...and another 4.3 link... https://bugs.kde.org/show_bug.cgi?id=215069. ...and another... http://lists.kde.org/?l=kfm-devel&m=114190404731491.

There are other references, but what it seems is that this may be a solution for some users (people familiar to a Windows environment), but becomes a problem for others. Looking around, I don't see any visible way of toggling this, and it looks like this might be worth starting a bug report or a request for a feature with KDE. Using KDE 4.6.5 (Mageia 1) as an example, the problem seems to be in "kcmshell4 desktoppath" which could probably use an optional toggle (relative/abolute) if the path entered/found is a symlink.

I don't know if there is a current solution, and this may be something built-in into KDE 4.6.
Best place to fix this is KDE itself.
You noticed this bug (or lack of an option).
Do you want to initiate a bug-fix request on kde.org?
(If yes, can you also give a reference number here)

This isn't really related to the above in terms of KDE, but I'm going to throw this in here as a reference to Bash since it appeared during the search for the info above (http://www.linuxquestions.org/questions/linux-newbie-8/symbolic-links-to-directories-mystery-898683/).
User avatar
JoesCat
 
Posts: 177
Joined: Sep 15th, '11, 04:27
Location: Richmond, BC, Canada

Re: make application go to the symlink

Postby doktor5000 » Dec 16th, '11, 14:03

I think reporting this at KDE will end as WONTFIX or INVALID as the described behavior would be correct.
But as you don't seem to believe others how symlinks normally should behave, do what you think works best for you.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18066
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: make application go to the symlink

Postby linuxero » Dec 16th, '11, 16:31

Hi johng;

I tried to reproduce the problem on my machine..maybe you should consider what JoesCat wrote about the way your data partition is mounted in each distro.. I have no problem at all on my computer and both distros work identically..

My guess is the mount.

Good luck, please update when solved
linuxero
 
Posts: 345
Joined: Oct 7th, '11, 15:50

Re: make application go to the symlink

Postby JoesCat » Dec 18th, '11, 00:44

When I tried this, home/user was on a reiserfs partition and the symlink pointed to a directory on an ext4 partition.

Looking at some of the titles describing problems (https://bugs.kde.org/buglist.cgi?quicksearch=symlink), Some symlink problems may need to be worked at a higher level like the kernel, so maybe using absolute probably resolves some problems.
User avatar
JoesCat
 
Posts: 177
Joined: Sep 15th, '11, 04:27
Location: Richmond, BC, Canada

Re: make application go to the symlink

Postby johng » Dec 18th, '11, 01:37

I think JoesCat has summed it up when he attributed the effect to KDE 4.6.5, since the phenomenon is apparent only with "KDE" applications. It's not related to partition mounting (all relevant partitions are mounted on boot similarly on each OS). I have not tried absolute v. relative symlinks (cos I don't know how they are determined). In the meantime I'll set my symlink Data path to /home/john, which will suffice. Sometimes it is sufficient to know a "problem" does not have a simple cure.

Hi All, thank you for your contributions.
johng
 
Posts: 61
Joined: Dec 1st, '11, 11:42

Re: make application go to the symlink

Postby JoesCat » Dec 18th, '11, 09:29

Hi johng,
FYI, KDE isn't the only desktop experiencing this symlink thing, for example: http://brainstorm.ubuntu.com/idea/23667/.

I've added a wishlist to KDE http://bugs.kde.org/show_bug.cgi?id=289255.
Please add yourself to it too if you think it is something you want to see happen, but please remember, these things take time if followed-up (we went from KDE 4.3 to 4.8 before noticing this effect, so it may be KDE 4.9 or later if this is followed-up - it all depends on priorities, and more important or easier to-do stuff happens sooner).
User avatar
JoesCat
 
Posts: 177
Joined: Sep 15th, '11, 04:27
Location: Richmond, BC, Canada

Re: make application go to the symlink

Postby linuxero » Dec 18th, '11, 15:15

johng wrote:I think JoesCat has summed it up when he attributed the effect to KDE 4.6.5, since the phenomenon is apparent only with "KDE" applications. It's not related to partition mounting (all relevant partitions are mounted on boot similarly on each OS). I have not tried absolute v. relative symlinks (cos I don't know how they are determined). In the meantime I'll set my symlink Data path to /home/john, which will suffice. Sometimes it is sufficient to know a "problem" does not have a simple cure.

Hi All, thank you for your contributions.


I am a KDE user and could not reproduce the problem..! But still could be due to KDE. I, myself, have many problems with KDE, this is not one of them, though. :)

We all know how computers and systems tend to complicate us life comporting unexpectedly from on machine to another ;)
linuxero
 
Posts: 345
Joined: Oct 7th, '11, 15:50

Re: make application go to the symlink

Postby johng » Dec 18th, '11, 22:04

Thank you JoeCat. I had a look at the posting. It wasn't obvious how to add myself. Is it obvious upon registration and logging in??
johng
 
Posts: 61
Joined: Dec 1st, '11, 11:42

Re: make application go to the symlink

Postby doktor5000 » Dec 18th, '11, 22:21

Either comment on it or just add yourself to the CC list, in the field directly below the last comment, look for Add CC.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18066
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: make application go to the symlink

Postby morgano » Jan 5th, '12, 10:56

At home & work Mandriva since 2006, Mageia 2011. Thinkpad T40, T43, T60, T400, T510, Dell M4400, M6300, Acer Aspire 7. Workstation using LVM, LUKS, VirtualBox, BOINC
morgano
 
Posts: 1494
Joined: Jun 15th, '11, 17:51
Location: Kivik, Sweden


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest