/etc/init.d/rsyslog {start | stop | restart} : Need this to work











up vote
0
down vote

favorite












I have read the answer/comments for the thread
Diffrence between /etc/init.d/ssh start and service ssh start.



But I need this /etc/init.d method to be working. I have some auto-generated scripts which invoke /etc/init.d method only. Could you kindly provide me some fix/workaround for this?










share|improve this question
























  • The old SysV method of putting script in /etc/init.d will still work if everything is in place. Also note that service is a good option in the sense that it will first look in /etc/init and then /etc/init.d for the script so if a script is only in /etc/init.d then service will do the same as /etc/init.d/script start|stop|restart ..what is your goal ?
    – heemayl
    Sep 16 '15 at 12:06










  • @heemayl I'd be curious to know if that's actually the case though. Upstart (et al) have very different ways of monitoring the PID and status of things, so if Upstart starts rsyslog, will the sysv-init version be able to stop it? Would the upstart command be able to stop a sysv-init version?
    – Oli
    Sep 16 '15 at 12:10










  • @Oli if both scripts exist then the one in /etc/init.d would contain some logic that would skip it if the init is upstart/systemd..if the script is only in /etc/init.d then it would work as expected..
    – heemayl
    Sep 16 '15 at 12:13










  • Hi Heemay, thanks for your comments..well, actually I am trying to install defense4all package & this guy keeps on complaining about "Failed to start rsyslog service". After some investigation I saw it uses one auto/runtime generated script to start 'rsyslogd' through /etc/init.d. I am very new to this defense4all & I donno where to change that script (if at all possible). To me, making /etc/init.d working looked easier compared to that other option. I understand /etc/init.d is not the recommended method, but I thought there might be some workaround for this.
    – Sanjib
    Sep 16 '15 at 12:14










  • Hard to tell without seeing the insights..please edit your question and the mentioned script residing in /etc/init.d....also while responding to someone's comment please use "@name" e.g. @heemayl
    – heemayl
    Sep 16 '15 at 13:01















up vote
0
down vote

favorite












I have read the answer/comments for the thread
Diffrence between /etc/init.d/ssh start and service ssh start.



But I need this /etc/init.d method to be working. I have some auto-generated scripts which invoke /etc/init.d method only. Could you kindly provide me some fix/workaround for this?










share|improve this question
























  • The old SysV method of putting script in /etc/init.d will still work if everything is in place. Also note that service is a good option in the sense that it will first look in /etc/init and then /etc/init.d for the script so if a script is only in /etc/init.d then service will do the same as /etc/init.d/script start|stop|restart ..what is your goal ?
    – heemayl
    Sep 16 '15 at 12:06










  • @heemayl I'd be curious to know if that's actually the case though. Upstart (et al) have very different ways of monitoring the PID and status of things, so if Upstart starts rsyslog, will the sysv-init version be able to stop it? Would the upstart command be able to stop a sysv-init version?
    – Oli
    Sep 16 '15 at 12:10










  • @Oli if both scripts exist then the one in /etc/init.d would contain some logic that would skip it if the init is upstart/systemd..if the script is only in /etc/init.d then it would work as expected..
    – heemayl
    Sep 16 '15 at 12:13










  • Hi Heemay, thanks for your comments..well, actually I am trying to install defense4all package & this guy keeps on complaining about "Failed to start rsyslog service". After some investigation I saw it uses one auto/runtime generated script to start 'rsyslogd' through /etc/init.d. I am very new to this defense4all & I donno where to change that script (if at all possible). To me, making /etc/init.d working looked easier compared to that other option. I understand /etc/init.d is not the recommended method, but I thought there might be some workaround for this.
    – Sanjib
    Sep 16 '15 at 12:14










  • Hard to tell without seeing the insights..please edit your question and the mentioned script residing in /etc/init.d....also while responding to someone's comment please use "@name" e.g. @heemayl
    – heemayl
    Sep 16 '15 at 13:01













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have read the answer/comments for the thread
Diffrence between /etc/init.d/ssh start and service ssh start.



But I need this /etc/init.d method to be working. I have some auto-generated scripts which invoke /etc/init.d method only. Could you kindly provide me some fix/workaround for this?










share|improve this question















I have read the answer/comments for the thread
Diffrence between /etc/init.d/ssh start and service ssh start.



But I need this /etc/init.d method to be working. I have some auto-generated scripts which invoke /etc/init.d method only. Could you kindly provide me some fix/workaround for this?







services init.d






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 3 at 6:19









