Announcement

Collapse
No announcement yet.

Restart program after restart...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Restart program after restart...

    So i was given:

    Code:
    # Startup ventrilo servers.
    
    VENPATH=/home/ventrilo
    VENBIN=$VENPATH/ventrilo_srv
    
    su ventrilo -c "$VENBIN -f$VENPATH/ventrilo_srv -d"
    
    renice -5 `cat $VENPATH/ventrilo_srv.pid`
    So if i had a program in "/home/gameserver/linux_svr"

    And to start it you have to do "nohup ./server_svr &"


    How would that fit in?

    Thanks,

  • #2
    you put it in the .bashrc in your home folder. You then have to log out and log in again for it to take effect.
    Desktop: Intel i5-4690K | 16GB DDR3 | Gigabyte Z97N-WIFI | EVGA GTX 660 3GB | Windows 10
    Server 0: Gen8 HP Microserver | Proxmox Hypervisor Server 1: Gen8 HP Microserver | FreeNAS

    Comment


    • #3
      I know were to put it, It's configuring to put my file into that code.

      Comment


      • #4
        Its different on different linux OS's mate.

        I presume you're still using centOS so, as root add:

        Code:
        nohup /home/gameserver/linux_svr &
        to your /etc/rc.d/rc.local file.

        You will need the full location from the root / directory.

        linux_svr must be executable though.
        Desktop: Intel i5-4690K | 16GB DDR3 | Gigabyte Z97N-WIFI | EVGA GTX 660 3GB | Windows 10
        Server 0: Gen8 HP Microserver | Proxmox Hypervisor Server 1: Gen8 HP Microserver | FreeNAS

        Comment


        • #5
          So just the run command?? one per line?

          Comment


          • #6
            Originally posted by Jackster View Post
            So just the run command?? one per line?
            I guess so.

            If you want me to check post the contents of your /etc/rc.d/rc.local file and I'll have a look.
            Desktop: Intel i5-4690K | 16GB DDR3 | Gigabyte Z97N-WIFI | EVGA GTX 660 3GB | Windows 10
            Server 0: Gen8 HP Microserver | Proxmox Hypervisor Server 1: Gen8 HP Microserver | FreeNAS

            Comment


            • #7
              #!/bin/sh
              #
              # This script will be executed *after* all the other init scripts.
              # You can put your own initialization stuff in here if you don't
              # want to do the full Sys V style init stuff.

              touch /var/lock/subsys/local
              ..........

              Comment


              • #8
                Originally posted by Jackster View Post
                ..........
                ooo, nice and simple then.

                Code:
                #!/bin/sh
                #
                # This script will be executed *after* all the other init scripts.
                # You can put your own initialization stuff in here if you don't
                # want to do the full Sys V style init stuff.
                
                touch /var/lock/subsys/local ;
                nohup /home/gameserver/linux_svr &
                You will need to add the semi colon after a space to the end of the line above. (put in red)
                Desktop: Intel i5-4690K | 16GB DDR3 | Gigabyte Z97N-WIFI | EVGA GTX 660 3GB | Windows 10
                Server 0: Gen8 HP Microserver | Proxmox Hypervisor Server 1: Gen8 HP Microserver | FreeNAS

                Comment


                • #9
                  Originally posted by Lorem-Ipsum View Post
                  ooo, nice and simple then.

                  I didn't have enough words in my post. Sorry if you took it bad in some way?


                  You will need to add the semi colon after a space to the end of the line above. (put in red)
                  Ah thanks i will give it a go.

                  Comment


                  • #10
                    Originally posted by Jackster View Post
                    I didn't have enough words in my post. Sorry if you took it bad in some way?
                    LOL. I didn't notice the .'s until you apologised for it XD

                    I was more interested in the code XD.
                    Desktop: Intel i5-4690K | 16GB DDR3 | Gigabyte Z97N-WIFI | EVGA GTX 660 3GB | Windows 10
                    Server 0: Gen8 HP Microserver | Proxmox Hypervisor Server 1: Gen8 HP Microserver | FreeNAS

                    Comment


                    • #11
                      .................. < I put them in as i only used 2 letters for the ""








                      Just pointing out


                      Sadly some people are using the TeamSpeak server so i can't test it out.

                      Thanks dude, Ill +1 if i can.

                      Comment

                      Working...
                      X