Autostart Devices

From ago control wiki
Revision as of 18:11, 29 October 2013 by Dinki (Talk | contribs)

Jump to: navigation, search

Autostart Devices

Here is an example on creating a service to automatically start your custom device driver:

As root, copy your custom file to /opt/agocontrol/bin . Change the file permissions so that the file has read and execute permissions :

chmod a+rx /opt/agocontrol/bin/

Create a new file in /lib/systemd/system/ called agohumidity.service :

Description=ago control Weather Device



Change the filename, description and ExecStart to match the needs of your device driver.

Next, enable the service:

systemctl enable agohumidity.service

Then, start the service:

systemctl start agohumidity.service

Finally, ensure that the service is running:

root@debian# systemctl status agohumidity.service
agohumidity.service - ago control Weather Device
          Loaded: loaded (/lib/systemd/system/agohumidity.service; enabled)
          Active: active (running) since Wed, 31 Dec 1969 18:00:26 -0600; 43 years and 9 months ago
        Main PID: 361 (python)
          CGroup: name=systemd:/system/agohumidity.service
                  â 361 python /opt/agocontrol/bin/

You can temporarily stop the service by using:

systemctl stop agohumidity.service

To permanently disable the service use:

systemctl disable agohumidity.service
Personal tools