PulseAudio fails to launch in system mode in CentOS 7

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Long story short, I'm trying to setup PulseAudio to act as a loopback interface for a local music stream. However, I'm hitting a breaking point in getting it setup.



As I understand it, you cannot start pulseaudio in "non-system mode" without having an X server running, but seeing as the server is is headless this is not an option. So I began writing a cobbled together systemd script to start the daemon as a system-wide instance. This however fails for some inexplicable reason.



If I run the command that in in the systemd script, the system-wide pulse starts up just fine! However, if I run it from within the start script (eg. with systemctl start pulseaudio), it fails with Failed to create '/var/run/pulse': Permission denied. I can't for the life of me figure out how it would work for the same user in to different ways. I also tried replacing the start script with a ls /var/run/pulse. When the script is setup to run as "pulse", it prints nothing in the journal. However, if I wrap the whole call in a sudo -u pulse, it prints the contents of /var/run/pulse. When I wrap the pulse startup command in a sudo -u root, it just crashes with the same error.



I'm totally lost on this one. If anyone could point me in the right direction, it would be greatly appreciated.



[root@ian-primary ian]# ls -al /var/run/pulse
total 4
drwx------. 3 pulse pulse 80 Nov 5 23:10 .
drwxr-xr-x. 29 root root 840 Nov 5 23:03 ..
drwxr-xr-x. 3 pulse pulse 60 Nov 5 23:04 .config
-rw-------. 1 pulse pulse 16 Nov 5 23:04 .esd_auth

[root@ian-primary ian]# sudo -u pulse ls -al /var/run/pulse
total 4
drwx------. 3 pulse pulse 80 Nov 5 23:10 .
drwxr-xr-x. 29 root root 840 Nov 5 23:03 ..
drwxr-xr-x. 3 pulse pulse 60 Nov 5 23:04 .config
-rw-------. 1 pulse pulse 16 Nov 5 23:04 .esd_auth

Nov 06 13:56:02 ian-primary systemd[1]: Starting PulseAudio system server...
Nov 06 13:56:02 ian-primary pulseaudio[23251]: W: [pulseaudio] main.c: Running in system mode, but --disallow-exit not set.
Nov 06 13:56:02 ian-primary pulseaudio[23251]: W: [pulseaudio] main.c: Running in system mode, but --disallow-module-loading not set.
Nov 06 13:56:02 ian-primary pulseaudio[23251]: N: [pulseaudio] main.c: Running in system mode, forcibly disabling SHM mode.
Nov 06 13:56:02 ian-primary pulseaudio[23251]: N: [pulseaudio] main.c: Running in system mode, forcibly disabling exit idle time.
Nov 06 13:56:02 ian-primary pulseaudio[23253]: Timer slack is set to 50 us.
Nov 06 13:56:02 ian-primary pulseaudio[23253]: setpriority() worked.
Nov 06 13:56:02 ian-primary pulseaudio[23253]: Successfully gained nice level -11.
Nov 06 13:56:02 ian-primary pulseaudio[23253]: Found user 'pulse' (UID 171) and group 'pulse' (GID 171).
Nov 06 13:56:02 ian-primary pulseaudio[23253]: Home directory of user 'pulse' is not '/var/run/pulse', ignoring.
Nov 06 13:56:02 ian-primary pulseaudio[23251]: E: [pulseaudio] main.c: Daemon startup failed.
Nov 06 13:56:02 ian-primary pulseaudio[23253]: Failed to create '/var/run/pulse': Permission denied
Nov 06 13:56:02 ian-primary systemd[1]: pulseaudio.service: main process exited, code=exited, status=1/FAILURE
Nov 06 13:56:02 ian-primary systemd[1]: Failed to start PulseAudio system server.
Nov 06 13:56:02 ian-primary systemd[1]: Unit pulseaudio.service entered failed state.
Nov 06 13:56:02 ian-primary systemd[1]: pulseaudio.service failed.

