Page 1 of 1

Quota deletion / Crontabs reset. Bug ?

Posted: Tue Aug 30, 2016 10:05 pm
by d3fz
Hi there,

i was poking around with the Quotas section the other day, and i found something strange.

I´ve set my router to reboot every day at 5am, and out of nowhere, it simply stopped rebooting. Then i remembered i've added and deleted some quotas the day before, so i took a closer look.

This is my default /etc/crontabs/root file with no active quotas:

Code: Select all

0,1,11,21,31,41,51 * * * * /usr/bin/set_kernel_timezone >/dev/null 2>&1
0 5 * * * sh /usr/lib/gargoyle/reboot.sh
After adding the first (and only) quota rule, and then clicking 'Save Changes', /etc/crontabs/root now looks like this:

Code: Select all

0,1,11,21,31,41,51 * * * * /usr/bin/set_kernel_timezone >/dev/null 2>&1
0 5 * * * sh /usr/lib/gargoyle/reboot.sh

0 0,4,8,12,16,20 * * * /usr/bin/backup_quotas >/dev/null 2>&1
0 0,4,8,12,16,20 * * * /tmp/bw_backup/do_bw_backup.sh
So far, so good. I can add and delete another quotas, click 'Save Changes' and there's no problem. But as soon as i delete all of them, or the only active quota, and then 'Save Changes', i lose all my schedule tasks in Crontabs.

This is what /etc/crontabs/root looks like after that:

Code: Select all

0 0,4,8,12,16,20 * * * /tmp/bw_backup/do_bw_backup.sh
Is this a bug or an expected behavior ? Can anyone else confirm this ?

I'm running Gargoyle 1.9.X (Built 20160714-0844 git@9b75d12) on a TP-Link TL-WR842N/ND v2.

Re: Quota deletion / Crontabs reset. Bug ?

Posted: Wed Aug 31, 2016 1:35 am
by Lantis
Absolutely a bug. Thanks for pointing it out. :)
I'm just testing now but i believe i've fixed it.
I expect this has been a longstanding issue that has been in gargoyle since its inception and gone unnoticed.

Re: Quota deletion / Crontabs reset. Bug ?

Posted: Wed Aug 31, 2016 9:43 pm
by d3fz
Thank you for fixing it so quickly, Lantis. Glad i could help.