Try   HackMD

[Linux]Enable service on startup

ref

Dock service

  • service path

    • /etc/systemd/system/pos-dock.service
    ​​​​[Unit]
    ​​​​Description=NewPOS dock
    ​​​​After=network.target
    ​​​​
    ​​​​[Service]
    ​​​​Type=forking
    ​​​​User=tk3c
    ​​​​Group=tk3c
    ​​​​WorkingDirectory=/home/tk3c/
    ​​​​ExecStart=/home/tk3c/venv_mposkit/bin/python3 -m mposkit tk3c
    ​​​​TimeoutSec=infinity
    ​​​​
    ​​​​[Install]
    ​​​​WantedBy=multi-user.target
    
  • Reload services

    ​​​​sudo systemctl daemon-reload
    
  • Enable the service

    ​​​​sudo systemctl enable pos-dock.service
    
  • Start the service

    ​​​​sudo systemctl start pos-dock.service
    
  • Check the status of your service