#!/sbin/openrc-run
description="Initialize Amazon SSM Agent"
command="/usr/bin/amazon-ssm-agent"
SSM_Agent_path="/etc/amazon/ssm"
pidfile="/run/$RC_SVCNAME.pid"

start() {
	ebegin "Starting SSM Agent"
	start-stop-daemon --start \
		--chdir ${SSM_Agent_path} \
		--exec ${command} ${command_args} \
		-b --make-pidfile \
		--pidfile "${pidfile}"
	eend $?
}

stop() {
	ebegin "Stopping SSM Agent"
	start-stop-daemon --stop \
		--exec ${command} \
		--pidfile "${pidfile}"
	eend $?
}
