Services

What this is about

Your server permanently runs several background programs, called services: the Calaos server itself, but also the additional services such as MQTT or Zigbee, and system maintenance tasks.

In normal operation you do not have to deal with them: they start on their own at power-on and stop at shutdown. This page will mostly be useful the day something stops responding.

These settings are not available from the touchscreen: connect to the server over SSH (see SSH access).

The services you will come across

Here are the ones you will actually need, with their exact names:

ServicePurpose
calaos-serverThe heart of your home automation: it drives your devices and applies your rules
calaos-homeThe local interface displayed on the touchscreen
calaos-containerThe service that starts and supervises all the additional services
mosquittoMQTT messaging
zigbee2mqttZigbee gateway
influxdbHistory of your measurements
grafanaGraphs
haproxyRouting of incoming connections
hue2mqttPhilips Hue gateway
envoyEnphase solar inverters
oladDMX lighting

The most important service is calaos-server: if your home automation stops responding entirely, that is where to start.

systemctl status calaos-server
systemctl restart calaos-server

calaos-server and calaos-home are two different things. If the touchscreen is frozen but your mobile applications still respond, calaos-home is the one to restart, and your home automation never stopped working.

See what is running

To list the active services:

systemctl list-units --type=service

The left column gives the name of each service, and the following columns show whether it is working properly. Look for failed: that is the sign of a broken service.

To see only what is going wrong:

systemctl --failed

If this command returns nothing, all is well.

One single way to do things, for every service

The additional services (MQTT, Zigbee, history, graphs…) run in containers, but that changes nothing for you: they are driven by the system like all the others.

In other words, systemctl sees and manages them in exactly the same way, and the commands on this page apply to them without distinction:

systemctl status zigbee2mqtt
systemctl restart zigbee2mqtt

So there are not two sets of commands to remember depending on the service.

These services are presented in detail on the Services and modules page.

Restart a service

If a service stops responding, restarting it is often enough to fix the problem:

systemctl restart SERVICE_NAME

replacing SERVICE_NAME with the name found in the list.

To see the detailed state of a service, and in particular the reason for a failure:

systemctl status SERVICE_NAME

The last log lines of the service are shown underneath, which usually gives a clue. See also Logs.

Restart the whole server

When several things seem disturbed, a full restart is often quicker than diagnosing service by service:

reboot

Allow a minute before your home automation responds again.

Going further

Calaos OS enables several automatic maintenance tasks, which run on their own and normally need no attention from you:

TaskPurpose
snapper-timeline.timerRegularly creates restore points
snapper-cleanup.timerDeletes the oldest restore points
btrfs-scrub@.timerPeriodically checks the integrity of the data on the disk
fstrim.timerMaintains SSD drives
grub-btrfsd.serviceKeeps the list of restore points offered at boot up to date

To enable or disable a service at boot:

systemctl enable SERVICE_NAME
systemctl disable SERVICE_NAME

Do not disable the maintenance tasks above: they are what makes rollbacks possible and what keeps the disk from filling up with restore points.