inittab respawn and rc.local












0















At the moment I have a daemon starting at boot using rc.local by the following line.



su -l user -c '/dir/daemon'


but I would like to start this process as a service with respawn. I found out that it should be added to /etc/inittab with something like



daemon:run-level:respawn:script-to-daemon



  1. which run level should I use?

  2. how do I have it executed as user?

  3. if I'm using inittab should I remove the line in rc.local

  4. is there something like forever that'll do this for me










share|improve this question



























    0















    At the moment I have a daemon starting at boot using rc.local by the following line.



    su -l user -c '/dir/daemon'


    but I would like to start this process as a service with respawn. I found out that it should be added to /etc/inittab with something like



    daemon:run-level:respawn:script-to-daemon



    1. which run level should I use?

    2. how do I have it executed as user?

    3. if I'm using inittab should I remove the line in rc.local

    4. is there something like forever that'll do this for me










    share|improve this question

























      0












      0








      0








      At the moment I have a daemon starting at boot using rc.local by the following line.



      su -l user -c '/dir/daemon'


      but I would like to start this process as a service with respawn. I found out that it should be added to /etc/inittab with something like



      daemon:run-level:respawn:script-to-daemon



      1. which run level should I use?

      2. how do I have it executed as user?

      3. if I'm using inittab should I remove the line in rc.local

      4. is there something like forever that'll do this for me










      share|improve this question














      At the moment I have a daemon starting at boot using rc.local by the following line.



      su -l user -c '/dir/daemon'


      but I would like to start this process as a service with respawn. I found out that it should be added to /etc/inittab with something like



      daemon:run-level:respawn:script-to-daemon



      1. which run level should I use?

      2. how do I have it executed as user?

      3. if I'm using inittab should I remove the line in rc.local

      4. is there something like forever that'll do this for me







      bash init-script daemon init






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jun 22 '15 at 22:53









      Kuravi HKuravi H

      263




      263






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Forget about /etc/inittab.



          If you have Ubuntu with upstart, or one of the systemd operating systems, then your system completely ignores /etc/inittab and it is a complete irrelevance.




          • Scott James Remnant and James Hunt. inittab(5). Ubuntu version 12 manual pages.

          • https://unix.stackexchange.com/a/196197/5132


          Forget about runlevels.



          They exist in systemd operating systems, but only as compatibility shims. The systemd documentation states that the concept is "obsolete". If you're starting with this on a systemd operating system, don't start there.




          • https://unix.stackexchange.com/a/196014/5132


          Forget about forever.



          If you have a service manager, be it runit, systemd, perp, nosh, upstart, s6, or daemontools-encore, then it's already doing what you think you need forever for.




          • https://askubuntu.com/a/625378/43344


          Take your stuff out of rc.local.



          On an upstart or systemd system it's really as much of a compatibility shim as runlevels are.



          Put your stuff into an upstart job or a systemd service unit.



          The latter would look something like



          [Unit]
          Description=Start the wibble daemon

          [Service]
          User=wibble-d
          ExecStart=/usr/local/bin/wibbled
          Restart=always

          [Install]
          WantedBy=multi-user.target



          • https://askubuntu.com/a/613785/43344

          • https://askubuntu.com/a/623085/43344

          • https://askubuntu.com/a/626858/43344






          share|improve this answer


























          • Thanks, but systemd or upstart is not an option, the system in question is running lenny, and updating is a huge pain (its a vortex86 processor and the manufacturer provided patched kernel recommends debian 5) instead of going in to a partial upgrade, I'd rather figure out how to use inittab.

            – Kuravi H
            Jun 26 '15 at 2:38











          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%2f211453%2finittab-respawn-and-rc-local%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









          0














          Forget about /etc/inittab.



          If you have Ubuntu with upstart, or one of the systemd operating systems, then your system completely ignores /etc/inittab and it is a complete irrelevance.




          • Scott James Remnant and James Hunt. inittab(5). Ubuntu version 12 manual pages.

          • https://unix.stackexchange.com/a/196197/5132


          Forget about runlevels.



          They exist in systemd operating systems, but only as compatibility shims. The systemd documentation states that the concept is "obsolete". If you're starting with this on a systemd operating system, don't start there.




          • https://unix.stackexchange.com/a/196014/5132


          Forget about forever.



          If you have a service manager, be it runit, systemd, perp, nosh, upstart, s6, or daemontools-encore, then it's already doing what you think you need forever for.




          • https://askubuntu.com/a/625378/43344


          Take your stuff out of rc.local.



          On an upstart or systemd system it's really as much of a compatibility shim as runlevels are.



          Put your stuff into an upstart job or a systemd service unit.



          The latter would look something like



          [Unit]
          Description=Start the wibble daemon

          [Service]
          User=wibble-d
          ExecStart=/usr/local/bin/wibbled
          Restart=always

          [Install]
          WantedBy=multi-user.target



          • https://askubuntu.com/a/613785/43344

          • https://askubuntu.com/a/623085/43344

          • https://askubuntu.com/a/626858/43344






          share|improve this answer


























          • Thanks, but systemd or upstart is not an option, the system in question is running lenny, and updating is a huge pain (its a vortex86 processor and the manufacturer provided patched kernel recommends debian 5) instead of going in to a partial upgrade, I'd rather figure out how to use inittab.

            – Kuravi H
            Jun 26 '15 at 2:38
















          0














          Forget about /etc/inittab.



          If you have Ubuntu with upstart, or one of the systemd operating systems, then your system completely ignores /etc/inittab and it is a complete irrelevance.




          • Scott James Remnant and James Hunt. inittab(5). Ubuntu version 12 manual pages.

          • https://unix.stackexchange.com/a/196197/5132


          Forget about runlevels.



          They exist in systemd operating systems, but only as compatibility shims. The systemd documentation states that the concept is "obsolete". If you're starting with this on a systemd operating system, don't start there.




          • https://unix.stackexchange.com/a/196014/5132


          Forget about forever.



          If you have a service manager, be it runit, systemd, perp, nosh, upstart, s6, or daemontools-encore, then it's already doing what you think you need forever for.




          • https://askubuntu.com/a/625378/43344


          Take your stuff out of rc.local.



          On an upstart or systemd system it's really as much of a compatibility shim as runlevels are.



          Put your stuff into an upstart job or a systemd service unit.



          The latter would look something like



          [Unit]
          Description=Start the wibble daemon

          [Service]
          User=wibble-d
          ExecStart=/usr/local/bin/wibbled
          Restart=always

          [Install]
          WantedBy=multi-user.target



          • https://askubuntu.com/a/613785/43344

          • https://askubuntu.com/a/623085/43344

          • https://askubuntu.com/a/626858/43344






          share|improve this answer


























          • Thanks, but systemd or upstart is not an option, the system in question is running lenny, and updating is a huge pain (its a vortex86 processor and the manufacturer provided patched kernel recommends debian 5) instead of going in to a partial upgrade, I'd rather figure out how to use inittab.

            – Kuravi H
            Jun 26 '15 at 2:38














          0












          0








          0







          Forget about /etc/inittab.



          If you have Ubuntu with upstart, or one of the systemd operating systems, then your system completely ignores /etc/inittab and it is a complete irrelevance.




          • Scott James Remnant and James Hunt. inittab(5). Ubuntu version 12 manual pages.

          • https://unix.stackexchange.com/a/196197/5132


          Forget about runlevels.



          They exist in systemd operating systems, but only as compatibility shims. The systemd documentation states that the concept is "obsolete". If you're starting with this on a systemd operating system, don't start there.




          • https://unix.stackexchange.com/a/196014/5132


          Forget about forever.



          If you have a service manager, be it runit, systemd, perp, nosh, upstart, s6, or daemontools-encore, then it's already doing what you think you need forever for.




          • https://askubuntu.com/a/625378/43344


          Take your stuff out of rc.local.



          On an upstart or systemd system it's really as much of a compatibility shim as runlevels are.



          Put your stuff into an upstart job or a systemd service unit.



          The latter would look something like



          [Unit]
          Description=Start the wibble daemon

          [Service]
          User=wibble-d
          ExecStart=/usr/local/bin/wibbled
          Restart=always

          [Install]
          WantedBy=multi-user.target



          • https://askubuntu.com/a/613785/43344

          • https://askubuntu.com/a/623085/43344

          • https://askubuntu.com/a/626858/43344






          share|improve this answer















          Forget about /etc/inittab.



          If you have Ubuntu with upstart, or one of the systemd operating systems, then your system completely ignores /etc/inittab and it is a complete irrelevance.




          • Scott James Remnant and James Hunt. inittab(5). Ubuntu version 12 manual pages.

          • https://unix.stackexchange.com/a/196197/5132


          Forget about runlevels.



          They exist in systemd operating systems, but only as compatibility shims. The systemd documentation states that the concept is "obsolete". If you're starting with this on a systemd operating system, don't start there.




          • https://unix.stackexchange.com/a/196014/5132


          Forget about forever.



          If you have a service manager, be it runit, systemd, perp, nosh, upstart, s6, or daemontools-encore, then it's already doing what you think you need forever for.




          • https://askubuntu.com/a/625378/43344


          Take your stuff out of rc.local.



          On an upstart or systemd system it's really as much of a compatibility shim as runlevels are.



          Put your stuff into an upstart job or a systemd service unit.



          The latter would look something like



          [Unit]
          Description=Start the wibble daemon

          [Service]
          User=wibble-d
          ExecStart=/usr/local/bin/wibbled
          Restart=always

          [Install]
          WantedBy=multi-user.target



          • https://askubuntu.com/a/613785/43344

          • https://askubuntu.com/a/623085/43344

          • https://askubuntu.com/a/626858/43344







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 13 '17 at 12:36









          Community

          1




          1










          answered Jun 24 '15 at 19:34









          JdeBPJdeBP

          33.6k469158




          33.6k469158













          • Thanks, but systemd or upstart is not an option, the system in question is running lenny, and updating is a huge pain (its a vortex86 processor and the manufacturer provided patched kernel recommends debian 5) instead of going in to a partial upgrade, I'd rather figure out how to use inittab.

            – Kuravi H
            Jun 26 '15 at 2:38



















          • Thanks, but systemd or upstart is not an option, the system in question is running lenny, and updating is a huge pain (its a vortex86 processor and the manufacturer provided patched kernel recommends debian 5) instead of going in to a partial upgrade, I'd rather figure out how to use inittab.

            – Kuravi H
            Jun 26 '15 at 2:38

















          Thanks, but systemd or upstart is not an option, the system in question is running lenny, and updating is a huge pain (its a vortex86 processor and the manufacturer provided patched kernel recommends debian 5) instead of going in to a partial upgrade, I'd rather figure out how to use inittab.

          – Kuravi H
          Jun 26 '15 at 2:38





          Thanks, but systemd or upstart is not an option, the system in question is running lenny, and updating is a huge pain (its a vortex86 processor and the manufacturer provided patched kernel recommends debian 5) instead of going in to a partial upgrade, I'd rather figure out how to use inittab.

          – Kuravi H
          Jun 26 '15 at 2:38


















          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%2f211453%2finittab-respawn-and-rc-local%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?

          Touch on Surface Book