Bug 90981 - "crontab -e" edition fails when /tmp is a symlink
"crontab -e" edition fails when /tmp is a symlink
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: vim (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Karsten Hopp
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-05-15 21:57 EDT by Marc MERLIN
Modified: 2007-11-30 17:06 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-10-19 15:36:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Marc MERLIN 2003-05-15 21:57:40 EDT
I did
crontab -e

it popped up $EDITOR (vim), I added a line, saved, and crontab tells me
that I didn't make changes and exits

An strace shows
[WIFEXITED(s) && WEXITSTATUS(s) == 0], 0, NULL) = 16748
fstat64(6, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
write(2, "crontab: no changes made to cron"..., 36crontab: no changes made to
crontab
) = 36
unlink("/tmp/crontab.16747")            = 0
brk(0)                                  = 0x8052000
brk(0x8054000)                          = 0x8054000
time([1053049805])                      = 1053049805
getpid()                                = 16747
rt_sigaction(SIGPIPE, {0x420db0d0, [], SA_RESTORER, 0x420276f8}, {SIG_DFL}, 8) = 0
send(3, "<78>May 15 18:50:05 crontab[1674"..., 59, 0) = 59
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
exit_group(0)
Comment 1 Garry Optland 2003-07-16 00:13:19 EDT
marc_soft, is your /tmp directory a symlink by any chance? I have just built two
RH9.0 servers, and on one the /tmp directory links to /var/tmp. It has the same
problem with editing a crontab. The other one without the link works fine.
Comment 2 Marc MERLIN 2003-07-16 00:41:13 EDT
Yes, we also found out that the problem is that /tmp is a symlink.

But the best part is that it works with EDITOR=emacs, but not EDITOR=vim
Comment 3 Marc MERLIN 2003-07-31 14:36:55 EDT
I found the fix:
I symlinked /tmp to /var/tmp/tmp, and I had to modify vimrc as such:
" for crontab -e to work
set backupskip=/tmp/*,/var/tmp/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*

This started breaking with vim 6 (it worked before)

While this isn't a bug, it's quite tough to spot. Maybe it should be in the
release notes or something.
Comment 4 Jens Petersen 2003-07-31 18:33:58 EDT
Re-assigning to vim.
Comment 5 Bastien Nocera 2004-05-25 05:32:45 EDT
Reassigning to RHEL 3, as the problem still happens on that version.
Comment 6 Chris Faulhaber 2004-10-05 11:29:45 EDT
I am also having this problem but after going to the source of 
crontab.c it appears that pixie crontab is working properly and it is 
a problem with vim. (I see it has been reassigned)

It appears that vim assigns a new I-node to the saved or new version 
of the crontab entry only if /tmp is a symlink. If /tmp is not a 
symlink then the I-node remains constant as the command crontab 
expects. 

Hope this is helpful,
Chris
Comment 7 Marc MERLIN 2004-10-05 11:45:16 EDT
If you read the comments, you'll see that I already gave the solution :)
set backupskip=/tmp/*,/var/tmp/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*
                      ^^^^^^^^^^^^^^^
whatever your symlink points to

It's just an issue of documenting this somewhere as it's a change that
can be non trivial to spot
Comment 9 Stephen Rasku 2005-08-18 15:39:35 EDT
I added the backupskip variable as described in comment 7.  The only difference
is I changed /var/tmp/tmp to /usr/tmp since that is what my /tmp directory is
symlinked to.  However it didn't fix the problem.  I still was unable to save
the crontab.
Comment 10 RHEL Product and Program Management 2007-10-19 15:36:10 EDT
This bug is filed against RHEL 3, which is in maintenance phase.
During the maintenance phase, only security errata and select mission
critical bug fixes will be released for enterprise products. Since
this bug does not meet that criteria, it is now being closed.
 
For more information of the RHEL errata support policy, please visit:
http://www.redhat.com/security/updates/errata/
 
If you feel this bug is indeed mission critical, please contact your
support representative. You may be asked to provide detailed
information on how this bug is affecting you.

Note You need to log in before you can comment on or make changes to this bug.