Feature #669


Add cron job to retrieve device state in monitor.

Added by Hammel over 5 years ago. Updated over 5 years ago.

Target version:
Start date:
23 Aug 2018
Due date:
% Done:


Estimated time:
03 - Medium


I need a tool that causes imrest to retrieve device state and update it's cache. This requires a cron job or C program that is authorized to make that request. That means the API must only allow local connections (loopback). The API just iterates over registered devices, calls their get state API and the updates their cached data.

Related issues

Related to Sensors - Bug #672: deviceGet() needs to validate request by decoding itClosedHammel02 Sep 2018

Actions #1

Updated by Hammel over 5 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

/usr/sbin/crond is available in the core platform. However, it is not started at boot time. Also, there is no /var/spool/cron directory (there is no /var/spool, for that matter).

  1. Find or create (likely) an init script for crond
    1. Add it to Ironman's www packaging
  2. Create /var/spool/cron in in core platform.

Then I'm ready to add a cron entry to poll the REST server, eg

0-59 * * * * wget

This needs to go into a file for root so the postinst script for the www package will have to check for the root entry. If it's there, check if this entry exists. If it's not there or the entry doesn't exist append/create the entry.

Actions #2

Updated by Hammel over 5 years ago

  • % Done changed from 10 to 30

Added cron init script to core platform Buildroot skeleton tree and pushed upstream. Tested on hardware and it works fine. The init script takes care of creating the required directories if they aren't there.

Actions #3

Updated by Hammel over 5 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 30 to 100

I simplified this just to get it done quickly. I created a root crontab file and added it to the packaging. If I ever need to extend this from another package I'll have to be more clever about iwget but for now, this works.

Tested, committed and pushed.

Closing issue. Note that this is just the cron entry. The support for actually doing the state updates is tracked separately.


Also available in: Atom PDF