Making the CAM-AI server autostart and autonomous from your terminal

Making a Raspi server autostart

This is a tutorial for adding autostart functionality to a CAM-AI server (Raspi or PC). We assume that the server was installed following these instructions.

When you use your surveillance camera and the CAM-AI server for real-life applications, it is important to make sure that the system restarts completely after a reboot or a power outage. This can be achieved by making a Linux system service that starts the CAM-AI server. Here is how this works. Following this procedure, your CAM-AI server will run independently from your PC’s terminal.

Log into your server as user cam_ai. If the name of your machine is different from cam-ai-raspi (cam-ai-debian for example), replace this term with the real name or the IP address.

First, you create a service definition file:

Then you add the following content to that file:

You save the file and close Nano. After that, you create the directory and bash file:

If the directory already exists, you will get an error message, never mind…

Then you add the following content to that file: One line is different for servers running on PC hardware. For Debian PCs replace the red line with:

source ~/miniconda3/etc/profile.d/conda.sh

Save the file and leave Nano. Then you make the new file executable and enable the newly created service:

It’s done. Your server will now autostart your server automatically.

Discuss this topic in our Forum

Scroll to Top