Off/On Switch

Raspberry Pi related support

Off/On Switch

Postby neanderthaler » 02 Jan 2021, 23:46

The dtoverlay-directive "gpio_shutdown" makes life much easier for all friends of hardware shutdown buttons. This works like a charm on my Pi 3B (with Re6).
But it doesn't work with 0.5 beta on Pi 2B, even if dtoverlays in general are working.
So I had to set it up according to janui's hint in
My /etc/systemd-gpio/shutdown reads:
Code: Select all
MESSAGE="Shutdown requested by GPIO trigger."
COMMAND="/srv/http/command/rune_shutdown ; /usr/bin/shutdown -h now"

- GPIO number relates to the BCM numbering scheme, GPIO 3 means physical pin 5, like shown on
- option -h ist needed for shutdown:
Code: Select all
shutdown -P
doesn't work in this script. Fancy.

I do not understand if it is really important to run rune_shutdown before /bin/shutdown. In my opinion a system-shutdown should also unmount all shares and close all services, like the rune script does?

However: Kudos to all coders at this great peace of SW!
Posts: 21
Joined: 01 May 2015, 08:20

Re: Off/On Switch

Postby neanderthaler » 03 Jan 2021, 17:01

Kommando zurück!
rune_shutdown doesn't work together with /usr/bin/shutdown.
So I had to reset the variable back to
Code: Select all
COMMAND="/usr/bin/shutdown -h now"

This works as hoped for. Rune seems not to be messed afterwards, even the active playlist with USB-mounts and Samba shares is up and running.

BTW, "shutdown" is just symlinked to "systemctl", this could explain the unexpected behaviour of some options.
Posts: 21
Joined: 01 May 2015, 08:20

support RuneAudio Donate with PayPal

Return to Raspberry Pi

Who is online

Users browsing this forum: cmh714 and 0 guests