clicon / clixon-controller

Clixon network controller
Apache License 2.0
13 stars 4 forks source link

Start pyapi from backend using systemd #8

Closed olofhagsand closed 1 year ago

olofhagsand commented 1 year ago

Proposal is to wrap systemd functions and add config to starting and monitoring the pyapi daemon.

Proposal config:

   container pyapi {
       description "Python API action daemon";
       leaf enabled {
          description "If set, start pyapi daemon";
          type boolean;
          default false;
       }
       leaf status {
          config false;
          description "True if pyapi daemon is running";
          type boolean;
       }
    }

Proposal systemd

[Unit]
Description=Starts and stops Clixon PyAPI
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
User=clicon
RestartSec=1
Restart=always
ExecStart=/usr/local/bin/clixon_server.py -F -P -d -m /usr/local/share/clixon/modules/
[Install]
WantedBy=multi-user.target
olofhagsand commented 1 year ago

Invalid and closed: pyapi is now started as a sub-process to the backend. (The backend itself may be started with systemd)