PulseAudio fails to launch in system mode in CentOS 7












0















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.



[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|improve this question





























    0















    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.



    [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|improve this question



























      0












      0








      0








      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.



      [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|improve this question
















      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.



      [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|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 6 '18 at 21:37









      Rui F Ribeiro

      40.1k1479135




      40.1k1479135










      asked Nov 6 '18 at 21:01









      duper51duper51

      1041




      1041






















          2 Answers
          2






          active

          oldest

          votes


















          0














          This doesn't really explain the Failed to create '/var/run/pulse': Permission denied message, but there's one apparent issue in your configuration, which is that you're running PulseAudio with --daemonize from the systemd service unit, while systemd actually expects it to run in foreground. You should change that to --daemonize=no.



          You might also want to explicitly list --disallow-exit and --disallow-module-loading as suggested from the log messages.



          PulseAudio is also complaining that user pulse's home directory is not /var/run/pulse, as it seems to expect that, you might want to update the system account to reflect that.



          For further research, you might want to look at this article for more details and instructions on running a system-wide instance of PulseAudio, and also this page from the PulseAudio wiki (including some references on why you would not want to run PulseAudio as a system-wide service.)






          share|improve this answer
























          • My working theory at the time was that pulse wasn't understanding the symlink from /var/run to /run so I had adjusted the home directory of the pulse user to /run. This however did not resolve the issue. I also tried with those options in there, and it didn't seem to do anything.

            – duper51
            Nov 7 '18 at 1:03











          • The symlink is there so applications using the /var/run paths can run unmodified. I suggest you just use /var/run paths everywhere. (Right now you have a mix of both!)

            – filbranden
            Nov 7 '18 at 1:08











          • The fact is it tries to make /var/run/pulse even though it exists and by all rights should be able to see that it does. /var/run/pulse -> /run/pulse

            – duper51
            Nov 7 '18 at 1:23











          • Is it possible this is SELinux related? Do you have it enabled? Do you have messages about AVC in your logs?

            – filbranden
            Nov 7 '18 at 2:52











          • In any case, the other problems mentioned are issues you'll have to address, so I suggest you start with those, see if it's still not working and then we can look at what's next...

            – filbranden
            Nov 7 '18 at 2:52



















          0














          You can try putting pulseaudio.service with --user in a shell script to start it. Now run the start script inside screen as a normal user. Then detach the screen and logout. The pulseaudio server continues as if it were headless.






          share|improve this answer























            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',
            autoActivateHeartbeat: false,
            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
            });


            }
            });














            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















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            This doesn't really explain the Failed to create '/var/run/pulse': Permission denied message, but there's one apparent issue in your configuration, which is that you're running PulseAudio with --daemonize from the systemd service unit, while systemd actually expects it to run in foreground. You should change that to --daemonize=no.



            You might also want to explicitly list --disallow-exit and --disallow-module-loading as suggested from the log messages.



            PulseAudio is also complaining that user pulse's home directory is not /var/run/pulse, as it seems to expect that, you might want to update the system account to reflect that.



            For further research, you might want to look at this article for more details and instructions on running a system-wide instance of PulseAudio, and also this page from the PulseAudio wiki (including some references on why you would not want to run PulseAudio as a system-wide service.)






            share|improve this answer
























            • My working theory at the time was that pulse wasn't understanding the symlink from /var/run to /run so I had adjusted the home directory of the pulse user to /run. This however did not resolve the issue. I also tried with those options in there, and it didn't seem to do anything.

              – duper51
              Nov 7 '18 at 1:03











            • The symlink is there so applications using the /var/run paths can run unmodified. I suggest you just use /var/run paths everywhere. (Right now you have a mix of both!)

              – filbranden
              Nov 7 '18 at 1:08











            • The fact is it tries to make /var/run/pulse even though it exists and by all rights should be able to see that it does. /var/run/pulse -> /run/pulse

              – duper51
              Nov 7 '18 at 1:23











            • Is it possible this is SELinux related? Do you have it enabled? Do you have messages about AVC in your logs?

              – filbranden
              Nov 7 '18 at 2:52











            • In any case, the other problems mentioned are issues you'll have to address, so I suggest you start with those, see if it's still not working and then we can look at what's next...

              – filbranden
              Nov 7 '18 at 2:52
















            0














            This doesn't really explain the Failed to create '/var/run/pulse': Permission denied message, but there's one apparent issue in your configuration, which is that you're running PulseAudio with --daemonize from the systemd service unit, while systemd actually expects it to run in foreground. You should change that to --daemonize=no.



            You might also want to explicitly list --disallow-exit and --disallow-module-loading as suggested from the log messages.



            PulseAudio is also complaining that user pulse's home directory is not /var/run/pulse, as it seems to expect that, you might want to update the system account to reflect that.



            For further research, you might want to look at this article for more details and instructions on running a system-wide instance of PulseAudio, and also this page from the PulseAudio wiki (including some references on why you would not want to run PulseAudio as a system-wide service.)






            share|improve this answer
























            • My working theory at the time was that pulse wasn't understanding the symlink from /var/run to /run so I had adjusted the home directory of the pulse user to /run. This however did not resolve the issue. I also tried with those options in there, and it didn't seem to do anything.

              – duper51
              Nov 7 '18 at 1:03











            • The symlink is there so applications using the /var/run paths can run unmodified. I suggest you just use /var/run paths everywhere. (Right now you have a mix of both!)

              – filbranden
              Nov 7 '18 at 1:08











            • The fact is it tries to make /var/run/pulse even though it exists and by all rights should be able to see that it does. /var/run/pulse -> /run/pulse

              – duper51
              Nov 7 '18 at 1:23











            • Is it possible this is SELinux related? Do you have it enabled? Do you have messages about AVC in your logs?

              – filbranden
              Nov 7 '18 at 2:52











            • In any case, the other problems mentioned are issues you'll have to address, so I suggest you start with those, see if it's still not working and then we can look at what's next...

              – filbranden
              Nov 7 '18 at 2:52














            0












            0








            0







            This doesn't really explain the Failed to create '/var/run/pulse': Permission denied message, but there's one apparent issue in your configuration, which is that you're running PulseAudio with --daemonize from the systemd service unit, while systemd actually expects it to run in foreground. You should change that to --daemonize=no.



            You might also want to explicitly list --disallow-exit and --disallow-module-loading as suggested from the log messages.



            PulseAudio is also complaining that user pulse's home directory is not /var/run/pulse, as it seems to expect that, you might want to update the system account to reflect that.



            For further research, you might want to look at this article for more details and instructions on running a system-wide instance of PulseAudio, and also this page from the PulseAudio wiki (including some references on why you would not want to run PulseAudio as a system-wide service.)






            share|improve this answer













            This doesn't really explain the Failed to create '/var/run/pulse': Permission denied message, but there's one apparent issue in your configuration, which is that you're running PulseAudio with --daemonize from the systemd service unit, while systemd actually expects it to run in foreground. You should change that to --daemonize=no.



            You might also want to explicitly list --disallow-exit and --disallow-module-loading as suggested from the log messages.



            PulseAudio is also complaining that user pulse's home directory is not /var/run/pulse, as it seems to expect that, you might want to update the system account to reflect that.



            For further research, you might want to look at this article for more details and instructions on running a system-wide instance of PulseAudio, and also this page from the PulseAudio wiki (including some references on why you would not want to run PulseAudio as a system-wide service.)







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 7 '18 at 0:57









            filbrandenfilbranden

            8,23621139




            8,23621139













            • My working theory at the time was that pulse wasn't understanding the symlink from /var/run to /run so I had adjusted the home directory of the pulse user to /run. This however did not resolve the issue. I also tried with those options in there, and it didn't seem to do anything.

              – duper51
              Nov 7 '18 at 1:03











            • The symlink is there so applications using the /var/run paths can run unmodified. I suggest you just use /var/run paths everywhere. (Right now you have a mix of both!)

              – filbranden
              Nov 7 '18 at 1:08











            • The fact is it tries to make /var/run/pulse even though it exists and by all rights should be able to see that it does. /var/run/pulse -> /run/pulse

              – duper51
              Nov 7 '18 at 1:23











            • Is it possible this is SELinux related? Do you have it enabled? Do you have messages about AVC in your logs?

              – filbranden
              Nov 7 '18 at 2:52











            • In any case, the other problems mentioned are issues you'll have to address, so I suggest you start with those, see if it's still not working and then we can look at what's next...

              – filbranden
              Nov 7 '18 at 2:52



















            • My working theory at the time was that pulse wasn't understanding the symlink from /var/run to /run so I had adjusted the home directory of the pulse user to /run. This however did not resolve the issue. I also tried with those options in there, and it didn't seem to do anything.

              – duper51
              Nov 7 '18 at 1:03











            • The symlink is there so applications using the /var/run paths can run unmodified. I suggest you just use /var/run paths everywhere. (Right now you have a mix of both!)

              – filbranden
              Nov 7 '18 at 1:08











            • The fact is it tries to make /var/run/pulse even though it exists and by all rights should be able to see that it does. /var/run/pulse -> /run/pulse

              – duper51
              Nov 7 '18 at 1:23











            • Is it possible this is SELinux related? Do you have it enabled? Do you have messages about AVC in your logs?

              – filbranden
              Nov 7 '18 at 2:52











            • In any case, the other problems mentioned are issues you'll have to address, so I suggest you start with those, see if it's still not working and then we can look at what's next...

              – filbranden
              Nov 7 '18 at 2:52

















            My working theory at the time was that pulse wasn't understanding the symlink from /var/run to /run so I had adjusted the home directory of the pulse user to /run. This however did not resolve the issue. I also tried with those options in there, and it didn't seem to do anything.

            – duper51
            Nov 7 '18 at 1:03





            My working theory at the time was that pulse wasn't understanding the symlink from /var/run to /run so I had adjusted the home directory of the pulse user to /run. This however did not resolve the issue. I also tried with those options in there, and it didn't seem to do anything.

            – duper51
            Nov 7 '18 at 1:03













            The symlink is there so applications using the /var/run paths can run unmodified. I suggest you just use /var/run paths everywhere. (Right now you have a mix of both!)

            – filbranden
            Nov 7 '18 at 1:08





            The symlink is there so applications using the /var/run paths can run unmodified. I suggest you just use /var/run paths everywhere. (Right now you have a mix of both!)

            – filbranden
            Nov 7 '18 at 1:08













            The fact is it tries to make /var/run/pulse even though it exists and by all rights should be able to see that it does. /var/run/pulse -> /run/pulse

            – duper51
            Nov 7 '18 at 1:23





            The fact is it tries to make /var/run/pulse even though it exists and by all rights should be able to see that it does. /var/run/pulse -> /run/pulse

            – duper51
            Nov 7 '18 at 1:23













            Is it possible this is SELinux related? Do you have it enabled? Do you have messages about AVC in your logs?

            – filbranden
            Nov 7 '18 at 2:52





            Is it possible this is SELinux related? Do you have it enabled? Do you have messages about AVC in your logs?

            – filbranden
            Nov 7 '18 at 2:52













            In any case, the other problems mentioned are issues you'll have to address, so I suggest you start with those, see if it's still not working and then we can look at what's next...

            – filbranden
            Nov 7 '18 at 2:52





            In any case, the other problems mentioned are issues you'll have to address, so I suggest you start with those, see if it's still not working and then we can look at what's next...

            – filbranden
            Nov 7 '18 at 2:52













            0














            You can try putting pulseaudio.service with --user in a shell script to start it. Now run the start script inside screen as a normal user. Then detach the screen and logout. The pulseaudio server continues as if it were headless.






            share|improve this answer




























              0














              You can try putting pulseaudio.service with --user in a shell script to start it. Now run the start script inside screen as a normal user. Then detach the screen and logout. The pulseaudio server continues as if it were headless.






              share|improve this answer


























                0












                0








                0







                You can try putting pulseaudio.service with --user in a shell script to start it. Now run the start script inside screen as a normal user. Then detach the screen and logout. The pulseaudio server continues as if it were headless.






                share|improve this answer













                You can try putting pulseaudio.service with --user in a shell script to start it. Now run the start script inside screen as a normal user. Then detach the screen and logout. The pulseaudio server continues as if it were headless.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 30 at 22:25









                snow6oysnow6oy

                1012




                1012






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    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















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How to make a Squid Proxy server?

                    Is this a new Fibonacci Identity?

                    19世紀