Windows 10 Linux Subsystem Redis not auto-starting












0















I have installed Redis on Windows 10 Linux Subsystem. I followed the instructions available at https://redis.io/topics/quickstart and I have taken care that I followed all the steps mentioned in section Installing Redis more properly correctly.



However trying to run the following command



sudo update-rc.d redis_6379 defaults


I am getting following error:



~$ sudo update-rc.d redis_6379 defaults
insserv: warning: script 'K01redis_6379' missing LSB tags and overrides
insserv: warning: script 'redis_6379' missing LSB tags and overrides
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'cron' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `cron'
insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `cron'
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'friendly-recovery' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `friendly-recovery'
insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `friendly-recovery'


Manually starting the server works:



~$ sudo /etc/init.d/redis_6379 start
Starting Redis server...
~$ redis-cli ping
PONG


Can anybody please help me in configuring Redis on WLS so that it automatically starts in background like it is the case on actual Ubuntu machine?



Thanks.










share|improve this question



























    0















    I have installed Redis on Windows 10 Linux Subsystem. I followed the instructions available at https://redis.io/topics/quickstart and I have taken care that I followed all the steps mentioned in section Installing Redis more properly correctly.



    However trying to run the following command



    sudo update-rc.d redis_6379 defaults


    I am getting following error:



    ~$ sudo update-rc.d redis_6379 defaults
    insserv: warning: script 'K01redis_6379' missing LSB tags and overrides
    insserv: warning: script 'redis_6379' missing LSB tags and overrides
    initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
    The script you are attempting to invoke has been converted to an Upstart
    job, but lsb-header is not supported for Upstart jobs.
    insserv: warning: script 'cron' missing LSB tags and overrides
    insserv: Default-Start undefined, assuming empty start runlevel(s) for script `cron'
    insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `cron'
    initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
    The script you are attempting to invoke has been converted to an Upstart
    job, but lsb-header is not supported for Upstart jobs.
    insserv: warning: script 'friendly-recovery' missing LSB tags and overrides
    insserv: Default-Start undefined, assuming empty start runlevel(s) for script `friendly-recovery'
    insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `friendly-recovery'


    Manually starting the server works:



    ~$ sudo /etc/init.d/redis_6379 start
    Starting Redis server...
    ~$ redis-cli ping
    PONG


    Can anybody please help me in configuring Redis on WLS so that it automatically starts in background like it is the case on actual Ubuntu machine?



    Thanks.










    share|improve this question

























      0












      0








      0








      I have installed Redis on Windows 10 Linux Subsystem. I followed the instructions available at https://redis.io/topics/quickstart and I have taken care that I followed all the steps mentioned in section Installing Redis more properly correctly.



      However trying to run the following command



      sudo update-rc.d redis_6379 defaults


      I am getting following error:



      ~$ sudo update-rc.d redis_6379 defaults
      insserv: warning: script 'K01redis_6379' missing LSB tags and overrides
      insserv: warning: script 'redis_6379' missing LSB tags and overrides
      initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
      The script you are attempting to invoke has been converted to an Upstart
      job, but lsb-header is not supported for Upstart jobs.
      insserv: warning: script 'cron' missing LSB tags and overrides
      insserv: Default-Start undefined, assuming empty start runlevel(s) for script `cron'
      insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `cron'
      initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
      The script you are attempting to invoke has been converted to an Upstart
      job, but lsb-header is not supported for Upstart jobs.
      insserv: warning: script 'friendly-recovery' missing LSB tags and overrides
      insserv: Default-Start undefined, assuming empty start runlevel(s) for script `friendly-recovery'
      insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `friendly-recovery'


      Manually starting the server works:



      ~$ sudo /etc/init.d/redis_6379 start
      Starting Redis server...
      ~$ redis-cli ping
      PONG


      Can anybody please help me in configuring Redis on WLS so that it automatically starts in background like it is the case on actual Ubuntu machine?



      Thanks.










      share|improve this question














      I have installed Redis on Windows 10 Linux Subsystem. I followed the instructions available at https://redis.io/topics/quickstart and I have taken care that I followed all the steps mentioned in section Installing Redis more properly correctly.



      However trying to run the following command



      sudo update-rc.d redis_6379 defaults


      I am getting following error:



      ~$ sudo update-rc.d redis_6379 defaults
      insserv: warning: script 'K01redis_6379' missing LSB tags and overrides
      insserv: warning: script 'redis_6379' missing LSB tags and overrides
      initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
      The script you are attempting to invoke has been converted to an Upstart
      job, but lsb-header is not supported for Upstart jobs.
      insserv: warning: script 'cron' missing LSB tags and overrides
      insserv: Default-Start undefined, assuming empty start runlevel(s) for script `cron'
      insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `cron'
      initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
      The script you are attempting to invoke has been converted to an Upstart
      job, but lsb-header is not supported for Upstart jobs.
      insserv: warning: script 'friendly-recovery' missing LSB tags and overrides
      insserv: Default-Start undefined, assuming empty start runlevel(s) for script `friendly-recovery'
      insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `friendly-recovery'


      Manually starting the server works:



      ~$ sudo /etc/init.d/redis_6379 start
      Starting Redis server...
      ~$ redis-cli ping
      PONG


      Can anybody please help me in configuring Redis on WLS so that it automatically starts in background like it is the case on actual Ubuntu machine?



      Thanks.







      windows-10 windows-subsystem-for-linux redis






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 9 '17 at 7:34









      Jignesh GohelJignesh Gohel

      32838




      32838






















          2 Answers
          2






          active

          oldest

          votes


















          0















          1. you can wait for the next release of Windows or install the insider-build that supports background services https://blogs.msdn.microsoft.com/commandline/2017/12/04/background-task-support-in-wsl/

          2. you can install the windows redis service (no Linux subsystem needed)
            https://github.com/MicrosoftArchive/redis Personal experience was, this works fine for a single test instance, but has major headaches trying to create a reliable cluster.

          3. run a Linux instance either as VM or on a separate server.


          If this is a developer instance to test code go with 2 or 3. If it is a production deployment and you are expecting to run a cluster then 3.
          WSL is create for running small scripts, testing things but I have not found it very friendly as a replacement for Linux server. YMMV






          share|improve this answer































            0














            Here are my instructions on how I have configured redis to start as background task on Windows startup.




            1. Install WSL (this is tested with Ubuntu 18.04 version)



            2. Install redis-server inside WSL:



              sudo apt install redis-server



            3. Add sudo permission to your user to execute service command without password Open sudoers file sudo visudo and add to end:



              your_username ALL=NOPASSWD:/usr/sbin/service redis-server


              or if you want to disable sudo passwords generally add this to the end:



              your_username ALL=(ALL:ALL) NOPASSWD:ALL



            4. Create vbs file e.g. start-redis.vbs inside startup folder (Open Run and enter shell:startup)



              In vbs file insert following:



              Set oShell = CreateObject("WScript.Shell")
              oShell.Run "wsl", 0
              oShell.Run "bash -c ""sudo service redis-server start --daemonize yes"""



            That's it. You can try it by running vbs script and then run htop inside WSL terminal. You should see that redis is running.



            I have posted these instructions on GitHub.






            share|improve this answer

























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "3"
              };
              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: 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%2fsuperuser.com%2fquestions%2f1239051%2fwindows-10-linux-subsystem-redis-not-auto-starting%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















              1. you can wait for the next release of Windows or install the insider-build that supports background services https://blogs.msdn.microsoft.com/commandline/2017/12/04/background-task-support-in-wsl/

              2. you can install the windows redis service (no Linux subsystem needed)
                https://github.com/MicrosoftArchive/redis Personal experience was, this works fine for a single test instance, but has major headaches trying to create a reliable cluster.

              3. run a Linux instance either as VM or on a separate server.


              If this is a developer instance to test code go with 2 or 3. If it is a production deployment and you are expecting to run a cluster then 3.
              WSL is create for running small scripts, testing things but I have not found it very friendly as a replacement for Linux server. YMMV






              share|improve this answer




























                0















                1. you can wait for the next release of Windows or install the insider-build that supports background services https://blogs.msdn.microsoft.com/commandline/2017/12/04/background-task-support-in-wsl/

                2. you can install the windows redis service (no Linux subsystem needed)
                  https://github.com/MicrosoftArchive/redis Personal experience was, this works fine for a single test instance, but has major headaches trying to create a reliable cluster.

                3. run a Linux instance either as VM or on a separate server.


                If this is a developer instance to test code go with 2 or 3. If it is a production deployment and you are expecting to run a cluster then 3.
                WSL is create for running small scripts, testing things but I have not found it very friendly as a replacement for Linux server. YMMV






                share|improve this answer


























                  0












                  0








                  0








                  1. you can wait for the next release of Windows or install the insider-build that supports background services https://blogs.msdn.microsoft.com/commandline/2017/12/04/background-task-support-in-wsl/

                  2. you can install the windows redis service (no Linux subsystem needed)
                    https://github.com/MicrosoftArchive/redis Personal experience was, this works fine for a single test instance, but has major headaches trying to create a reliable cluster.

                  3. run a Linux instance either as VM or on a separate server.


                  If this is a developer instance to test code go with 2 or 3. If it is a production deployment and you are expecting to run a cluster then 3.
                  WSL is create for running small scripts, testing things but I have not found it very friendly as a replacement for Linux server. YMMV






                  share|improve this answer














                  1. you can wait for the next release of Windows or install the insider-build that supports background services https://blogs.msdn.microsoft.com/commandline/2017/12/04/background-task-support-in-wsl/

                  2. you can install the windows redis service (no Linux subsystem needed)
                    https://github.com/MicrosoftArchive/redis Personal experience was, this works fine for a single test instance, but has major headaches trying to create a reliable cluster.

                  3. run a Linux instance either as VM or on a separate server.


                  If this is a developer instance to test code go with 2 or 3. If it is a production deployment and you are expecting to run a cluster then 3.
                  WSL is create for running small scripts, testing things but I have not found it very friendly as a replacement for Linux server. YMMV







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 9 '18 at 11:30









                  robrob

                  465513




                  465513

























                      0














                      Here are my instructions on how I have configured redis to start as background task on Windows startup.




                      1. Install WSL (this is tested with Ubuntu 18.04 version)



                      2. Install redis-server inside WSL:



                        sudo apt install redis-server



                      3. Add sudo permission to your user to execute service command without password Open sudoers file sudo visudo and add to end:



                        your_username ALL=NOPASSWD:/usr/sbin/service redis-server


                        or if you want to disable sudo passwords generally add this to the end:



                        your_username ALL=(ALL:ALL) NOPASSWD:ALL



                      4. Create vbs file e.g. start-redis.vbs inside startup folder (Open Run and enter shell:startup)



                        In vbs file insert following:



                        Set oShell = CreateObject("WScript.Shell")
                        oShell.Run "wsl", 0
                        oShell.Run "bash -c ""sudo service redis-server start --daemonize yes"""



                      That's it. You can try it by running vbs script and then run htop inside WSL terminal. You should see that redis is running.



                      I have posted these instructions on GitHub.






                      share|improve this answer






























                        0














                        Here are my instructions on how I have configured redis to start as background task on Windows startup.




                        1. Install WSL (this is tested with Ubuntu 18.04 version)



                        2. Install redis-server inside WSL:



                          sudo apt install redis-server



                        3. Add sudo permission to your user to execute service command without password Open sudoers file sudo visudo and add to end:



                          your_username ALL=NOPASSWD:/usr/sbin/service redis-server


                          or if you want to disable sudo passwords generally add this to the end:



                          your_username ALL=(ALL:ALL) NOPASSWD:ALL



                        4. Create vbs file e.g. start-redis.vbs inside startup folder (Open Run and enter shell:startup)



                          In vbs file insert following:



                          Set oShell = CreateObject("WScript.Shell")
                          oShell.Run "wsl", 0
                          oShell.Run "bash -c ""sudo service redis-server start --daemonize yes"""



                        That's it. You can try it by running vbs script and then run htop inside WSL terminal. You should see that redis is running.



                        I have posted these instructions on GitHub.






                        share|improve this answer




























                          0












                          0








                          0







                          Here are my instructions on how I have configured redis to start as background task on Windows startup.




                          1. Install WSL (this is tested with Ubuntu 18.04 version)



                          2. Install redis-server inside WSL:



                            sudo apt install redis-server



                          3. Add sudo permission to your user to execute service command without password Open sudoers file sudo visudo and add to end:



                            your_username ALL=NOPASSWD:/usr/sbin/service redis-server


                            or if you want to disable sudo passwords generally add this to the end:



                            your_username ALL=(ALL:ALL) NOPASSWD:ALL



                          4. Create vbs file e.g. start-redis.vbs inside startup folder (Open Run and enter shell:startup)



                            In vbs file insert following:



                            Set oShell = CreateObject("WScript.Shell")
                            oShell.Run "wsl", 0
                            oShell.Run "bash -c ""sudo service redis-server start --daemonize yes"""



                          That's it. You can try it by running vbs script and then run htop inside WSL terminal. You should see that redis is running.



                          I have posted these instructions on GitHub.






                          share|improve this answer















                          Here are my instructions on how I have configured redis to start as background task on Windows startup.




                          1. Install WSL (this is tested with Ubuntu 18.04 version)



                          2. Install redis-server inside WSL:



                            sudo apt install redis-server



                          3. Add sudo permission to your user to execute service command without password Open sudoers file sudo visudo and add to end:



                            your_username ALL=NOPASSWD:/usr/sbin/service redis-server


                            or if you want to disable sudo passwords generally add this to the end:



                            your_username ALL=(ALL:ALL) NOPASSWD:ALL



                          4. Create vbs file e.g. start-redis.vbs inside startup folder (Open Run and enter shell:startup)



                            In vbs file insert following:



                            Set oShell = CreateObject("WScript.Shell")
                            oShell.Run "wsl", 0
                            oShell.Run "bash -c ""sudo service redis-server start --daemonize yes"""



                          That's it. You can try it by running vbs script and then run htop inside WSL terminal. You should see that redis is running.



                          I have posted these instructions on GitHub.







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Feb 7 at 9:37









                          Scott

                          16k113990




                          16k113990










                          answered Feb 7 at 8:07









                          Tomislav BrabecTomislav Brabec

                          11




                          11






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Super User!


                              • 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%2fsuperuser.com%2fquestions%2f1239051%2fwindows-10-linux-subsystem-redis-not-auto-starting%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?

                              第一次世界大戦

                              Touch on Surface Book