Following this blog post about administering a RPi with AWS Systems Manager:
https://aws.amazon.com/blogs/mt/manage-raspberry-pi-devices-using-aws-systems-manager/
...I have installed and enabled the service with systemd:
$ sudo systemctl enable amazon-ssm-agent.service
$ systemctl status amazon-ssm-agent.service
● amazon-ssm-agent.service - amazon-ssm-agent
Loaded: loaded (/lib/systemd/system/amazon-ssm-agent.service; enabled; vendor preset: enabled)
Active: inactive (dead)
$ sudo systemctl start amazon-ssm-agent.service
$ systemctl status amazon-ssm-agent.service
● amazon-ssm-agent.service - amazon-ssm-agent
Loaded: loaded (/lib/systemd/system/amazon-ssm-agent.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2019-05-07 14:56:49 BST; 3s ago
Main PID: 3357 (amazon-ssm-agen)
CGroup: /system.slice/amazon-ssm-agent.service
└─3357 /usr/bin/amazon-ssm-agent
May 07 14:56:49 raspberrypi systemd[1]: Started amazon-ssm-agent.
May 07 14:56:49 raspberrypi amazon-ssm-agent[3357]: Initializing new seelog logger
May 07 14:56:49 raspberrypi amazon-ssm-agent[3357]: New Seelog Logger Creation Complete
The service starts, runs, works (in that I can remotely admin the box) - but when I come to reboot the RPi, the service does not get started on startup- even though it's enabled:
$ systemctl status amazon-ssm-agent.service
● amazon-ssm-agent.service - amazon-ssm-agent
Loaded: loaded (/lib/systemd/system/amazon-ssm-agent.service; enabled; vendor preset: enabled)
Active: inactive (dead)
This is the systemd definition (defined by the Amazon .deb package install):
$ cat /lib/systemd/system/amazon-ssm-agent.service
[Unit]
Description=amazon-ssm-agent
After=network-online.target
[Service]
Type=simple
WorkingDirectory=/usr/bin/
ExecStart=/usr/bin/amazon-ssm-agent
KillMode=process
Restart=on-failure
RestartSec=15min
[Install]
WantedBy=network-online.target
Note that network-online.target stuff - that target doesn't seem to be getting activated, even though ethernet is active and works:
$ systemctl status network-online.target
● network-online.target - Network is Online
Loaded: loaded (/lib/systemd/system/network-online.target; static; vendor preset: enabled)
Active: inactive (dead)
Docs: man:systemd.special(7)
http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget
What's the 'right' way to get this service running on startup?
System information
$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
I also have a PCF8523 RTC installed so that the RPi always has the right time.