merging FreeBSD patches
I've submitted PRs for three of the patches I needed to get the SSM Agent running on FreeBSD -- #19 to work around a signedness difference between Linux and FreeBSD, and #20 and #18 to have the Agent recognize FreeBSD and report the version number (but PlatformTypeLinux since the SSM API doesn't accept that FreeBSD exists).
I will be submitting PRs soon to add FreeBSD build code to the makefile.
This will leave me with just changes to some paths: In agent/appconfig/constants_unix.go, DefaultProgramFolder and DefaultDataStorePath; in agent/log/log_unix.go, DefaultSeelogConfigFilePath. On FreeBSD we put configuration files for such non-base-system software under /usr/local/etc/ rather than /etc/, and we don't have /var/lib/ so I moved DefaultDataStorePath to /var/run/ (although /var/db/ might be more appropriate -- does the information the agent stores here need to persist across reboots?). Since these changes are specific to FreeBSD's filesystem hierarchy you won't want them as they are right now, and it may be easier to carry them as local FreeBSD changes rather than having the Agent pick which variant of the paths to use.
Thanks @cperciva As discussed, your code has been merged internally, we will have them reviewed and tested. Will update this issue once we completes the release.
Regards, Shihua
Hi @cperciva
Please confirm this contribution is under the terms of the Apache 2.0 license. Thanks
As far as I'm concerned it's public domain. But we can call it Apache 2.0 if you prefer.
cool, your code has been merged internally, I got some feedback on the review. We will not take https://github.com/aws/amazon-ssm-agent/pull/22 and this section
+.PHONY: install-freebsd +install-freebsd:
- @echo "Install for freebsd agent"
- install -m 555 $(BGO_SPACE)/bin/freebsd_amd64/amazon-ssm-agent $(DESTDIR)$(PREFIX)/sbin/
- mkdir -p $(DESTDIR)$(PREFIX)/etc/amazon/ssm
- install -m 644 $(BGO_SPACE)/bin/amazon-ssm-agent.json.template $(DESTDIR)$(PREFIX)/etc/amazon/ssm
- install -m 644 $(BGO_SPACE)/bin/seelog_unix.xml $(DESTDIR)$(PREFIX)/etc/amazon/ssm/seelog_unix.xml.template
Ok, I'll keep those bits as patches in the FreeBSD tree instead.
Thanks
release 672 includes the changes