Melebius

4,22451837




4,22451837










asked Sep 16 '15 at 11:59









Sanjib

614




614












  • The old SysV method of putting script in /etc/init.d will still work if everything is in place. Also note that service is a good option in the sense that it will first look in /etc/init and then /etc/init.d for the script so if a script is only in /etc/init.d then service will do the same as /etc/init.d/script start|stop|restart ..what is your goal ?
    – heemayl
    Sep 16 '15 at 12:06










  • @heemayl I'd be curious to know if that's actually the case though. Upstart (et al) have very different ways of monitoring the PID and status of things, so if Upstart starts rsyslog, will the sysv-init version be able to stop it? Would the upstart command be able to stop a sysv-init version?
    – Oli
    Sep 16 '15 at 12:10










  • @Oli if both scripts exist then the one in /etc/init.d would contain some logic that would skip it if the init is upstart/systemd..if the script is only in /etc/init.d then it would work as expected..
    – heemayl
    Sep 16 '15 at 12:13










  • Hi Heemay, thanks for your comments..well, actually I am trying to install defense4all package & this guy keeps on complaining about "Failed to start rsyslog service". After some investigation I saw it uses one auto/runtime generated script to start 'rsyslogd' through /etc/init.d. I am very new to this defense4all & I donno where to change that script (if at all possible). To me, making /etc/init.d working looked easier compared to that other option. I understand /etc/init.d is not the recommended method, but I thought there might be some workaround for this.
    – Sanjib
    Sep 16 '15 at 12:14










  • Hard to tell without seeing the insights..please edit your question and the mentioned script residing in /etc/init.d....also while responding to someone's comment please use "@name" e.g. @heemayl
    – heemayl
    Sep 16 '15 at 13:01


















  • The old SysV method of putting script in /etc/init.d will still work if everything is in place. Also note that service is a good option in the sense that it will first look in /etc/init and then /etc/init.d for the script so if a script is only in /etc/init.d then service will do the same as /etc/init.d/script start|stop|restart ..what is your goal ?
    – heemayl
    Sep 16 '15 at 12:06










  • @heemayl I'd be curious to know if that's actually the case though. Upstart (et al) have very different ways of monitoring the PID and status of things, so if Upstart starts rsyslog, will the sysv-init version be able to stop it? Would the upstart command be able to stop a sysv-init version?
    – Oli
    Sep 16 '15 at 12:10










  • @Oli if both scripts exist then the one in /etc/init.d would contain some logic that would skip it if the init is upstart/systemd..if the script is only in /etc/init.d then it would work as expected..
    – heemayl
    Sep 16 '15 at 12:13










  • Hi Heemay, thanks for your comments..well, actually I am trying to install defense4all package & this guy keeps on complaining about "Failed to start rsyslog service". After some investigation I saw it uses one auto/runtime generated script to start 'rsyslogd' through /etc/init.d. I am very new to this defense4all & I donno where to change that script (if at all possible). To me, making /etc/init.d working looked easier compared to that other option. I understand /etc/init.d is not the recommended method, but I thought there might be some workaround for this.
    – Sanjib
    Sep 16 '15 at 12:14










  • Hard to tell without seeing the insights..please edit your question and the mentioned script residing in /etc/init.d....also while responding to someone's comment please use "@name" e.g. @heemayl
    – heemayl
    Sep 16 '15 at 13:01
















The old SysV method of putting script in /etc/init.d will still work if everything is in place. Also note that service is a good option in the sense that it will first look in /etc/init and then /etc/init.d for the script so if a script is only in /etc/init.d then service will do the same as /etc/init.d/script start|stop|restart ..what is your goal ?
– heemayl
Sep 16 '15 at 12:06




The old SysV method of putting script in /etc/init.d will still work if everything is in place. Also note that service is a good option in the sense that it will first look in /etc/init and then /etc/init.d for the script so if a script is only in /etc/init.d then service will do the same as /etc/init.d/script start|stop|restart ..what is your goal ?
– heemayl
Sep 16 '15 at 12:06












@heemayl I'd be curious to know if that's actually the case though. Upstart (et al) have very different ways of monitoring the PID and status of things, so if Upstart starts rsyslog, will the sysv-init version be able to stop it? Would the upstart command be able to stop a sysv-init version?
– Oli
Sep 16 '15 at 12:10




@heemayl I'd be curious to know if that's actually the case though. Upstart (et al) have very different ways of monitoring the PID and status of things, so if Upstart starts rsyslog, will the sysv-init version be able to stop it? Would the upstart command be able to stop a sysv-init version?
– Oli
Sep 16 '15 at 12:10












