<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><br>
    </p>
    <div class="moz-cite-prefix">Am 26.04.19 um 01:09 schrieb
      <a class="moz-txt-link-abbreviated" href="mailto:jack@microfx.de">jack@microfx.de</a>:<br>
    </div>
    <blockquote type="cite"
      cite="mid:d427f80f7f1221aeb0d8b3f34b9bd2c0@microfx.de">Hey Thomas!
      <br>
      <br>
      Thanks a lot for your input! You are totally right, I could have
      checked this myself. Works like a charm with screen. So I suppose
      I'll go with that solution - fantastic - also your script is very
      helpful! Kudos!
      <br>
      <br>
      Cheers
      <br>
      Jan
      <br>
      <br>
      <br>
      Am 2019-04-25 15:41, schrieb Thomas Brand:
      <br>
      <blockquote type="cite">On 2019-04-25 12:39, <a class="moz-txt-link-abbreviated" href="mailto:jack@microfx.de">jack@microfx.de</a>
        wrote:
        <br>
        <blockquote type="cite">Hey Thomas,
          <br>
          <br>
          systemctl --version
          <br>
          systemd 232
          <br>
          +PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP
          <br>
          +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID
          +ELFUTILS
          <br>
          +KMOD +IDN
          <br>
          <br>
          From that issue thread I see it's only in 240 - so this is not
          the
          <br>
          problem I suppose.
          <br>
          <br>
          Cheers
          <br>
          Jan
          <br>
          <br>
          <br>
          Am 2019-04-25 12:33, schrieb Thomas Brand:
          <br>
          <blockquote type="cite">On 2019-04-25 11:35, <a class="moz-txt-link-abbreviated" href="mailto:jack@microfx.de">jack@microfx.de</a>
            wrote:
            <br>
            <blockquote type="cite">Hey!
              <br>
              <br>
              I have a hard time setting up a tmux session started with
              systemd on
              <br>
              raspbian (patchbox OS, realtime kernel) to behaves like as
              if I
              <br>
              started my script manually.
              <br>
            </blockquote>
            <br>
            <blockquote type="cite">Cannot use real-time scheduling
              (RR/70)(1: Operation not permitted)
              <br>
              JackClient::AcquireSelfRealTime error
              <br>
            </blockquote>
            <br>
            <blockquote type="cite">
              <br>
            </blockquote>
          </blockquote>
        </blockquote>
        <br>
        It's yet unclear to me if this is related to jack at all.. Can
        you
        <br>
        test this without jack? Basically leaving everything out except
        a
        <br>
        script started by systemd that tries to lock memory or calls
        ulimit.
        <br>
        <br>
        Similar to your tmux approach, with screen, here's a building
        block:
        <br>
        <br>
        #!/bin/bash
        <br>
        <br>
        start_in_detached_screen()
        <br>
        {
        <br>
                #$1: username
        <br>
                #$2: screen name
        <br>
                #$3: command string (without ^M)
        <br>
        <br>
                su ${1} -c "screen -d -m -S \"$2\""
        <br>
                su ${1} -c "screen -S \"$2\" -p 0 -X stuff \"$3\"^M"
        <br>
        }
        <br>
        <br>
        start_in_detached_screen john_doe "my test" "cd /tmp &&
        ls -ltra"
        <br>
        <br>
        -> as root: start screen as given user and feed command to
        screen session.
        <br>
        It should work to start jackd as a specific user early in the
        boot
        <br>
        process and see what happened by attaching the screen later on.
        <br>
        <br>
        Greetings
        <br>
        Thomas
        <br>
      </blockquote>
      <br>
    </blockquote>
    <p><br>
    </p>
    <p>If it is a Users permission issue, you could do it with systemd
      by using the XDG_RUNTIME_DIR var.</p>
    <p><br>
    </p>
    <table class="highlight tab-size js-file-line-container"
      data-tab-size="8">
      <tbody>
        <tr>
          <td id="LC5" class="blob-code blob-code-inner js-file-line">[Service]</td>
        </tr>
        <tr>
        </tr>
      </tbody>
    </table>
    <table class="highlight tab-size js-file-line-container"
      data-tab-size="8">
      <tbody>
        <tr>
          <td id="LC6" class="blob-code blob-code-inner js-file-line">User=USERNAME</td>
        </tr>
        <tr>
        </tr>
      </tbody>
    </table>
    <table class="highlight tab-size js-file-line-container"
      data-tab-size="8">
      <tbody>
        <tr>
          <td id="LC7" class="blob-code blob-code-inner js-file-line">Type=oneshot</td>
        </tr>
        <tr>
        </tr>
      </tbody>
    </table>
    <table class="highlight tab-size js-file-line-container"
      data-tab-size="8">
      <tbody>
        <tr>
          <td id="LC8" class="blob-code blob-code-inner js-file-line">Environment="XDG_RUNTIME_DIR=/run/user/USERID"</td>
        </tr>
        <tr>
        </tr>
      </tbody>
    </table>
    <p>ExecStart=/home/patch/jack-capture-tmux.sh <br>
    </p>
    <p><br>
    </p>
    <p>were you need to set your username and id (id -u $(logname))</p>
    <p>this will start the script with the permissions set for the user.
      <br>
    </p>
  </body>
</html>