• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
RetroPie forum home
  • Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Trying to make a simple power off / reboot button in Emulationstation but getting permission denied.

Scheduled Pinned Locked Moved Help and Support
shutdownrebootemulationstatio
6 Posts 3 Posters 415 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T
    TPR
    last edited by 9 Nov 2024, 20:35

    I'd like to add a power off & reboot button to my emulation station game menu where I select an icon from my game menu to perform one of these functions but I'm getting permission denied errors trying to do it.

    I've seen other builds have a file called like reboot.sh or shutdown.sh and when you select it, it sends the command:
    sudo shutdown -r now

    or

    sudo shutdown -h now

    But everytime I've tried to do something like this I get "permission denied." What am I doing wrong here?

    R 1 Reply Last reply 9 Nov 2024, 21:15 Reply Quote 0
    • R
      RapidEdwin08 @TPR
      last edited by 9 Nov 2024, 21:15

      @TPR what system are you putting them in?
      Sounds like the es_system you put them in is missing bash some command.
      You could just make the scripts executable with chmod 755 script. sh, or modify es_systems cfg to bash %ROM%.

      Raspberry Pi B, Pi B+, Pi2 B, Pi3 B, Pi3 B+, Pi Zero W, Pi4 (4GB/8GB), Pi5 (8GB/16GB), Pi Zero 2 W, GPi V1, minisforum GK50 / RetroPie 4.8.x

      T 2 Replies Last reply 9 Nov 2024, 21:32 Reply Quote 0
      • T
        TPR @RapidEdwin08
        last edited by 9 Nov 2024, 21:32

        @RapidEdwin08 said in Trying to make a simple power off / reboot button in Emulationstation but getting permission denied.:

        @TPR what system are you putting them in?
        Sounds like the es_system you put them in is missing bash some command.
        You could just make the scripts executable with chmod 755 script. sh, or modify es_systems cfg to bash %ROM%.

        At the moment, to test, just putting them in a folder called "power"
        <system>
        <name>power</name>
        <fullname>Power Menu</fullname>
        <path>~/RetroPie/roms/power</path>
        <extension>.sh .SH</extension>
        <command>%ROM%</command>
        <platform>linux</platform>
        <theme>power</theme>
        </system>

        and then my reboot.sh just has this line in it:
        sudo shutdown -r now

        But then I get the following error on screen:
        sh: 1 /home/pi/RetroPie/roms/power/Reboot.sh: Permission denied

        I've seen this work on other builds with the same command so I'm not sure I'm doing wrong.

        my chmod on the reboot.sh file is 755, along with all my other files in the /roms folder.

        Any ideas?

        1 Reply Last reply Reply Quote 0
        • T
          TPR @RapidEdwin08
          last edited by TPR 11 Sept 2024, 21:48 9 Nov 2024, 21:46

          @RapidEdwin08 said in Trying to make a simple power off / reboot button in Emulationstation but getting permission denied.:

          @TPR what system are you putting them in?
          Sounds like the es_system you put them in is missing bash some command.
          You could just make the scripts executable with chmod 755 script. sh, or modify es_systems cfg to bash %ROM%.

          So you were totally right!

          This now works!

          <system>
          <name>power</name>
          <fullname>Power Menu</fullname>
          <path>~/RetroPie/roms/power</path>
          <extension>.sh .SH</extension>
          <command>bash %ROM%</command>
          <platform>linux</platform>
          <theme>power</theme>
          </system>

          adding bash in front of %ROM% got me my desired effect!

          1 Reply Last reply Reply Quote 0
          • L
            Lolonois
            last edited by 11 Nov 2024, 08:48

            I usually do from any navigation position: Start -> RB (right shoulder) -> A (now I am in the Quit Menu) and then select either Restart or Shutdown. You can bypass the final confirm dialog when you add --no-confirm-quit to the emulationstation line in autostart.sh.

            T 1 Reply Last reply 11 Nov 2024, 19:29 Reply Quote 0
            • T
              TPR @Lolonois
              last edited by 11 Nov 2024, 19:29

              @Lolonois said in Trying to make a simple power off / reboot button in Emulationstation but getting permission denied.:

              I usually do from any navigation position: Start -> RB (right shoulder) -> A (now I am in the Quit Menu) and then select either Restart or Shutdown. You can bypass the final confirm dialog when you add --no-confirm-quit to the emulationstation line in autostart.sh.

              Yes, I am well aware of that. Have been using ES for many years. I just wanted to make an easy button to press right from the icon screen though. More of a personal preference than anything else.

              1 Reply Last reply Reply Quote 0
              6 out of 6
              • First post
                6/6
                Last post

              Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

              Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.

                This community forum collects and processes your personal information.
                consent.not_received