[SOLVED] How do I make a program run on startup (and as a root)
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How do I make a program run on startup (and as a root)
I've been working on setting up a Teamspeak server for a couple days now, with no problems. My problem is that if the computer shuts down (power outage) I have to keep re-running the program manually and was wanting a script or program that would run automatically on start-up that would run a specific program as a root. (The program I'm trying to run is called "ts3server_minimal_runscript.sh")
Thanks
Edit: (I'm using Linux Mint 18.1 Cinnamon edition)
Last edited by PancakePutin; 06-27-2017 at 10:12 PM.
You will need to add to the init system of your distribution. Have you tried looking at the website for Teamspeak? They probably would have this as an option in the doco.
Looks like you are on a systemd based system. From what I can see a service file should have come with the installation.
So depending on if there is or not:
Frankbell, other people had suggested that also, but i can't seem to find the rc.local folder anywhere (even in the etc folder).
rc.local is just a file, not a directory. On Mint, it is usually an executable file in /etc. Ok, if you can't find it there, try looking in /etc/init.d
You can add a few lines of code to call your TeamSpeak script at the end of rc.local.
aragron2101, I found rc.local in the init.d folder. (I know how stupid this sounds) What lines of code could I add to make it work? (the location of the file is "/home/hp/usr/bin/teammspeak3-server_linux_amd64/ts3server_minimal_runscript.sh")
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.