journald socket buffering for option ForwardToSyslog

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











up vote
0
down vote

favorite












I have a configuration in which journald is set with ForwardToSyslog=yes. Quote from the documentation:




If forwarding
to syslog is enabled but nothing reads messages from the socket,
forwarding to syslog has no effect.




I am experiencing a different observation with the following test:



systemctl disable rsyslog
systemctl stop rsyslog
logger "rsyslog is dropped, journald won't forward this message"
systemctl enable rsyslog
systemctl start rsyslog


The result is that rsyslog manages to end up processing the message.



rsyslog has been set without the capability to read the journal database.



My assumption is that socket buffering capabilities are causing rsyslog receive before the time it is running.



If that is the case is it possible to remove this buffering of at least force flushing the socket from bash somehow so rsyslogs history starts together with it?










share|improve this question

























    up vote
    0
    down vote

    favorite












    I have a configuration in which journald is set with ForwardToSyslog=yes. Quote from the documentation:




    If forwarding
    to syslog is enabled but nothing reads messages from the socket,
    forwarding to syslog has no effect.




    I am experiencing a different observation with the following test:



    systemctl disable rsyslog
    systemctl stop rsyslog
    logger "rsyslog is dropped, journald won't forward this message"
    systemctl enable rsyslog
    systemctl start rsyslog


    The result is that rsyslog manages to end up processing the message.



    rsyslog has been set without the capability to read the journal database.



    My assumption is that socket buffering capabilities are causing rsyslog receive before the time it is running.



    If that is the case is it possible to remove this buffering of at least force flushing the socket from bash somehow so rsyslogs history starts together with it?










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have a configuration in which journald is set with ForwardToSyslog=yes. Quote from the documentation:




      If forwarding
      to syslog is enabled but nothing reads messages from the socket,
      forwarding to syslog has no effect.




      I am experiencing a different observation with the following test:



      systemctl disable rsyslog
      systemctl stop rsyslog
      logger "rsyslog is dropped, journald won't forward this message"
      systemctl enable rsyslog
      systemctl start rsyslog


      The result is that rsyslog manages to end up processing the message.



      rsyslog has been set without the capability to read the journal database.



      My assumption is that socket buffering capabilities are causing rsyslog receive before the time it is running.



      If that is the case is it possible to remove this buffering of at least force flushing the socket from bash somehow so rsyslogs history starts together with it?










      share|improve this question













      I have a configuration in which journald is set with ForwardToSyslog=yes. Quote from the documentation:




      If forwarding
      to syslog is enabled but nothing reads messages from the socket,
      forwarding to syslog has no effect.




      I am experiencing a different observation with the following test:



      systemctl disable rsyslog
      systemctl stop rsyslog
      logger "rsyslog is dropped, journald won't forward this message"
      systemctl enable rsyslog
      systemctl start rsyslog


      The result is that rsyslog manages to end up processing the message.



      rsyslog has been set without the capability to read the journal database.



      My assumption is that socket buffering capabilities are causing rsyslog receive before the time it is running.



      If that is the case is it possible to remove this buffering of at least force flushing the socket from bash somehow so rsyslogs history starts together with it?







      systemd rsyslog systemd-journald






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 days ago









      TheMeaningfulEngineer

      1,60963568




      1,60963568




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          One option is to have rsyslog consume the socket directly and not rely on receiving the data form systemd socket:



          # /etc/rsyslog.conf should contain
          module(load="imuxsock"
          SysSock.Use="on"
          SysSock.Name="/run/systemd/journal/syslog")


          # cat /lib/systemd/system/rsyslog.service
          [Unit]
          Description=System Logging Service
          Documentation=man:rsyslogd(8)
          Documentation=http://www.rsyslog.com/doc/

          [Service]
          Type=notify
          ExecStart=/usr/sbin/rsyslogd -n
          StandardOutput=null
          Restart=on-failure

          [Install]
          WantedBy=multi-user.target


          This has multiple implications:



          • rsyslog wont be automatically started when there are events on the socket (this is what I want to achieve, just being explicit)

          • it isn't clear if this conflicts with the rsyslog code which is coupled to systemd socket activation

          • it seems to be officially discuraged





          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',
            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%2f482136%2fjournald-socket-buffering-for-option-forwardtosyslog%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote













            One option is to have rsyslog consume the socket directly and not rely on receiving the data form systemd socket:



            # /etc/rsyslog.conf should contain
            module(load="imuxsock"
            SysSock.Use="on"
            SysSock.Name="/run/systemd/journal/syslog")


            # cat /lib/systemd/system/rsyslog.service
            [Unit]
            Description=System Logging Service
            Documentation=man:rsyslogd(8)
            Documentation=http://www.rsyslog.com/doc/

            [Service]
            Type=notify
            ExecStart=/usr/sbin/rsyslogd -n
            StandardOutput=null
            Restart=on-failure

            [Install]
            WantedBy=multi-user.target


            This has multiple implications:



            • rsyslog wont be automatically started when there are events on the socket (this is what I want to achieve, just being explicit)

            • it isn't clear if this conflicts with the rsyslog code which is coupled to systemd socket activation

            • it seems to be officially discuraged





            share|improve this answer


























              up vote
              1
              down vote













              One option is to have rsyslog consume the socket directly and not rely on receiving the data form systemd socket:



              # /etc/rsyslog.conf should contain
              module(load="imuxsock"
              SysSock.Use="on"
              SysSock.Name="/run/systemd/journal/syslog")


              # cat /lib/systemd/system/rsyslog.service
              [Unit]
              Description=System Logging Service
              Documentation=man:rsyslogd(8)
              Documentation=http://www.rsyslog.com/doc/

              [Service]
              Type=notify
              ExecStart=/usr/sbin/rsyslogd -n
              StandardOutput=null
              Restart=on-failure

              [Install]
              WantedBy=multi-user.target


              This has multiple implications:



              • rsyslog wont be automatically started when there are events on the socket (this is what I want to achieve, just being explicit)

              • it isn't clear if this conflicts with the rsyslog code which is coupled to systemd socket activation

              • it seems to be officially discuraged





              share|improve this answer
























                up vote
                1
                down vote










                up vote
                1
                down vote









                One option is to have rsyslog consume the socket directly and not rely on receiving the data form systemd socket:



                # /etc/rsyslog.conf should contain
                module(load="imuxsock"
                SysSock.Use="on"
                SysSock.Name="/run/systemd/journal/syslog")


                # cat /lib/systemd/system/rsyslog.service
                [Unit]
                Description=System Logging Service
                Documentation=man:rsyslogd(8)
                Documentation=http://www.rsyslog.com/doc/

                [Service]
                Type=notify
                ExecStart=/usr/sbin/rsyslogd -n
                StandardOutput=null
                Restart=on-failure

                [Install]
                WantedBy=multi-user.target


                This has multiple implications:



                • rsyslog wont be automatically started when there are events on the socket (this is what I want to achieve, just being explicit)

                • it isn't clear if this conflicts with the rsyslog code which is coupled to systemd socket activation

                • it seems to be officially discuraged





                share|improve this answer














                One option is to have rsyslog consume the socket directly and not rely on receiving the data form systemd socket:



                # /etc/rsyslog.conf should contain
                module(load="imuxsock"
                SysSock.Use="on"
                SysSock.Name="/run/systemd/journal/syslog")


                # cat /lib/systemd/system/rsyslog.service
                [Unit]
                Description=System Logging Service
                Documentation=man:rsyslogd(8)
                Documentation=http://www.rsyslog.com/doc/

                [Service]
                Type=notify
                ExecStart=/usr/sbin/rsyslogd -n
                StandardOutput=null
                Restart=on-failure

                [Install]
                WantedBy=multi-user.target


                This has multiple implications:



                • rsyslog wont be automatically started when there are events on the socket (this is what I want to achieve, just being explicit)

                • it isn't clear if this conflicts with the rsyslog code which is coupled to systemd socket activation

                • it seems to be officially discuraged






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 2 days ago

























                answered 2 days ago









                TheMeaningfulEngineer

                1,60963568




                1,60963568



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f482136%2fjournald-socket-buffering-for-option-forwardtosyslog%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 check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay