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 419 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.
    • TPRT
      TPR
      last edited by

      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?

      RapidEdwin08R 1 Reply Last reply Reply Quote 0
      • RapidEdwin08R
        RapidEdwin08 @TPR
        last edited by

        @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

        TPRT 2 Replies Last reply Reply Quote 0
        • TPRT
          TPR @RapidEdwin08
          last edited by

          @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
          • TPRT
            TPR @RapidEdwin08
            last edited by TPR

            @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
            • LolonoisL
              Lolonois
              last edited by

              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.

              TPRT 1 Reply Last reply Reply Quote 0
              • TPRT
                TPR @Lolonois
                last edited by

                @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
                • First post
                  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.