exim 4.54-1 and broken symlinks

Pierre A. Humblet Pierre.Humblet@ieee.org
Thu Dec 8 21:23:00 GMT 2005


----- Original Message ----- 
From: "Krzysztof Duleba"
To: <cygwin@cygwin.com>
Sent: Thursday, December 08, 2005 2:02 PM
Subject: Re: exim 4.54-1 and broken symlinks


> Krzysztof Duleba wrote:
>
>>> Hum, I just installed the latest exim on a new machine and can't 
>>> reproduce
>>> what you describe. exim-config created
>>> lrwxrwxrwx  1 p-humblet sw 13 Dec  8 10:10 /usr/sbin/sendmail -> 
>>> /usr/bin/exim*
>>> (no .exe anywhere) , as one would expect from the line
>>>     ln -s -f  /usr/bin/exim /usr/sbin/sendmail &&
>>>
>>> Could there be a problem with your ln?
>>
>> Yes, you're right, the problem is with ln, *.exe magic and exim using 
>> symlink to a symlink. I also think that updating exim (setup.log shows 
>> that I had exim-4.52-2 installed) could do some damage, I'm not sure how, 
>> though. Anyway, it's nothing wrong with Cygwin exim package, as it 
>> appears.
>
> OK, now I know the reason. I forgot to reboot my computer after the update 
> and then I ran exim-config. Things were messed up. Finally I rebooted, but 
> it didn't help much and exim -bV still showed wrong version number (why?). 
> Reinstalling exim fixed that, but didn't fix the broken symlink (I 
> restored it to previous broken state earlier on).
>
> I think there should be some check in the setup that warns *before* 
> upgrading services that are running. Are there plans for such a feature?
>
> Krzysztof Duleba

I still don't understand how the .exe got to appear...
What I observe here is that if a.exe exists, then
ln -s a b produces b.exe ==> a.exe  (weird to me)
However ln -s a.exe b produces b ==>a.exe
So that explains how sendmail.exe appears when
exim.exe exists, but doesn't explain how /bin/exim.exe
appeared in the first place.

Perhaps a previous version of ln behaved differently.
In that case you might have
/bin/exim.exe ==> /bin/exim-old.exe
/bin/exim       ==> /bin/exim-new.exe
To resolve the filename "exim", path.cc in Cygwin searches
for exim, exim.exe, exim.exe.lnk and exim.lnk,
stopping when it finds an existing file.
Thus both "exim" and "exim.exe" resolve to
/bin/exim-old.exe
That would explain what you observed.

You may amuse yourself by typing
ln -s /bin/yes y      (produces y.exe.lnk)
ln -s /bin/ls.exe y   (produces y.lnk)
and then ./y

Anybody else has a symlink /usr/bin/exim.exe
and/or /usr/sbin/sendmail.exe ?
If so I will fix things in the postinstall of the next
exim release, coming out soon.

Regarding your remark about setup, it should be OK to
install a new exim-Y.exe, while the previous exim-X.exe is
still running.  Setup will set the /bin/exim symlink to point
to exim-Y.exe.
exim-X will keep running until it re-execs following a kill -HUP,
or until a reboot (assuming that cygrunsrv is using the
/bin/exim symlink). Then you get exim-Y.exe.
Doing it that way you can get your server to operate non-stop
through an update. However I am not sure if the old exim-X.exe
is going to be deleted.
Also, each time you run exim-config, it checks if /bin/exim is
executable. If not, it sets the symlink to the most recent version
in  /bin/exim*.exe.
So, I don't see how forgetting to reboot after an upgrade and
then running exim-config could mess up things. exim-config
should see that exim is running and ask if you want to stop
it. If you answer no, exim-X.exe keeps running. Otherwise
it stops and next time you get exim-Y.exe In no case is the
symlink affected.

Pierre





--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list