exim 4.54-1 and broken symlinks

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

exim 4.54-1 and broken symlinks

Krzysztof Duleba-2
Hi

There's something wrong with exim package and exim-config. It creates
/usr/sbin/sendmail.exe, which links to /bin/exim.exe, which doesn't exist.
There is /bin/exim, which links to /bin/exim-4.54-1.exe, but Cygwin .exe
magic doesn't apply here, so programs depending on /usr/sbin/sendmail
(like pine) doesn't work. Renaming /bin/exim to /bin/exim.exe fixed the
problem.

Krzysztof Duleba



--
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/

Reply | Threaded
Open this post in threaded view
|

Re: exim 4.54-1 and broken symlinks

Pierre A Humblet
----- Original Message -----
From: "Krzysztof Duleba"
To: <[hidden email]>
Sent: Thursday, December 08, 2005 7:36 AM
Subject: exim 4.54-1 and broken symlinks


> Hi
>
> There's something wrong with exim package and exim-config. It creates
> /usr/sbin/sendmail.exe, which links to /bin/exim.exe, which doesn't exist.
> There is /bin/exim, which links to /bin/exim-4.54-1.exe, but Cygwin .exe
> magic doesn't apply here, so programs depending on /usr/sbin/sendmail
> (like pine) doesn't work. Renaming /bin/exim to /bin/exim.exe fixed the
> problem.
>
> Krzysztof Duleba

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?

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/

Reply | Threaded
Open this post in threaded view
|

Re: exim 4.54-1 and broken symlinks

Krzysztof Duleba-2
Pierre A. Humblet

> 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.

Krzysztof Duleba



--
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/

Reply | Threaded
Open this post in threaded view
|

Re: exim 4.54-1 and broken symlinks

Krzysztof Duleba-2
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



--
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/

Reply | Threaded
Open this post in threaded view
|

Re: exim 4.54-1 and broken symlinks

Pierre A Humblet
----- Original Message -----
From: "Krzysztof Duleba"
To: <[hidden email]>
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/

Reply | Threaded
Open this post in threaded view
|

Re: exim 4.54-1 and broken symlinks

Krzysztof Duleba-2
Pierre A. Humblet wrote:

> 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.

And ln -s -f a b produces b ==> a if a.exe doesn't exist yet.

> 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.

I've checked some other computers and those symlinks don't have .exe
suffix there.

> 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.

In my case it wasn't. Anyway, I prefer to turn off a service for a
moment before an update rather than reboot afterwards.

> 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.

After the initial update (the unsuccessful one), even after rebooting,
/bin/exim.exe was a symlink to the old version of exim executable.
Reinstalling exim 4.54-1 (with exim turned off this time) fixed it.

> 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.

Well, if it's not that then I don't have a clue. I guess we can forget
about it - I don't have time to dig into it and try to find an
explanation (or even to reproduce it) and it doesn't seem really
serious, too.

Thanks,
Krzysztof Duleba



--
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/

Reply | Threaded
Open this post in threaded view
|

Re: exim 4.54-1 and broken symlinks

Eric Blake (cygwin)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Krzysztof Duleba on 12/12/2005 3:35 AM:
>
> And ln -s -f a b produces b ==> a if a.exe doesn't exist yet.

You are correct that the behavior of cygwin ln in the presence of symlinks
has not been consistent in the past.  I think the current behavior (in
5.3.0-9 or 5.93-1) is the most sane - if linking to an existing file, .exe
is appended to the link if the existing file had .exe; otherwise, nothing
is done.  There is also the cygwin-specific --disable-exe-magic option to
bypass .exe magic when creating symlinks.

Beyond that, once a symlink was created (either by the packager, or by a
postinstall script) with inconsistent use of .exe using an older version
of ln, or by creating the symlink before the .exe, you will run into these
potential issues.

Let me know if I need to do any further looking into the behavior of ln,
or whether this particular symlink issue is taken care of by
reinstallation and/or improved exim postinstall scripts.

- --
Life is short - so eat dessert first!

Eric Blake             [hidden email]
volunteer cygwin coreutils maintainer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDnXkp84KuGfSFAYARAh9fAJ4hL738QgCab8YuVrmo1oKq9MAKcQCcDAah
C386z5tdnTH2wtWxACq4nCE=
=IDSY
-----END PGP SIGNATURE-----

--
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/

Reply | Threaded
Open this post in threaded view
|

Re: exim 4.54-1 and broken symlinks

Pierre A Humblet
At 06:20 AM 12/12/2005 -0700, Eric Blake wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>According to Krzysztof Duleba on 12/12/2005 3:35 AM:
>>
>> And ln -s -f a b produces b ==> a if a.exe doesn't exist yet.
>
>You are correct that the behavior of cygwin ln in the presence of symlinks
>has not been consistent in the past.  I think the current behavior (in
>5.3.0-9 or 5.93-1) is the most sane - if linking to an existing file, .exe
>is appended to the link if the existing file had .exe; otherwise, nothing
>is done.  There is also the cygwin-specific --disable-exe-magic option to
>bypass .exe magic when creating symlinks.

As long as "ln -s a.exe b" produces b ==> a.exe (and not b.exe), exim is OK.

>Let me know if I need to do any further looking into the behavior of ln,
>or whether this particular symlink issue is taken care of by
>reinstallation and/or improved exim postinstall scripts.

I think we are OK. The 4.60 version of exim released today has a postinstall
script that deletes any offending exim.exe symlink. Also exim-config now
detects if an exim.exe symlink or file masks the exim symlink and it acts
appropriately.

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/