Skip to content

http-host-autoupdate installs a cron file but does not install the cron daemon on minimal Ubuntu #127

Description

@MikaJKoi

Description

On a minimal Ubuntu 24.04 installation, the http-host-autoupdate command completes successfully and installs /etc/cron.d/ofm_http_host, but automatic synchronization never runs because the cron package is not installed.

The installer does not report an error or warning about the missing cron daemon.

Environment

  • Ubuntu 24.04 LTS minimal installation
  • OpenFreeMap commit: 8892fc6e1dd7433826c9e9b88f3b9915c7e7e135
  • Installation command:
python init-server.py http-host-autoupdate --user root -y SERVER_IP

Actual behavior

The cron file is installed correctly at:

/etc/cron.d/ofm_http_host

Its contents are:

* * * * * ofm /usr/bin/flock -n /tmp/http_host.lockfile -c 'sudo /data/ofm/venv/bin/python -u /data/ofm/http_host/bin/http_host.py sync >> /data/ofm/http_host/logs/http_host_sync.log 2>&1'

However, the cron service does not exist:

$ systemctl is-enabled cron
not-found

$ systemctl is-active cron
inactive

No automatic synchronization is executed and http_host_sync.log is not created.

Despite this, http-host-autoupdate exits successfully.

Expected behavior

Running http-host-autoupdate should install and enable the cron daemon, or fail with a clear error if no cron daemon is available.

Workaround

Installing and enabling cron fixes the issue:

sudo apt-get install -y cron
sudo systemctl enable --now cron

After this, the synchronization job runs successfully every minute and writes to:

/data/ofm/http_host/logs/http_host_sync.log

Suggested fix

Add cron to the base package list and ensure that the service is enabled:

sudo apt-get install -y cron
sudo systemctl enable --now cron

It may also be useful for http-host-autoupdate to verify that the cron service is active after installing /etc/cron.d/ofm_http_host.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions