Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Jun 2011
    Posts
    25

    irexec doesn't autostart from "User commands" in v6.1.0

    Per Ralphy's suggestion, I found that running irexec daemonized allows me to invoke custom scripts via IR remote. I added irexec to Tweaks->User commands, but irexec never survives reboot:

    Name:  pcp-no-irexec.JPG
Views: 260
Size:  53.9 KB

    I find nothing in Main->Diagnostics indicating that it started. Irexec invocation is in pcp.cfg, perhaps a HTML translation problem?

    Code:
    AUTOSTARTLMS=""
    A_S_LMS="Disabled"
    AUTOSTARTFAV="Random songs"
    A_S_FAV="Enabled"
    USER_COMMAND_1="%2Fusr%2Flocal%2Fbin%2Firexec+-d"
    USER_COMMAND_2=""
    USER_COMMAND_3=""
    JIVELITE="no"
    In any case, is there a manual pcp.cfg fix, or another way for me to invoke "/usr/local/bin/irexec -d" at boot time? Thanks!

  2. #2
    Junior Member
    Join Date
    Jun 2011
    Posts
    25

    It's not character URL (percent) encoding

    On a tip from https://www.brianlinkletter.com/pers...inycore-linux/, I manually edited /usr/local/etc/pcp/pcp.cfg and removed the percent-encoding from USER_COMMAND_1:

    USER_COMMAND_1="/usr/local/bin/irexec -d"

    I then made this configuration persistent:

    sudo filetool.sh -b

    and rebooted. My pcp.cfg edit remains, but there is still no irexec running:

    Code:
    tc@piCorePorch:/usr/local/etc/pcp$ ps auxw | grep ire
     8586 tc        0:00 grep ire
    /var/log/pcp_boot.log shows that LIRC is started before the user commands (sorry for encoding, can't figure out how to get rid of it in PuTTY):

    Code:
    [1;34mLoading configuration file...[[0;39m [[1;32mDone.[[0;39m
    [[1;34mLoading pcp-lms-functions...[[0;39m [[1;32mDone.[[0;39m
    [[1;33mWaiting for soundcard IQaudIODAC to populate. [[1;32mDone (1).[[0;39m
    [[1;33mWaiting for network. [[1;32mDone (1).[[0;39m
    [[1;34mStarting lirc...[[0;39m [[1;32mDone.[[0;39m
    [[1;34mStarting Openssh server...[[0;39m [[1;32mDone.[[0;39m
    [[1;34mStarting Squeezelite and/or Shairport-sync...[[1;33m
    [ INFO ] Starting Squeezelite player: Squeezelite...
     [[1;32mDone.[[0;39m
    [[1;34mStarting httpd web server...[[0;39m [[1;32mDone.[[0;39m
    [[1;34mStarting user commands...[[0;39m [[1;32mDone.[[0;39m
    [[1;34mStarting auto start Favorites...[[0;39m [[1;32mDone.[[0;39m
    [[1;34mSetting CPU scaling governor to ondemand... [[1;32mDone.[[0;39m
    [[1;34mCreating static footer...[[0;39m [[1;32mDone.[[0;39m
    
    [[1;32mFinished piCorePlayer v6.1.0 startup.[[0;39m
    Any ideas for either adding more detailed logging to the user commands, or another startup file to manipulate?

  3. #3
    Junior Member
    Join Date
    Jun 2011
    Posts
    25

    This is a PCP bug, but I can kludge around it with .profile

    OK, I managed to get irexec running daemonized at boot. To do so, I had to add it to /home/tc/.profile (excerpt):

    Code:
    if [ -f "$HOME/.ashrc" ]; then
       export ENV="$HOME/.ashrc"
       . "$HOME/.ashrc"
    fi
    
    # Can't start irexec from Tweaks->User Command, try it here
    /usr/local/bin/irexec -d
    
    TERMTYPE=`/usr/bin/tty`
    [ ${TERMTYPE:5:3} == "tty" ] && (
    [ ! -f /etc/sysconfig/Xserver ] ||
    [ -f /etc/sysconfig/text ] ||
    [ -e /tmp/.X11-unix/X0 ] ||
    startx
    Then persist the change with "sudo filetool.sh -b" and reboot.

    At this point, irexec starts automatically and can handle my custom remote scripts:

    Code:
    tc@piCorePorch:~$ ps auxw | grep ire
     3658 tc        0:00 /usr/local/bin/irexec -d
     5288 tc        0:00 grep ire
    Seems pretty clear that this is a bug in the Tweaks->User commands. Is there a separate reporting process?

  4. #4
    Quote Originally Posted by Braklet View Post
    OK, I managed to get irexec running daemonized at boot. To do so, I had to add it to /home/tc/.profile (excerpt):

    Seems pretty clear that this is a bug in the Tweaks->User commands. Is there a separate reporting process?
    I've been running into the same problem, but for me this solution doesn't seem to work either...

    All seems to work fine if I start IREXEC manually, so this seems to me to be something that should be easy to fix.. But not sure where to start from here..

  5. #5
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    3,420
    Some processes may not like being backgrounded and then trying to daemonize. You likely don't need to use the "-d". Or you can just put what you want in a script, then put the script name in user commands.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  6. #6
    Quote Originally Posted by paul- View Post
    Some processes may not like being backgrounded and then trying to daemonize. You likely don't need to use the "-d". Or you can just put what you want in a script, then put the script name in user commands.
    Thanks, I'll try that tomorrow. The other one (the power off script) does indeed seem to work, maybe I'll just combine both into one shell script.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •