Scheduled runs and their time zone
Four MNC services run tasks on a schedule: Identity, the PKI, the Application Center and the Jobs service of the Service Center. Most of them clean up: they delete what has passed its retention period, or warn about something that is about to expire. The schedules are cron expressions with seconds; a run at a fixed time of day counts in the zone of the schedules.
The zone
Without a setting the schedules count in UTC, the same in every operating mode. The zone of the machine or the
container does not matter. You set another zone with the setting Jobs__TimeZone (in a configuration file
Jobs:TimeZone); the value is an IANA name such as Europe/Berlin or UTC.
- A name the system does not know ends the start of the service with exit code 78. The last line of its log names
the setting
Jobs:TimeZone(see "The service does not start" in the guide for your operating mode). - One process, one zone. The zone applies to all schedules of a service. Each of the four services reads it for itself; set the same value in all four, or the tasks of the services run by different clocks.
- With a zone that changes between summer and winter time, the time on the wall clock stays the same (03:15 stays
03:15) and the offset to UTC changes. What a run does whose time of day falls into the hour of the change has been
checked against the scheduler (
0 30 2 * * *inEurope/Berlin, changes on 28 March and 31 October 2027):- Spring (the clock jumps from 02:00 to 03:00): The time of day does not exist on that day. The run of that day does not happen and is not made up for; there are 47 hours between the two runs. There is no error message.
- Autumn (the clock jumps from 03:00 to 02:00): The time of day exists twice. The run happens once, on the second pass of the time of day; there are 25 hours between the two runs. If the next run is recalculated in the time between the two passes, the next run is the one of the following day, and the run of that day does not happen.
- Runs outside the hour of the change are not affected, and with UTC these cases do not exist.
With
Europe/Berlinthe runs of the PKI (02:15, 02:30, 02:45) fall into that hour: in spring they do not happen on the day of the change. If you do not want that, leave UTC in place.
- Tasks that run at fixed intervals (every five minutes, hourly, every six hours) do not depend on the zone.
What runs at which time
The times apply to the default, UTC; in another zone they are the same times in that zone.
| Service | Time | Task |
|---|---|---|
| Identity | 03:00 | remove unusable tokens and authorizations, delete self-registrations that were never confirmed |
| Identity | 03:10 | remove sign-in entries past their retention period |
| Identity | 03:20 | remove entries of the administrative audit trail past their retention period |
| Identity | every 5 minutes | remove security events, ended sign-ins and event streams nobody polls |
| PKI | 02:15 | remove refused issuances past their retention period |
| PKI | 02:30 | delete connector material in the trash and audit entries past their retention period |
| PKI | 02:45 | destroy the private keys of expired certificates and delete their records after the retention period |
| PKI | every 6 hours | ask the authority above whether the certificate of this authority is still good |
| PKI | every minute | import the trust anchors the installation names as files |
| PKI | hourly, 5 minutes past the hour | report authorities and trust anchors that are about to expire to the message channels |
| Application Center | 03:30 | remove refusals at the gate after 90 days |
| Application Center | 04:10 | clean up the inbox of downlink results past its window |
| Application Center | 05:00 | check the plugin sources for newer versions of installed plugins |
| Service Center (Jobs) | 00:00 | warn about application keys older than the configured maximum age |
| Service Center (Jobs) | 03:30 | remove expired certificates nothing refers to any more |
| Service Center (Jobs) | 06:00 | warn about certificates that are about to expire |
| Identity, PKI, Application Center | 03:45 | remove finished runs past their retention period (30 days unless set otherwise) from the log of scheduled runs |
The Service Center also runs at fixed intervals: it cleans up sessions (every 5 minutes), collects the status data of the Base Stations (every 30 seconds), cleans up downlinks without a result (every 15 minutes) and reports lost connections (every minute).
The next run named by the job overview in the Service Center is a point in time in UTC. Until the overview there counts in the configured zone, it only agrees with what the Jobs service does when the default, UTC, is in place.
Setting the zone
Set Jobs__TimeZone for these four services: identity, pki, applicationcenter and jobs.
Kubernetes. On install or upgrade, one chart value per service:
helm upgrade mnc ./mnc -n mnc --reuse-values \
--set services.identity.env.Jobs__TimeZone=Europe/Berlin \
--set services.pki.env.Jobs__TimeZone=Europe/Berlin \
--set services.applicationcenter.env.Jobs__TimeZone=Europe/Berlin \
--set services.jobs.env.Jobs__TimeZone=Europe/Berlin
The pods are replaced with the new setting.
Docker. Put a file compose.zeitzone.yaml next to compose.yaml:
services:
identity:
environment:
Jobs__TimeZone: Europe/Berlin
pki:
environment:
Jobs__TimeZone: Europe/Berlin
applicationcenter:
environment:
Jobs__TimeZone: Europe/Berlin
jobs:
environment:
Jobs__TimeZone: Europe/Berlin
docker compose -f compose.yaml -f compose.zeitzone.yaml up -d
Include the file in every later docker compose call.
Native Linux. Add the line Jobs__TimeZone=Europe/Berlin to /etc/noritec/mnc/identity.env, pki.env,
applicationcenter.env and jobs.env, and restart the services:
sudo systemctl restart noritec-mnc.target