[root@ian-primary ian]# /bin/pulseaudio -vvv --daemonize --system --realtime
W: [pulseaudio] main.c: Running in system mode, but --disallow-exit not set.
W: [pulseaudio] main.c: Running in system mode, but --disallow-module-loading not set.
N: [pulseaudio] main.c: Running in system mode, forcibly disabling SHM mode.
N: [pulseaudio] main.c: Running in system mode, forcibly disabling exit idle time.
I: [pulseaudio] main.c: Daemon startup successful.

[root@ian-primary ian]# cat /etc/systemd/system/pulseaudio.service
[Unit]
Description=PulseAudio system server

[Service]
Type=notify
Environment=PULSE_RUNTIME_PATH=/run/pulse

# ExecStart=/bin/printenv
# export PULSE_RUNTIME_PATH="/run/pulse"
ExecStart=/bin/pulseaudio -vvv --daemonize --system --realtime

[Install]
WantedBy=multi-user.target








share







New contributor




duper51 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    0
    down vote

    favorite












    Long story short, I'm trying to setup PulseAudio to act as a loopback interface for a local music stream. However, I'm hitting a breaking point in getting it setup.



    As I understand it, you cannot start pulseaudio in "non-system mode" without having an X server running, but seeing as the server is is headless this is not an option. So I began writing a cobbled together systemd script to start the daemon as a system-wide instance. This however fails for some inexplicable reason.



    If I run the command that in in the systemd script, the system-wide pulse starts up just fine! However, if I run it from within the start script (eg. with systemctl start pulseaudio), it fails with Failed to create '/var/run/pulse': Permission denied. I can't for the life of me figure out how it would work for the same user in to different ways. I also tried replacing the start script with a ls /var/run/pulse. When the script is setup to run as "pulse", it prints nothing in the journal. However, if I wrap the whole call in a sudo -u pulse, it prints the contents of /var/run/pulse. When I wrap the pulse startup command in a sudo -u root, it just crashes with the same error.



    I'm totally lost on this one. If anyone could point me in the right direction, it would be greatly appreciated.



    [root@ian-primary ian]# ls -al /var/run/pulse
    total 4
    drwx------. 3 pulse pulse 80 Nov 5 23:10 .
    drwxr-xr-x. 29 root root 840 Nov 5 23:03 ..
    drwxr-xr-x. 3 pulse pulse 60 Nov 5 23:04 .config
    -rw-------. 1 pulse pulse 16 Nov 5 23:04 .esd_auth

    [root@ian-primary ian]# sudo -u pulse ls -al /var/run/pulse
    total 4
    drwx------. 3 pulse pulse 80 Nov 5 23:10 .
    drwxr-xr-x. 29 root root 840 Nov 5 23:03 ..
    drwxr-xr-x. 3 pulse pulse 60 Nov 5 23:04 .config
    -rw-------. 1 pulse pulse 16 Nov 5 23:04 .esd_auth

    Nov 06 13:56:02 ian-primary systemd[1]: Starting PulseAudio system server...
    Nov 06 13:56:02 ian-primary pulseaudio[23251]: W: [pulseaudio] main.c: Running in system mode, but --disallow-exit not set.
    Nov 06 13:56:02 ian-primary pulseaudio[23251]: W: [pulseaudio] main.c: Running in system mode, but --disallow-module-loading not set.
    Nov 06 13:56:02 ian-primary pulseaudio[23251]: N: [pulseaudio] main.c: Running in system mode, forcibly disabling SHM mode.
    Nov 06 13:56:02 ian-primary pulseaudio[23251]: N: [pulseaudio] main.c: Running in system mode, forcibly disabling exit idle time.
    Nov 06 13:56:02 ian-primary pulseaudio[23253]: Timer slack is set to 50 us.
    Nov 06 13:56:02 ian-primary pulseaudio[23253]: setpriority() worked.
    Nov 06 13:56:02 ian-primary pulseaudio[23253]: Successfully gained nice level -11.
    Nov 06 13:56:02 ian-primary pulseaudio[23253]: Found user 'pulse' (UID 171) and group 'pulse' (GID 171).
    Nov 06 13:56:02 ian-primary pulseaudio[23253]: Home directory of user 'pulse' is not '/var/run/pulse', ignoring.
    Nov 06 13:56:02 ian-primary pulseaudio[23251]: E: [pulseaudio] main.c: Daemon startup failed.
    Nov 06 13:56:02 ian-primary pulseaudio[23253]: Failed to create '/var/run/pulse': Permission denied
    Nov 06 13:56:02 ian-primary systemd[1]: pulseaudio.service: main process exited, code=exited, status=1/FAILURE
    Nov 06 13:56:02 ian-primary systemd[1]: Failed to start PulseAudio system server.
    Nov 06 13:56:02 ian-primary systemd[1]: Unit pulseaudio.service entered failed state.
    Nov 06 13:56:02 ian-primary systemd[1]: pulseaudio.service failed.

    [root@ian-primary ian]# /bin/pulseaudio -vvv --daemonize --system --realtime
    W: [pulseaudio] main.c: Running in system mode, but --disallow-exit not set.
    W: [pulseaudio] main.c: Running in system mode, but --disallow-module-loading not set.
    N: [pulseaudio] main.c: Running in system mode, forcibly disabling SHM mode.
    N: [pulseaudio] main.c: Running in system mode, forcibly disabling exit idle time.
    I: [pulseaudio] main.c: Daemon startup successful.

    [root@ian-primary ian]# cat /etc/systemd/system/pulseaudio.service
    [Unit]
    Description=PulseAudio system server

    [Service]
    Type=notify
    Environment=PULSE_RUNTIME_PATH=/run/pulse

    # ExecStart=/bin/printenv
    # export PULSE_RUNTIME_PATH="/run/pulse"
    ExecStart=/bin/pulseaudio -vvv --daemonize --system --realtime

    [Install]
    WantedBy=multi-user.target








    share







    New contributor




    duper51 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Long story short, I'm trying to setup PulseAudio to act as a loopback interface for a local music stream. However, I'm hitting a breaking point in getting it setup.



      As I understand it, you cannot start pulseaudio in "non-system mode" without having an X server running, but seeing as the server is is headless this is not an option. So I began writing a cobbled together systemd script to start the daemon as a system-wide instance. This however fails for some inexplicable reason.



      If I run the command that in in the systemd script, the system-wide pulse starts up just fine! However, if I run it from within the start script (eg. with systemctl start pulseaudio), it fails with Failed to create '/var/run/pulse': Permission denied. I can't for the life of me figure out how it would work for the same user in to different ways. I also tried replacing the start script with a ls /var/run/pulse. When the script is setup to run as "pulse", it prints nothing in the journal. However, if I wrap the whole call in a sudo -u pulse, it prints the contents of /var/run/pulse. When I wrap the pulse startup command in a sudo -u root, it just crashes with the same error.



      I'm totally lost on this one. If anyone could point me in the right direction, it would be greatly appreciated.



      [root@ian-primary ian]# ls -al /var/run/pulse
      total 4
      drwx------. 3 pulse pulse 80 Nov 5 23:10 .
      drwxr-xr-x. 29 root root 840 Nov 5 23:03 ..
      drwxr-xr-x. 3 pulse pulse 60 Nov 5 23:04 .config
      -rw-------. 1 pulse pulse 16 Nov 5 23:04 .esd_auth

      [root@ian-primary ian]# sudo -u pulse ls -al /var/run/pulse
      total 4
      drwx------. 3 pulse pulse 80 Nov 5 23:10 .
      drwxr-xr-x. 29 root root 840 Nov 5 23:03 ..
      drwxr-xr-x. 3 pulse pulse 60 Nov 5 23:04 .config
      -rw-------. 1 pulse pulse 16 Nov 5 23:04 .esd_auth

      Nov 06 13:56:02 ian-primary systemd[1]: Starting PulseAudio system server...
      Nov 06 13:56:02 ian-primary pulseaudio[23251]: W: [pulseaudio] main.c: Running in system mode, but --disallow-exit not set.
      Nov 06 13:56:02 ian-primary pulseaudio[23251]: W: [pulseaudio] main.c: Running in system mode, but --disallow-module-loading not set.
      Nov 06 13:56:02 ian-primary pulseaudio[23251]: N: [pulseaudio] main.c: Running in system mode, forcibly disabling SHM mode.
      Nov 06 13:56:02 ian-primary pulseaudio[23251]: N: [pulseaudio] main.c: Running in system mode, forcibly disabling exit idle time.
      Nov 06 13:56:02 ian-primary pulseaudio[23253]: Timer slack is set to 50 us.
      Nov 06 13:56:02 ian-primary pulseaudio[23253]: setpriority() worked.
      Nov 06 13:56:02 ian-primary pulseaudio[23253]: Successfully gained nice level -11.
      Nov 06 13:56:02 ian-primary pulseaudio[23253]: Found user 'pulse' (UID 171) and group 'pulse' (GID 171).
      Nov 06 13:56:02 ian-primary pulseaudio[23253]: Home directory of user 'pulse' is not '/var/run/pulse', ignoring.
      Nov 06 13:56:02 ian-primary pulseaudio[23251]: E: [pulseaudio] main.c: Daemon startup failed.
      Nov 06 13:56:02 ian-primary pulseaudio[23253]: Failed to create '/var/run/pulse': Permission denied
      Nov 06 13:56:02 ian-primary systemd[1]: pulseaudio.service: main process exited, code=exited, status=1/FAILURE
      Nov 06 13:56:02 ian-primary systemd[1]: Failed to start PulseAudio system server.
      Nov 06 13:56:02 ian-primary systemd[1]: Unit pulseaudio.service entered failed state.
      Nov 06 13:56:02 ian-primary systemd[1]: pulseaudio.service failed.

      [root@ian-primary ian]# /bin/pulseaudio -vvv --daemonize --system --realtime
      W: [pulseaudio] main.c: Running in system mode, but --disallow-exit not set.
      W: [pulseaudio] main.c: Running in system mode, but --disallow-module-loading not set.
      N: [pulseaudio] main.c: Running in system mode, forcibly disabling SHM mode.
      N: [pulseaudio] main.c: Running in system mode, forcibly disabling exit idle time.
      I: [pulseaudio] main.c: Daemon startup successful.

      [root@ian-primary ian]# cat /etc/systemd/system/pulseaudio.service
      [Unit]
      Description=PulseAudio system server

      [Service]
      Type=notify
      Environment=PULSE_RUNTIME_PATH=/run/pulse

      # ExecStart=/bin/printenv
      # export PULSE_RUNTIME_PATH="/run/pulse"
      ExecStart=/bin/pulseaudio -vvv --daemonize --system --realtime

      [Install]
      WantedBy=multi-user.target








      share







      New contributor




      duper51 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      Long story short, I'm trying to setup PulseAudio to act as a loopback interface for a local music stream. However, I'm hitting a breaking point in getting it setup.



      As I understand it, you cannot start pulseaudio in "non-system mode" without having an X server running, but seeing as the server is is headless this is not an option. So I began writing a cobbled together systemd script to start the daemon as a system-wide instance. This however fails for some inexplicable reason.



      If I run the command that in in the systemd script, the system-wide pulse starts up just fine! However, if I run it from within the start script (eg. with systemctl start pulseaudio), it fails with Failed to create '/var/run/pulse': Permission denied. I can't for the life of me figure out how it would work for the same user in to different ways. I also tried replacing the start script with a ls /var/run/pulse. When the script is setup to run as "pulse", it prints nothing in the journal. However, if I wrap the whole call in a sudo -u pulse, it prints the contents of /var/run/pulse. When I wrap the pulse startup command in a sudo -u root, it just crashes with the same error.



      I'm totally lost on this one. If anyone could point me in the right direction, it would be greatly appreciated.



      [root@ian-primary ian]# ls -al /var/run/pulse
      total 4
      drwx------. 3 pulse pulse 80 Nov 5 23:10 .
      drwxr-xr-x. 29 root root 840 Nov 5 23:03 ..
      drwxr-xr-x. 3 pulse pulse 60 Nov 5 23:04 .config
      -rw-------. 1 pulse pulse 16 Nov 5 23:04 .esd_auth

      [root@ian-primary ian]# sudo -u pulse ls -al /var/run/pulse
      total 4
      drwx------. 3 pulse pulse 80 Nov 5 23:10 .
      drwxr-xr-x. 29 root root 840 Nov 5 23:03 ..
      drwxr-xr-x. 3 pulse pulse 60 Nov 5 23:04 .config
      -rw-------. 1 pulse pulse 16 Nov 5 23:04 .esd_auth

      Nov 06 13:56:02 ian-primary systemd[1]: Starting PulseAudio system server...
      Nov 06 13:56:02 ian-primary pulseaudio[23251]: W: [pulseaudio] main.c: Running in system mode, but --disallow-exit not set.
      Nov 06 13:56:02 ian-primary pulseaudio[23251]: W: [pulseaudio] main.c: Running in system mode, but --disallow-module-loading not set.
      Nov 06 13:56:02 ian-primary pulseaudio[23251]: N: [pulseaudio] main.c: Running in system mode, forcibly disabling SHM mode.
      Nov 06 13:56:02 ian-primary pulseaudio[23251]: N: [pulseaudio] main.c: Running in system mode, forcibly disabling exit idle time.
      Nov 06 13:56:02 ian-primary pulseaudio[23253]: Timer slack is set to 50 us.
      Nov 06 13:56:02 ian-primary pulseaudio[23253]: setpriority() worked.
      Nov 06 13:56:02 ian-primary pulseaudio[23253]: Successfully gained nice level -11.
      Nov 06 13:56:02 ian-primary pulseaudio[23253]: Found user 'pulse' (UID 171) and group 'pulse' (GID 171).
      Nov 06 13:56:02 ian-primary pulseaudio[23253]: Home directory of user 'pulse' is not '/var/run/pulse', ignoring.
      Nov 06 13:56:02 ian-primary pulseaudio[23251]: E: [pulseaudio] main.c: Daemon startup failed.
      Nov 06 13:56:02 ian-primary pulseaudio[23253]: Failed to create '/var/run/pulse': Permission denied
      Nov 06 13:56:02 ian-primary systemd[1]: pulseaudio.service: main process exited, code=exited, status=1/FAILURE
      Nov 06 13:56:02 ian-primary systemd[1]: Failed to start PulseAudio system server.
      Nov 06 13:56:02 ian-primary systemd[1]: Unit pulseaudio.service entered failed state.
      Nov 06 13:56:02 ian-primary systemd[1]: pulseaudio.service failed.

      [root@ian-primary ian]# /bin/pulseaudio -vvv --daemonize --system --realtime
      W: [pulseaudio] main.c: Running in system mode, but --disallow-exit not set.
      W: [pulseaudio] main.c: Running in system mode, but --disallow-module-loading not set.
      N: [pulseaudio] main.c: Running in system mode, forcibly disabling SHM mode.
      N: [pulseaudio] main.c: Running in system mode, forcibly disabling exit idle time.
      I: [pulseaudio] main.c: Daemon startup successful.

      [root@ian-primary ian]# cat /etc/systemd/system/pulseaudio.service
      [Unit]
      Description=PulseAudio system server

      [Service]
      Type=notify
      Environment=PULSE_RUNTIME_PATH=/run/pulse

      # ExecStart=/bin/printenv
      # export PULSE_RUNTIME_PATH="/run/pulse"
      ExecStart=/bin/pulseaudio -vvv --daemonize --system --realtime

      [Install]
      WantedBy=multi-user.target






      systemd environment-variables pulseaudio headless





      share







      New contributor




      duper51 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      duper51 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      duper51 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 25 secs ago









      duper51

      101




      101




      New contributor




      duper51 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      duper51 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      duper51 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

























          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          duper51 is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f480227%2fpulseaudio-fails-to-launch-in-system-mode-in-centos-7%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          duper51 is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          duper51 is a new contributor. Be nice, and check out our Code of Conduct.












          duper51 is a new contributor. Be nice, and check out our Code of Conduct.











          duper51 is a new contributor. Be nice, and check out our Code of Conduct.













           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f480227%2fpulseaudio-fails-to-launch-in-system-mode-in-centos-7%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?