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

emulationstation systemd service



  • I have been trying to get a systemd service unit going for emulationstation to really have more of an appliance behavior. Using this with lubuntu 16.04. Currently I have a systemd timer set up to check every 15 seconds if ES is running and if not it will restart it. That way it respawns if a user accidentally quits or if the application crashes. I have created a systemd service file which boots into X and loads ES without a window manager, which is exactly what I want. The problem is once it loads ES does not recognize any input from a keyboard or ps3 controller. I was hoping someone more knowledgeable about ES or systemd could hopefully help. The logs have not given much to go on at all. Any advice is welcome!

    Not working

    [Unit]                                                                                                                                                                                          
    Description = Starts an instance of EmulationStation
    After = remote-fs.target
    
    [Service]
    User = retropie
    Group = retropie
    Type = simple
    PAMName = login
    ExecStart = /usr/bin/xinit /usr/bin/dbus-launch --exit-with-session /usr/bin/gnome-terminal --full-screen -e emulationstation -- :0 -nolisten tcp vt7 -nocursor
    Restart = always
    RestartSec= 2
    
    [Install]
    WantedBy = multi-user.target
    

    Working
    I've slimmed this down as much as I can without a single systemd service. My current implementation achieves most of my goal, but it floods journalctl with no way to turn off unless I change systemd's LogLevel across the board. This also requires a wm to start X and is a little more hackish and is as follows:

    /etc/systemd/system/rp_check.timer

    [Unit]                                                                                                                                                                                          
    Description = Check emulationstation
    
    [Timer]
    OnCalendar = *:*:0/15
    Persistent = true
    
    [Install]
    WantedBy = timers.target
    

    /etc/systemd/system/rp_check.service

    [Unit]                                                                                                                                                                                          
    Description = Check Emulationstation
    
    [Service]
    Type = oneshot
    User = retropie
    Group = retropie
    StandardOut = null
    Environment = "DISPLAY=:0"
    ExecStart = /bin/bash -c 'if [[ $(pidof emulationstation) -ne 0 ]]; then \
                              echo "emulationstation is running"; exit 0; else \
                              echo "starting emulationstation"; gnome-terminal \
                              --full-screen -e emulationstation; exit 0; fi'
    


  • I had the same issue, what you need to do is put "<bool name="BackgroundJoystickInput" value="true" />" into your es_settings.cfg file as it thinks ES is running in the background.



  • @Hevvie said in emulationstation systemd service:

    I had the same issue, what you need to do is put "<bool name="BackgroundJoystickInput" value="true" />" into your es_settings.cfg file as it thinks ES is running in the background.

    I will try this out when I get a chance. Great find!!!



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.