LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Odd issue with creating a soft link (https://www.linuxquestions.org/questions/linux-newbie-8/odd-issue-with-creating-a-soft-link-4175487429/)

CamTheSaxMan 12-09-2013 06:10 PM

Odd issue with creating a soft link
 
I'm trying to make a program startup when I log in. The program is a shell script called "wicd-gtk" located in the /usr/bin directory, so I tried making a soft link to it in the /home/<user>/.config/autostart directory. However, I get a link to the /usr/bin directory instead.

So I ran this command:
Code:

ln -s /usr/bin/wicd-gtk /home/cameron/.config/autostart/wicd-gtk
I looked in the autostart directory and there was a symbolic link called wicd-gtk that links to the /usr/bin directory. I wanted it to link to /usr/bin/wicd-gtk, but it refused and linked it to /usr/bin instead.
However, if I specify a different name for the link by doing this:
Code:

ln -s /usr/bin/wicd-gtk /home/cameron/.config/autostart/donkeypoo
it works, and there is a link named donkeypoo in the autostart directory that points to /usr/bin/wicd-gtk . Of course, I can rename it from donkeypoo to wicd-gtk, but why do I have to go through all of this? Why doesn't it work when the names are the same?

EDIT: Oh, and by the way, the script refuses to start automatically. Why doesn't it start if it's in the autostart directory?

Spect73 12-09-2013 06:23 PM

I don't have that file, but I do have a file /usr/bin/weather that it a shell script. I can use it and get the proper results, i.e. I get the link under /home/mhobgood/.config/autostart/weather pointing back to /usr/bin/weather.

I will do some more checking and see if I can come up with anything. Not being real knowledgeable about links I'll have to do some reading. This gives me a perfect excuse to do so.

FWIW I'm running Slackware 14.1

CamTheSaxMan 12-09-2013 06:31 PM

Hmmm... odd. I just rebooted and it worked (meaning I could create the link). I literally copied and pasted the command into the terminal. Must have been some weird fluke.
But the script is still not autostarting. BTW, I'm using Debian "Wheezy" with the Enlightenment E16 window manager.

Spect73 12-09-2013 11:00 PM

Glad you got the link part to work. Nothing I read gave me a clue. All attempts to recreate the problem failed. I either got the link correctly, or I got an error when trying to create it.

As to why the script won't start, the only items I can think of are that it's not executeable or that it is actually being ran and you aren't seeing the display you expect to see.

rknichols 12-10-2013 07:38 AM

If the link name (last argument) exists and is a directory or a symlink to a directory, then your new link will be created in that directory and there would be no EEXIST error. You can also run into that problem if you are trying to use the "-f" option to replace an existing symlink. You would have to include the "-n" (--no-dereference) option to avoid following the existing symlink to a directory and placing your new symlink within that directory.


All times are GMT -5. The time now is 01:54 AM.