Problem with execute by symbolic link

New to Debian (Or Linux in general)? Ask your questions here!

Problem with execute by symbolic link

Postby JimSturgess » 2017-12-05 15:33

I would like execute file by symbolic link.

Destination file: /usr/bin/wine-development

So, I call:

ln -sf /usr/bin/wine-development /usr/local/bin/wine

When I run: wine-development --version it works, but when I call wine --version I get an error message:

error: unable to find wine executable. this shouldn't happen.

why the link does not work ?

(this problem appears only with wine, for any other files link is properly)
JimSturgess
 
Posts: 4
Joined: 2017-12-05 14:11

Re: Problem with execute by symbolic link

Postby Segfault » 2017-12-05 15:59

You forgot to tell us whether /usr/local/bin is in your $PATH.
Segfault
 
Posts: 557
Joined: 2005-09-24 12:24

Re: Problem with execute by symbolic link

Postby JimSturgess » 2017-12-05 16:20

Segfault wrote:You forgot to tell us whether /usr/local/bin is in your $PATH.


Unfortunately, this can not be the cause of the problem, because problem occurs even if the link is in the same directory.

moreover problem occurs only with wine , for any other file link work


for examle, I wrote:

ln -sf /usr/bin/bitmap /usr/local/bin/bitmap-tmp

and it works, I can execute file by "bitmap" and "bitmap-tmp"

but it doesnt work for link to "wine-development"
JimSturgess
 
Posts: 4
Joined: 2017-12-05 14:11

Re: Problem with execute by symbolic link

Postby bw123 » 2017-12-05 18:36

the 'which' command is sometimes helpful in situations like this

problem occurs even if the link is in the same directory


$PATH will take precedence unless you use ./whateverthelinknameis to run from the pwd

I don't use wine, but did it work before you installed wine-development? if you are following a web guide, maybe share the link and someone else can find the error.
User avatar
bw123
 
Posts: 2473
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Problem with execute by symbolic link

Postby Segfault » 2017-12-05 19:41

$PATH will not exactly take precedence. Your wording is kind of unlucky. Actually in POSIX systems the executables in current directory won't be found at all, unless you specify with "./". This is considered a security measure, makes harder to execute malicious binaries instead of legit ones.
Segfault
 
Posts: 557
Joined: 2005-09-24 12:24

Re: Problem with execute by symbolic link

Postby JimSturgess » 2017-12-05 20:22

bw123 wrote:the 'which' command is sometimes helpful in situations like this


$PATH is correct.

when I call "which wine", I receive

/usr/local/bin/wine

When I call "ls -la" in /usr/local/bin I receive:

lrwxrwxrwx 1 root staff 25 dec 5 21:56 wine -> /usr/bin/wine-development

in spite of all, "wine-development" works but "win" doesnt.

I do not know where the problem is
JimSturgess
 
Posts: 4
Joined: 2017-12-05 14:11

Re: Problem with execute by symbolic link

Postby debiman » 2017-12-06 10:08

maybe /usr/bin/wine-development is just another wrapper script.
Code: Select all
cat /usr/bin/wine-development
User avatar
debiman
 
Posts: 1626
Joined: 2013-03-12 07:18

Re: Problem with execute by symbolic link

Postby pendrachken » 2017-12-08 16:45

Not a big wine user anymore but a few things to check:

Is wine-development a binary file, script, or symlink itself?

If it is a script, does it have a proper shebang? is it trying to launch a subshell? - the whole "file: wine not found" hints at the possibility that it is a launcher script. If it is a script try inling directly to the wine binary in the path that the script uses.

If it is a symlink itself can you try linking to the binary it links to. Nesting symlinks can be messy and it is best to limit symlink nests.
fortune -o
Your love life will be... interesting.
:twisted: How did it know?

The U.S. uses the metric system too, we have tenths, hundredths and thousandths of inches :-P
pendrachken
 
Posts: 1291
Joined: 2007-03-04 21:10
Location: U.S.A. - WI.

Re: Problem with execute by symbolic link

Postby debiman » 2017-12-09 09:47

this is a doublepost, i think it was also on LQ.
it was solved there: the wrapper script tries to launch something else with the name it was called with ($0, i.e. "wine" instead of "wine-development"), which results in the file not found error.

PS:
oh, hello pendrachken, long time no see! :mrgreen:
User avatar
debiman
 
Posts: 1626
Joined: 2013-03-12 07:18


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable