Description of problem: Crontab does not work properly if emacs is used as the editor and $TMP is set to an alternate location (not /tmp). Version-Release number of selected component (if applicable): Red Hat 9 (not in 7.1 or 8.0) crontabs-1.10-5 emacs-21.2-33 How reproducible: Steps to Reproduce: 1.set $EDITOR or $VISUAL to emacs (if VISUAL is set it will be used rather than EDITOR) 2.set TMP to alternate location where you have writepermission (other than /tmp) 3.run crontab and make som change in your crontab. Actual results: crontab: no changes made to crontab Expected results: crontab: installing new crontab Additional info: the temp-file is actually in /tmp even if you do set $TMP to another value. emacs does not seem to exit with a strange return value (when I searched about the problem I found this link http://sources.redhat.com/ml/cygwin/2002-11/msg01468.html but the proposed solution gives a correct returnvalue of 0) Seems to be the same result if $TMP points to a legal directory (where you have write permission) or not. I do not get this on my RH 7.1 box with emacs-20.7-34, crontabs-1.9-2.
Perusing the vixie-cron source doesn't suggest that it supports using TMP at all. ICBW but at first glance it looks hardcoded to /tmp to me. Do you get any different with "EDITOR=vi"?
With EDITOR=vi it works fine. I only get the problem with emacs, not with vi or pico so it might be an error in emacs. But it seems like emacs does not terminate with an error code (when I made a test it returned a 0) so I don't know why cron doesn't think that the file has been changed. The file gets erased afterwards so vixie-cron apparently reads it but somehow it doesn't think it's updated. Were you able to reproduce following the three steps?
Here's what I see with vi: % ls -dl $HOME/tmp drwx------ 12 petersen petersen 4096 4æ 17 09:10 /home/petersen/tmp % EDITOR=vi TMP=$HOME/tmp crontab -e --- ~ ~ : ~ ~ "/tmp/crontab.10884" 1L, 30C --- For you the temp file isn't in "/tmp"?
As i wrote under "additional information", the temp-file is actually in /tmp even if you do set $TMP to another value. But still it does not update properly. Have you tried with emacs? As far as I know it's only the emacs- crontab-$TMP combination that doesn't work so testing with vi(or pico) will not give any problems
Thanks for the clarification - I thought the complaint was that TMP was being ignored. Yep, reproduced. Looks like you're right and it is related to the exit status of emacs.
Created attachment 91271 [details] Diff of straces with and without TMP set
I don't seem able to reproduce the non-zero exit code though by invoking from the commandline though.
When just invoking emacs I mean.
Ok, when I tried I got a normal exit code from emacs but maybe I missed something in how it's invoked from crontab. Should it be declassified as an emacs bug?
Not sure, it could be a vixie-cron bug, but I am the package maintainer of that too, so we can just leave it here for now I guess. (xemacs seems to be ok with crontab too.)
Hmm, I don't need able to reproduce this anymore with current rawhide (FC3 test releases). Could you try to test it with that?
Closing for now.