ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Xen Orchestra on Ubuntu 15.10 - Complete installation instructions

    IT Discussion
    how to xen orchestra ubuntu 15.10 debian xen open source ubuntu linux xenserver
    24
    609
    281.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      Danp @DustinB3403
      last edited by

      @DustinB3403 said:

      Already tried it.

      Doesn't appear to work.

      Post your cron entry here.

      Also may want to review these options:
      https://www.npmjs.com/package/node-crontab
      https://www.npmjs.com/package/forever

      1 Reply Last reply Reply Quote 0
      • D
        DustinB3403
        last edited by

        Ok So here is what I've done to get XO to run at boot.

        I made a script in /etc/ named "xo-start.sh" marked it as executable.

        cd  /etc
        nano xo-start.sh
        
        
        #!/bin/sh
        cd /opt/xo-server
        sudo npm start
        
         ctrl+o
         ctrl+x
        
        sudo nano /etc/crontab
        
        #
         shit ton of comments
        #
        @reboot cd /etc && ./xo-start.sh
        
        ctrl+o
        ctrl+x
        
        sudo reboot now
        
        1 Reply Last reply Reply Quote 1
        • D
          DustinB3403
          last edited by

          That should be all you need to get XO to run at startup of your XO VM.

          I've reboot several times to confirm.

          1 Reply Last reply Reply Quote 0
          • D
            DustinB3403
            last edited by

            So the last question is, how do we get XO to stop so we can manually run our updates.

            1 Reply Last reply Reply Quote 0
            • S
              scottalanmiller
              last edited by

              If you are firing up from cron, which is pretty normal for a low key service such as this, then you would kill it using the kill command.

              1 Reply Last reply Reply Quote 0
              • S
                scottalanmiller
                last edited by

                Problem is, with processes that run via npm or similar, their name never appears and there is no universal standard for stopping them. Doing so manually is super simple, but in a script is dangerous and ill advised. If you are very brave you can use ps and look for npm, but if the server is running anything else, you might kill the wrong thing.

                T 1 Reply Last reply Reply Quote 0
                • S
                  scottalanmiller
                  last edited by

                  And to complicate things, there is no stop script for xo-server 🙂

                  1 Reply Last reply Reply Quote 0
                  • T
                    travisdh1 @scottalanmiller
                    last edited by

                    @scottalanmiller said:

                    Problem is, with processes that run via npm or similar, their name never appears and there is no universal standard for stopping them. Doing so manually is super simple, but in a script is dangerous and ill advised. If you are very brave you can use ps and look for npm, but if the server is running anything else, you might kill the wrong thing.

                    Doesn't 'cd /install/location' 'npm stop' work? Why make it difficult?

                    S D 2 Replies Last reply Reply Quote 0
                    • S
                      scottalanmiller @travisdh1
                      last edited by

                      @travisdh1 said:

                      @scottalanmiller said:

                      Problem is, with processes that run via npm or similar, their name never appears and there is no universal standard for stopping them. Doing so manually is super simple, but in a script is dangerous and ill advised. If you are very brave you can use ps and look for npm, but if the server is running anything else, you might kill the wrong thing.

                      Doesn't 'cd /install/location' 'npm stop' work? Why make it difficult?

                      No, there is no stop script.

                      T 1 Reply Last reply Reply Quote 1
                      • D
                        DustinB3403 @travisdh1
                        last edited by

                        @travisdh1 said:

                        @scottalanmiller said:

                        Problem is, with processes that run via npm or similar, their name never appears and there is no universal standard for stopping them. Doing so manually is super simple, but in a script is dangerous and ill advised. If you are very brave you can use ps and look for npm, but if the server is running anything else, you might kill the wrong thing.

                        Doesn't 'cd /install/location' 'npm stop' work? Why make it difficult?

                        from my testing npm stop does not work.

                        It's not even included as a script.

                        We would have to effectively Ctrl + C out of the crontab job.

                        S 1 Reply Last reply Reply Quote 0
                        • S
                          scottalanmiller
                          last edited by

                          This will stop it, if you run it as expected and nothing else is running like it:

                          kill $(ps aux | grep "npm start" | grep -v grep | cut -d' ' -f8)
                          
                          D 1 Reply Last reply Reply Quote 0
                          • T
                            travisdh1 @scottalanmiller
                            last edited by

                            @scottalanmiller said:

                            @travisdh1 said:

                            @scottalanmiller said:

                            Problem is, with processes that run via npm or similar, their name never appears and there is no universal standard for stopping them. Doing so manually is super simple, but in a script is dangerous and ill advised. If you are very brave you can use ps and look for npm, but if the server is running anything else, you might kill the wrong thing.

                            Doesn't 'cd /install/location' 'npm stop' work? Why make it difficult?

                            No, there is no stop script.

                            Well, bother.

                            1 Reply Last reply Reply Quote 0
                            • S
                              scottalanmiller @DustinB3403
                              last edited by

                              @DustinB3403 said:

                              We would have to effectively Ctrl + C out of the crontab job.

                              Ctrl-C doesn't do what you think that it does.

                              What we need to do is to send a SIGHUP to the process, which is what I did. It's identifying the process that is the issue.

                              1 Reply Last reply Reply Quote 1
                              • D
                                DustinB3403 @scottalanmiller
                                last edited by

                                @scottalanmiller said:

                                This will stop it, if you run it as expected and nothing else is running like it:

                                kill $(ps aux | grep "npm start" | grep -v grep | cut -d' ' -f8)
                                

                                Will test in a moment.

                                Have to complete another job real fast.

                                D 1 Reply Last reply Reply Quote 0
                                • S
                                  scottalanmiller
                                  last edited by

                                  Where the problem lies is that npm does not appear to store the PID anywhere on its own. Could we had that manually to the cron job? Of course, but that would not be universal by any stretch and we'd be left with a script that only worked with that specific means of starting.

                                  T 1 Reply Last reply Reply Quote 1
                                  • D
                                    DustinB3403 @DustinB3403
                                    last edited by

                                    kill $(ps aux | grep "npm start" | grep -v grep | cut -d' ' -f8)
                                    

                                    Doesn't work.

                                    1 Reply Last reply Reply Quote 0
                                    • S
                                      scottalanmiller
                                      last edited by

                                      What is your output of...

                                      ps aux | grep "npm start" | grep -v grep | cut -d' ' -f8
                                      

                                      and...

                                      ps aux | grep "npm"
                                      
                                      1 Reply Last reply Reply Quote 0
                                      • T
                                        travisdh1 @scottalanmiller
                                        last edited by

                                        @scottalanmiller said:

                                        Where the problem lies is that npm does not appear to store the PID anywhere on its own. Could we had that manually to the cron job? Of course, but that would not be universal by any stretch and we'd be left with a script that only worked with that specific means of starting.

                                        This sounds like one of those "It would be really easy to do with an init/systemd script", that nobody has the time to spend working on currently. (If I did, I'd write one.)

                                        1 Reply Last reply Reply Quote 0
                                        • D
                                          Danp
                                          last edited by Danp

                                          This appears to work:

                                           kill $(ps aux | grep "node bin/xo-server" | grep -v grep | cut -d' ' -f8)
                                          
                                          S D 2 Replies Last reply Reply Quote 0
                                          • S
                                            scottalanmiller
                                            last edited by

                                            That is exactly what is needed. If this was the old init style, I know it pretty well. Have made a lot of those. Don't know how it works on Ubuntu 15.10.

                                            Although we'd need to package this all up, but that's not that hard.

                                            We are getting closer and closer to making an RPM here.

                                            1 Reply Last reply Reply Quote 1
                                            • 1
                                            • 2
                                            • 9
                                            • 10
                                            • 11
                                            • 12
                                            • 13
                                            • 30
                                            • 31
                                            • 11 / 31
                                            • First post
                                              Last post