Crontab task since compilation

I am unable to set a crontab task since the firmware building. I tryied by placing a custom "root" file with the task in buildroot/files/var/spool/cron but I only obtained a firmware which freezes on boot with the message:

ubus - failed to chown(/var/run/ubus)

There is any (direct) way to achieve what I want?

Thanks!

Crontab isn't normally a system boot crash application as far as the config file goes. It either do the cron job or doesn’t do the cron job.

Build what version and to what device to be precise? And with what buildtool (image builder or source code)?

And you, to begin with get a working image without this files addon when you build?

Is there any other non standard setup/change in your build?

And, what job/task have you actually written in the file?

1 Like
./files/etc/crontab/root

I suspect you are breaking the boot link setup.

2 Likes

Version: v22.03.4
Device: TP-Link Archer C6 v3

I have a lot of customizations, I am running three daemons made by myself and custom configuration files, also some fixes (for example, the WPS button fix). The firmware works well if I remove the custom /var folder from buildroot/files , where was only created to include buildroot/files/var/spool/cron/root to schedule the task.

The task is a workaround for an unsolved bug in the WiFi of this device. The issue is detailed here.

In particular, the content of the "root" file which schedules the task is:

*/1 * * * * /usr/memory_check.sh

And the content of the script is:

#!/bin/ash

#Due to currently unknown issues, MT7621 targets experience infrequent complete memory consumption. 
#This leads to wifi and device crashing. This is possibly related to wifi driver issues under v22.03 releases 0 to 3. 
#Workaround test is implementing a free memory check that issues a wifi down & wifi up command in case of apparent memory consumption close to max. 

usedmem=$(free | grep "Mem" | cut -d' ' -f17)
freemem=$(free | grep "Mem" | cut -d' ' -f24)
#Archer C6v3 runs with 128MB RAM.
#Standard memory consumption fluctuates around 30MB.

if [ $usedmem -gt 75000 ]; then
    wifi
    echo "WARNING: Wifi restart due to excessive memory consumption"
    date >> /tmp/wifi_restart_log.txt
fi

All compiled via source code.

Thanks!

Placing the file in:

./files/etc/crontabs/root

Solved the issue.

But is not "crontab", is "crontabs".

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.