[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    crontab -e doesn't work with vim
From:       mike b <michallinuxstuff () gmail ! com>
Date:       2019-10-07 14:12:39
Message-ID: CACosJgyfKg0R6ByhQQTVp_9-W1c_Yxi0Ricz0jq5526p_qY8kg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi!

It seems like vim and busybox's crontab don't get along. :D Basically, any
changes that are being made within the vim editor are not preserved after
the editor finishes. I quickly looked into source and it looks like,
somehow, bb_copyfd_eof() copies the old contents of the crontab.pid file
instead of the one that's been saved - so the end result is that the
crontab file is not changed at all. (I tried to do some dirty patching like
to re-open the src_fd right before the copyfd is called and that way
new_fname got all the changes).

Since I noticed that this doesn't seem to be a problem when you edit the
crontab file with busybox's vi or nano, I don't really know if it's a
strictly busybox's crontab problem (just thought I will drop it here to see
if anyone's seen something similar or has some ideas on what's the actual
problem).

Issue seen with busybox 1.24.1 and 1.30.1  used with Debian's (stretch) vim
package (8.0) (I don't have an output from strace but can attach it later
on if needed).

Btw, I also noticed that sendfile() complains returns EINVAL when it's used
for read|writitng the data between fds in this scenario - I can only guess
it's because O_APPEND is in use (according to sendfile's man it's not
supported).

Regards,
Michal

[Attachment #5 (text/html)]

<div dir="ltr">Hi!<div><br></div><div>It seems like vim and busybox&#39;s crontab \
don&#39;t get along. :D Basically, any changes that are being made within the vim \
editor  are not preserved after the editor finishes. I quickly looked into source and \
it looks like, somehow,  bb_copyfd_eof() copies the old contents of the crontab.pid \
file instead of the one that&#39;s been saved - so the end result is that the crontab \
file is not changed at all. (I tried to do some dirty patching like to re-open the  \
src_fd right before the copyfd is called and that way new_fname got all the changes). \
</div><div><br></div><div>Since I noticed that this doesn&#39;t seem to be a problem \
when you edit the crontab file with busybox&#39;s vi or nano, I don&#39;t really know \
if it&#39;s a strictly busybox&#39;s crontab problem (just thought I will drop it \
here to see if anyone&#39;s seen something similar or has some ideas on what&#39;s \
the actual problem).  </div><div><br></div><div>Issue seen with busybox 1.24.1 and \
1.30.1   used with Debian&#39;s (stretch) vim package (8.0) (I don&#39;t have an \
output from strace but can attach it later on if \
needed).</div><div><br></div><div>Btw, I also noticed that sendfile() complains \
returns EINVAL when it&#39;s used for read|writitng the data between fds in this \
scenario - I can only guess it&#39;s because  O_APPEND is in use (according to \
sendfile&#39;s man it&#39;s not \
supported).</div><div><br></div><div>Regards,</div><div>Michal</div><div><br></div><div><br></div></div>




_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic