Command to restart?

Hi!
Our viewer hangs every now and then (usually after a few weeks uptime) and Netdata reports that the RPi is running out of memory. So I’m currently thinking about running a cron command to restart Anthias. What would be the best and cleanest command to run?

// Henrik

This is what I do. My builds on Pi 3b+ reboot everyday at 6am via cron job. The PI4 builds have more memory so this isn’t as bad but I still reboot to freshen them up daily.

Okay, but do you know what command to run if I just want to restart screenly/Anthias and not reboot the Pi?

Kind regards and tnx for your reply!

Anthias in its current form is all docker containers. For a pi with limited resources, your better off just rebooting the whole pi.

You can issue sudo shutdown -h 0 (manually) or setting up a reboot schedule in crontab with the following:

  • sudo crontab -e
  • and put this line 0 6 * * * /usr/sbin/shutodwn -r now. This is how I do it!

If you really want to reboot the containers one by one then:

*list out the containers with: docker ps -a -q

*$ docker restart <container …> (container is the container name or id)
*or just reboot all containers together: $ docker restart $(docker ps -a -q)

@henrik, @extremeskillz

I recommend using Option 2. upgrade_containers.sh sets the necessary environment variables needed by the Anthias services.

Using Docker Compose (Option 1)
cd /home/$USER/screenly
docker compose restart
Using Docker Compose (Option 2)
cd /home/$USER/screenly
docker compose down && ./bin/upgrade_containers.sh