[Unit] Description=Home Automation initialization [Service] User=pi Group=pi # If the gpioset commands indirectly issued by this service fail, such that the command: # # systemctl status home-automation.service # # shows messages such as: # # gpioset: error setting the GPIO line values: Permission denied # # then this service may be running before the system is ready. In that case, wait for the system # to catch up. The wait (sleep) time depends on the particular Raspberry Pi board, and the OS. # # For example: # - no delay was necessary for a Raspberry Pi 1B+ board running Bullseye # - no delay was necessary for a Raspberry Pi 3B+ board running Bookworm # - a 15 second delay worked well with a Raspberry Pi 1B+ board running Bookworm # # Comment-out the following "TimeoutStartSec" and "ExecStartPre" lines if no delay is necessary. TimeoutStartSec=infinity ExecStartPre=/usr/bin/sleep 15 ExecStart=/home/pi/bin/hainit & RemainAfterExit=true [Install] WantedBy=multi-user.target