How change Air Manager "Shutdown Button" behavior to control Air Player & Raspberry Pi4 shutdown

Support for Air Player desktop.

Moderators: russ, Ralph

Post Reply
Message
Author
User avatar
nnyerges
Posts: 65
Joined: Sat Jun 18, 2022 6:28 pm

How change Air Manager "Shutdown Button" behavior to control Air Player & Raspberry Pi4 shutdown

#1 Post by nnyerges »

Hi,
When installing the new version of Air Player 4.x Desktop on a Raspberry Pi4, pressing the Air Manager 'Shutdown' or 'Shutdown All' only closes the Air Player <user> process, but doesn't shutdown the Raspberry Pi4.

Facts:
  • If ./Bootloader is used to start Air Player, the program run as a <user> process.
  • Using sudo ./Bootloader to start Air Player, it will run as a <root> process.
    Make note that this is the only way Air Manager/Air Player can handle the GPIO ports of the Raspberry Pi4).
Air Player calls the stop_airplayer.sh file which is inside the AirPlayer directory. This shell script only runs pkill AirPlayer, so it only stops the Air Player instance started as <user> and does not stop the Raspberry or <root> Air Player instance.

Solution:
If you would like to change this behavior of the Air Manager shutdown buttons, just must edit the stop_airplayer.sh .

1. To stop <user> Air Player, dont do nothing (original 'stop_airplayer.sh' file contents)

Code: Select all

#! /bin/sh
pkill AirPlayer
2. To stop all instances of Air Player

Code: Select all

#! /bin/sh
sudo pkill AirPlayer
3. To shutdown the Raspberry

Code: Select all

#! /bin/sh
sudo pkill AirPlayer
sudo halt
I hope it helps you
Nicolas.
Chief Technology Officer (CTO) at 360ATC Aviation Training Center
Electronic Engineer. Control & Software Specialist

Post Reply