When using a shell session provided by SSM, the PATH variable only includes base system directories: /sbin:/bin:/usr/sbin:/usr/bin The path should also include: /usr/local/sbin:/usr/local/bin:/home/ssm-user/bin I have fixed this in my own environment by adding the following line to /usr/local/etc/rc.d/amazon-ssm-agent: export PATH=${PATH}:/usr/local/sbin:/usr/local/bin:/home/ssm-user/bin
Can you confirm if adding this line instead works? I think this is the more "rc.d" way of setting PATH in the environment from an rc.d script: : ${amazon_ssm_agent_env="PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/home/ssm-user/bin"}
Yes - your version works great. I was not aware of that technique. Thanks!
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=639c5484460ad18b8acfe8d259f2ef08158438ba commit 639c5484460ad18b8acfe8d259f2ef08158438ba Author: Colin Percival <cperciva@FreeBSD.org> AuthorDate: 2021-12-18 05:11:53 +0000 Commit: Colin Percival <cperciva@FreeBSD.org> CommitDate: 2021-12-18 05:14:39 +0000 sysutils/amazon-ssm-agent: Add missing $PATH The SSM Agent can be used to effect a login shell; set $PATH appropriately for interactive logins. PR: 260476 Reported by: amendlik at gmail Sponsored by: https://www.patreon.com/cperciva sysutils/amazon-ssm-agent/Makefile | 2 +- sysutils/amazon-ssm-agent/files/amazon-ssm-agent.in | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
Thanks, committed.