diff --git a/images/02-acpid/Dockerfile b/images/02-acpid/Dockerfile new file mode 100644 index 00000000..e83a345c --- /dev/null +++ b/images/02-acpid/Dockerfile @@ -0,0 +1,3 @@ +FROM rancher/os-base +COPY lid /etc/acpi/events/ +COPY suspend.sh /etc/acpi/suspend.sh diff --git a/images/02-acpid/lid b/images/02-acpid/lid new file mode 100644 index 00000000..3a85989c --- /dev/null +++ b/images/02-acpid/lid @@ -0,0 +1,2 @@ +event=button/lid +action=/etc/acpi/suspend.sh %e diff --git a/images/02-acpid/suspend.sh b/images/02-acpid/suspend.sh new file mode 100755 index 00000000..304bca31 --- /dev/null +++ b/images/02-acpid/suspend.sh @@ -0,0 +1,4 @@ +#!/bin/sh +if [ "$3" = "close" ]; then + echo -n "mem" > /sys/power/state +fi diff --git a/os-config.tpl.yml b/os-config.tpl.yml index 1c589277..89d8640d 100644 --- a/os-config.tpl.yml +++ b/os-config.tpl.yml @@ -83,7 +83,7 @@ rancher: services: {{if eq "amd64" .ARCH -}} acpid: - image: {{.OS_REPO}}/os-base:{{.VERSION}}{{.SUFFIX}} + image: {{.OS_REPO}}/os-acpid:{{.VERSION}}{{.SUFFIX}} command: /usr/sbin/acpid -f labels: io.rancher.os.scope: system