@Oli if both scripts exist then the one in /etc/init.d would contain some logic that would skip it if the init is upstart/systemd..if the script is only in /etc/init.d then it would work as expected..
– heemayl
Sep 16 '15 at 12:13




@Oli if both scripts exist then the one in /etc/init.d would contain some logic that would skip it if the init is upstart/systemd..if the script is only in /etc/init.d then it would work as expected..
– heemayl
Sep 16 '15 at 12:13












Hi Heemay, thanks for your comments..well, actually I am trying to install defense4all package & this guy keeps on complaining about "Failed to start rsyslog service". After some investigation I saw it uses one auto/runtime generated script to start 'rsyslogd' through /etc/init.d. I am very new to this defense4all & I donno where to change that script (if at all possible). To me, making /etc/init.d working looked easier compared to that other option. I understand /etc/init.d is not the recommended method, but I thought there might be some workaround for this.
– Sanjib
Sep 16 '15 at 12:14




Hi Heemay, thanks for your comments..well, actually I am trying to install defense4all package & this guy keeps on complaining about "Failed to start rsyslog service". After some investigation I saw it uses one auto/runtime generated script to start 'rsyslogd' through /etc/init.d. I am very new to this defense4all & I donno where to change that script (if at all possible). To me, making /etc/init.d working looked easier compared to that other option. I understand /etc/init.d is not the recommended method, but I thought there might be some workaround for this.
– Sanjib
Sep 16 '15 at 12:14












Hard to tell without seeing the insights..please edit your question and the mentioned script residing in /etc/init.d....also while responding to someone's comment please use "@name" e.g. @heemayl
– heemayl
Sep 16 '15 at 13:01




Hard to tell without seeing the insights..please edit your question and the mentioned script residing in /etc/init.d....also while responding to someone's comment please use "@name" e.g. @heemayl
– heemayl
Sep 16 '15 at 13:01










2 Answers
2






active

oldest

votes

















up vote
0
down vote













The last answer is a way to solve the defense4all installation problem about "Failed to start rsyslog service".This problem is caused by the bug of rsyslog (maybe, I found on the other webs), you can use service rsyslog instead of /etc/init.d/rsyslog, so you can edit the file in defense4all code files to solve this problem.



In the file:



../defense4all/dfapp.aggregate/src/install/config_rsyslog.bash


change the last sentences:



/etc/init.d/rsyslog stop > /dev/null 


to:



service rsyslog stop


and:



/etc/init.d/rsyslog stop > /dev/null   


to:



service rsyslog start


And then rebuild the project to create .deb or .rpm files.Hope this may help you.






