This post covers the steps necessary to get AWS Greengrass to start at system boot on a Raspberry Pi 3+ running Raspbian Stretch. The Greengrass software was at version 1.6.0.
I don’t cover the Greengrass installation or configuration process here. It is assumed that has already been done. Refer to this tutorial for details.
What we are going to do here is use systemd to run Greengrass on system boot.
Step 1
Navigate to the systemd/system folder on the Raspberry Pi.
cd /etc/systemd/system/
Step 2
Create a file called greengrass.service in the systemd/system folder using the nano text editor.
sudo nano greengrass.service
Copy in to the file the contents described in this document.
Save the file.
Step 3
Change the permissions on the file so they are executable by root.
sudo chmod u+rwx /etc/systemd/system/greengrass.service
Step 4
Enable the service.
sudo systemctl enable greengrass
Step 5
You can now start the Greengrass service.
sudo systemctl start greengrass
You can check that Greengrass is running.
ps –ef | grep green
Reboot the system and check that Greengrass started after a reboot.