Sym-Link help....

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

Sym-Link help....

Postby linuxgirlie » Fri Jul 08, 2005 8:31 am

I am trying to create a sym-link that everyone can use but it won't let me put in a variable, can anyone help me out.

What I am typing is:

ln -s $HOME/network /usr/share/windowsapps/.wine/dosdevices/h:

Everytime I do this it changes $HOME to say /root/

Will I have to look for another way round my problem? Or has someone got anything I can give a go!!

Cheers, :? :?
My knowledge comes with no warranty...........

Server operating system designed for schools:http://www.linuxschools.com
linuxgirlie
LXF regular
 
Posts: 787
Joined: Sat Apr 09, 2005 6:34 pm
Location: Kent...UK

Postby evilnick » Fri Jul 08, 2005 8:59 am

that's because the shell will evaluate the variables as it finds them, so when you run this as root, that is your home directory.

You can't really have a symlink that is evaluated on demand. However, you could create a symlink individually for each user. Does that help?
User avatar
evilnick
Moderator
 
Posts: 151
Joined: Mon Apr 04, 2005 11:47 am
Location: LXF towers

Postby linuxgirlie » Fri Jul 08, 2005 9:01 am

Hmmm, thats a good idea, I'll just give that a try and answer back....
My knowledge comes with no warranty...........

Server operating system designed for schools:http://www.linuxschools.com
linuxgirlie
LXF regular
 
Posts: 787
Joined: Sat Apr 09, 2005 6:34 pm
Location: Kent...UK

Postby linuxgirlie » Fri Jul 08, 2005 9:18 am

Well, it works, but for only one person!!

As it won't let the second person write over the top of the one made by the last person.

Is there a way of making a sym-link read-write to all. Because at the moment if one person logs in and creates the link, when the second person logs in they don't get a drive as they can't write over the top of the last sym-link?!?

I'm sure there must be an easier way to all this!!
My knowledge comes with no warranty...........

Server operating system designed for schools:http://www.linuxschools.com
linuxgirlie
LXF regular
 
Posts: 787
Joined: Sat Apr 09, 2005 6:34 pm
Location: Kent...UK

Postby Nigel » Fri Jul 08, 2005 9:34 am

Assuming that the users don't already have a directory called "network" under their home dir, putting the following into the system-wide login script (/etc/profile.local on SuSE, could be different for you) will probably do the trick...

if !(test -e $HOME/network); then
ln -s /usr/share/windowsapps/.wine/dosdevices/h $HOME/network
fi

(I believe that the target comes first in the ln command)
Last edited by Nigel on Fri Jul 08, 2005 9:36 am, edited 1 time in total.
Hope this helps,

Nigel.
User avatar
Nigel
LXF regular
 
Posts: 1141
Joined: Fri Apr 08, 2005 8:03 pm
Location: Gloucestershire, UK

Postby linuxgirlie » Fri Jul 08, 2005 9:35 am

Thanks, it now works for references purposes I'll put down what I did:

Basically we are designing a fat client. When the student logs on it brings all their work etc down via samba, this makes it easier when intergrating with other windows clients.

Anyhow, because of this when they click logoff it runs a script that shuts down all the samba shares.

So I first wrote a script in autorun that said to make the sym-link in the correct place, then when they logoff they run the second script which at the top says rm -f /usr/share/windowsapps/.wine/dosdevices/h:

and thats it, so when the next person logs in it has no problems.....

Cheer for pointing me in the right direction Nick.
My knowledge comes with no warranty...........

Server operating system designed for schools:http://www.linuxschools.com
linuxgirlie
LXF regular
 
Posts: 787
Joined: Sat Apr 09, 2005 6:34 pm
Location: Kent...UK

Postby linuxgirlie » Fri Jul 08, 2005 9:36 am

oops, sorry Nigel, must of posted that whilst I was typing, thanks for the help anyway.

Jo
My knowledge comes with no warranty...........

Server operating system designed for schools:http://www.linuxschools.com
linuxgirlie
LXF regular
 
Posts: 787
Joined: Sat Apr 09, 2005 6:34 pm
Location: Kent...UK

Postby Nigel » Fri Jul 08, 2005 9:41 am

Aha - sorry, I thought you were trying to get the network directory in the user's home to point to the (fixed) windows share, not the other way round.
User avatar
Nigel
LXF regular
 
Posts: 1141
Joined: Fri Apr 08, 2005 8:03 pm
Location: Gloucestershire, UK

Postby linuxgirlie » Fri Jul 08, 2005 9:46 am

Yes, well I have been working on this project and this is the 4th day solid, I have nearly, nearly got it finished!!

Basically its a Fat Linux Client, but the school wants to be able to run certain windows software on it, hence I have been racking my brains about Wine for the last day and a half!
My knowledge comes with no warranty...........

Server operating system designed for schools:http://www.linuxschools.com
linuxgirlie
LXF regular
 
Posts: 787
Joined: Sat Apr 09, 2005 6:34 pm
Location: Kent...UK

Postby evilnick » Fri Jul 08, 2005 11:14 am

cool, glad you got it sorted.
User avatar
evilnick
Moderator
 
Posts: 151
Joined: Mon Apr 04, 2005 11:47 am
Location: LXF towers


Return to Help!

Who is online

Users browsing this forum: No registered users and 1 guest