share|improve this answer






























    up vote
    0
    down vote













    You faced this problem because the rsyslog script in newer Ubuntu is written to be handled by upstart and not the traditional init daemon.



    I saw your fix in the comments above. Another workaround that allows your automation scripts to continue using /etc/init.d/rsyslog start|stop is -



    Edit the file /etc/init.d/rsyslog , comment/delete all instances of following code block -



    if init_is_upstart; then
    exit 1 (or exit 0)
    fi


    Now



    /etc/init.d/rsyslog start|stop


    should work.



    For more information, see this.






    share|improve this answer





















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      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: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      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%2faskubuntu.com%2fquestions%2f674769%2fetc-init-d-rsyslog-start-stop-restart-need-this-to-work%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








      up vote
      0
      down vote













      The last answer is a way to solve the defense4all installation problem about "Failed to start rsyslog service".This problem is caused by the bug of rsyslog (maybe, I found on the other webs), you can use service rsyslog instead of /etc/init.d/rsyslog, so you can edit the file in defense4all code files to solve this problem.



      In the file:



      ../defense4all/dfapp.aggregate/src/install/config_rsyslog.bash


      change the last sentences:



      /etc/init.d/rsyslog stop > /dev/null 


      to:



      service rsyslog stop


      and:



      /etc/init.d/rsyslog stop > /dev/null   


      to:



      service rsyslog start


      And then rebuild the project to create .deb or .rpm files.Hope this may help you.






      share|improve this answer



























        up vote
        0
        down vote













        The last answer is a way to solve the defense4all installation problem about "Failed to start rsyslog service".This problem is caused by the bug of rsyslog (maybe, I found on the other webs), you can use service rsyslog instead of /etc/init.d/rsyslog, so you can edit the file in defense4all code files to solve this problem.



        In the file:



        ../defense4all/dfapp.aggregate/src/install/config_rsyslog.bash


        change the last sentences:



        /etc/init.d/rsyslog stop > /dev/null 


        to:



        service rsyslog stop


        and:



        /etc/init.d/rsyslog stop > /dev/null   


        to:



        service rsyslog start


        And then rebuild the project to create .deb or .rpm files.Hope this may help you.






        share|improve this answer

























          up vote
          0
          down vote










          up vote
          0
          down vote









          The last answer is a way to solve the defense4all installation problem about "Failed to start rsyslog service".This problem is caused by the bug of rsyslog (maybe, I found on the other webs), you can use service rsyslog instead of /etc/init.d/rsyslog, so you can edit the file in defense4all code files to solve this problem.



          In the file:



          ../defense4all/dfapp.aggregate/src/install/config_rsyslog.bash


          change the last sentences:



          /etc/init.d/rsyslog stop > /dev/null 


          to:



          service rsyslog stop


          and:



          /etc/init.d/rsyslog stop > /dev/null   


          to:



          service rsyslog start


          And then rebuild the project to create .deb or .rpm files.Hope this may help you.






          share|improve this answer














          The last answer is a way to solve the defense4all installation problem about "Failed to start rsyslog service".This problem is caused by the bug of rsyslog (maybe, I found on the other webs), you can use service rsyslog instead of /etc/init.d/rsyslog, so you can edit the file in defense4all code files to solve this problem.



          In the file:



          ../defense4all/dfapp.aggregate/src/install/config_rsyslog.bash


          change the last sentences:



          /etc/init.d/rsyslog stop > /dev/null 


          to:



          service rsyslog stop


          and:



          /etc/init.d/rsyslog stop > /dev/null   


          to:



          service rsyslog start


          And then rebuild the project to create .deb or .rpm files.Hope this may help you.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 7 '15 at 12:04









          KGIII

          1,2311817




          1,2311817










          answered Nov 7 '15 at 8:25









          Yona

          1




          1
























              up vote
              0
              down vote













              You faced this problem because the rsyslog script in newer Ubuntu is written to be handled by upstart and not the traditional init daemon.



              I saw your fix in the comments above. Another workaround that allows your automation scripts to continue using /etc/init.d/rsyslog start|stop is -



              Edit the file /etc/init.d/rsyslog , comment/delete all instances of following code block -



              if init_is_upstart; then
              exit 1 (or exit 0)
              fi


              Now



              /etc/init.d/rsyslog start|stop


              should work.



              For more information, see this.






              share|improve this answer

























                up vote
                0
                down vote













                You faced this problem because the rsyslog script in newer Ubuntu is written to be handled by upstart and not the traditional init daemon.



                I saw your fix in the comments above. Another workaround that allows your automation scripts to continue using /etc/init.d/rsyslog start|stop is -



                Edit the file /etc/init.d/rsyslog , comment/delete all instances of following code block -



                if init_is_upstart; then
                exit 1 (or exit 0)
                fi


                Now



                /etc/init.d/rsyslog start|stop


                should work.



                For more information, see this.






                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  You faced this problem because the rsyslog script in newer Ubuntu is written to be handled by upstart and not the traditional init daemon.



                  I saw your fix in the comments above. Another workaround that allows your automation scripts to continue using /etc/init.d/rsyslog start|stop is -



                  Edit the file /etc/init.d/rsyslog , comment/delete all instances of following code block -



                  if init_is_upstart; then
                  exit 1 (or exit 0)
                  fi


                  Now



                  /etc/init.d/rsyslog start|stop


                  should work.



                  For more information, see this.






                  share|improve this answer












                  You faced this problem because the rsyslog script in newer Ubuntu is written to be handled by upstart and not the traditional init daemon.



                  I saw your fix in the comments above. Another workaround that allows your automation scripts to continue using /etc/init.d/rsyslog start|stop is -



                  Edit the file /etc/init.d/rsyslog , comment/delete all instances of following code block -



                  if init_is_upstart; then
                  exit 1 (or exit 0)
                  fi


                  Now



                  /etc/init.d/rsyslog start|stop


                  should work.



                  For more information, see this.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Apr 13 '16 at 13:50









                  Siddu

                  11




                  11






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • 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.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • 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%2faskubuntu.com%2fquestions%2f674769%2fetc-init-d-rsyslog-start-stop-restart-need-this-to-work%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

                      flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                      Mangá

                      Eduardo VII do Reino Unido