Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
How do you start a script on boot? Want to run my teamspeak server on boot. Not exactly sure what to do. I have been messing around a little. Like ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2004
    Posts
    9

    Start Script on Boot?


    How do you start a script on boot? Want to run my teamspeak server on boot.
    Not exactly sure what to do. I have been messing around a little. Like went into /etc/rc.local and added touch /directory and well that did not work.
    Thanks,
    --Fico

  2. #2
    Linux Enthusiast
    Join Date
    Feb 2005
    Location
    SE, Stockholm
    Posts
    512
    Your script should be in /etc/init.d/ directory.
    Then you have to make a symlink from your run-level directory.
    I.e you're in run-level 5 (multiuser with X)
    Code:
    cp <script-file> /etc/init.d
    ln -s /etc/init.d/<scriptfile> /etc/rc.d/rc5.d/S50<scriptfile>
    ln -s /etc/init.d/<scriptfile> /etc/rc.d/rc5.d/K50<scriptfile>
    The S50 is to tell the system to start the script when it boots up,
    the K50 is to tell the system to shut down cleanly when you do a shut down.
    The number representates in which order the script should start/shut down in. This way you have the possibility to explicity start your server after like when you started networking and other servers that is required by your server.

    Change my example obove <scriptfile> with your scriptfile name.
    Ah, and remember to do "chmod +x <scriptfile>"

  3. #3
    Just Joined!
    Join Date
    Dec 2004
    Posts
    9

    Thanks

    Thank you a will try it out and all. My script depends on other files so how I put it in that folder and link to diffrent areas? Would I have to edit the script itself? If so how I edit the script?

  4. #4
    Linux Enthusiast
    Join Date
    Feb 2005
    Location
    SE, Stockholm
    Posts
    512
    If you installed the server with a RPM, it is probably already there for you in the startup directories.

    If you have installed from a source tarball then there might be a reason for you to create the script by your self.

    There are several tools to edit a script, vi, emacs, nano, pico and so on.
    Just pick a favorite editor of your choice. (mine is vi, its avalible in almost every Unx)

  5. #5
    Just Joined!
    Join Date
    Dec 2004
    Posts
    9

    Hello

    it was bz2
    All I needed to do was extract and run script to get server up. Did not install anything. The dir is on my desktop.
    What files I need to be looking for, where put them what?

  6. #6
    Just Joined!
    Join Date
    Dec 2004
    Posts
    9
    Oh so how would I make the script. what would I need?

  7. #7
    Linux Guru dylunio's Avatar
    Join Date
    Aug 2004
    Location
    Cymru
    Posts
    4,157
    All you have to do is add the command to start teamspeak in an rcfile, or write a script like this
    #!/bin/bash

    <command to start prog>
    dylunio
    Registered Linux User #371543!
    Get force-get May The Source Be With You
    /dev/null
    /dev/null2

  8. #8
    Just Joined!
    Join Date
    Dec 2004
    Posts
    9
    Thanks dylunio,
    I am quite ingronant. Do not know anything about scripts and what command to rcfile. Have not looked at that file yet so about to do so. Not sure where it located. How you search for file with bash?

  9. #9
    Linux Guru dylunio's Avatar
    Join Date
    Aug 2004
    Location
    Cymru
    Posts
    4,157
    there should be a rc3.d file or directory within /etc/init.d add the command to the file, or add a script to the directory.

    You can write the script in your favourite text editor. remember to save them <filename>.sh

    dylunio
    Registered Linux User #371543!
    Get force-get May The Source Be With You
    /dev/null
    /dev/null2

  10. #10
    Just Joined!
    Join Date
    Dec 2004
    Posts
    9
    Ok thank you ill mess around. I don't think the start and stop script for Teamspeak was ment to be an SH.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •