How to add aroz online service.txt 879 B

123456789101112131415161718192021222324252627282930313233
  1. 1. CD into systemd service folder
  2. cd /etc/systemd/system/
  3. 2 Enable these two services
  4. sudo systemctl enable systemd-networkd.service systemd-networkd-wait-online.service
  5. 3. Create the file like arozos.service
  6. sudo nano arozos.service
  7. 4. Write the service content as follow (replace with your startup directories, use "/home/pi/arozos/src/" instead of "/home/pi/arozos/" if you are cloning from Github)
  8. [Unit]
  9. Description=ArozOS Cloud Service
  10. After=systemd-networkd-wait-online.service
  11. Wants=systemd-networkd-wait-online.service
  12. [Service]
  13. Type=simple
  14. ExecStartPre=/bin/sleep 10
  15. WorkingDirectory=/home/pi/arozos/
  16. ExecStart=/bin/bash /home/pi/arozos/start.sh
  17. Restart=always
  18. RestartSec=10
  19. [Install]
  20. WantedBy=multi-user.target
  21. 4. Start the service with
  22. sudo systemctl start arozos.service
  23. 5. Make it automatically startup during boot
  24. sudo systemctl enable arozos.service