add support for PATH in crontabs

Paul Fox pgf at foxharp.boston.ma.us
Mon Mar 7 17:40:42 UTC 2022


Well, it's been about 14 years since I last contributed to busybox.
I changed jobs back then, and no longer had a day-to-day need for
(or time for!) improvements.  But I've still used it often.  Nice
to see familiar names still. (Hi Denys!)

Today's fix is for something that's bitten me several times over the
years.  busybox crond doesn't allow setting PATH within a crontab. 
This wouldn't be so bad, except that many distros/devices that use
busybox don't provide for easy access to logging (and certainly not
email!) for errors.  It took me an embarrassing amount of time
yesterday to figure out why my command (from $HOME/bin) wasn't running
as expected, using piCorePlayer (based on Tiny Core Linux) on a
Raspberry Pi.

I've tested this with and without ENABLE_FEATURE_CROND_CALL_SENDMAIL,
as well as resetting PATH part way through a crontab, to see that the
changes only affect subsequent lines.

I'm afraid I can't remember how to generate the cool automatic size
diffs.  The code change seems to add fewer than 100 bytes, but I also
ifdefed a very old level 5 debug loop in Parsefield(), which saved
over 100.  So I think there's been a net shrinkage of about 30 bytes. 

paul
=----------------------
 paul fox, pgf at foxharp.boston.ma.us (arlington, ma)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-crond-implement-support-for-setting-PATH-in-crontab-.patch
Type: text/x-diff
Size: 4468 bytes
Desc: 0001-crond-implement-support-for-setting-PATH-in-crontab-.patch
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20220307/c6d8adda/attachment.patch>


More information about the busybox mailing list