need help running a shell program on startup as root in a terminal
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
need help running a shell program on startup as root in a terminal
Hi,
I am running Linux Mint 9
I play xbox live and run it through my laptops wireless network connection so i dont have to pay 100 dollars for the usb wireless adapter for the xbox. In windows 7 this is easy to configure so that when i turn my laptop on and then xbox it automatically connects. I wrote a program that enables ip forwarding it is written as follows
but when i run it as root nothing happens and my xbox wont connect to live. But when i manually type in these commands after su to root it works
also my startup file is rc.local as ive read an in it ive written the path to my program so it will be run how can i tell it is being run and how do i tell it to run as root?
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/home/dylan/xboxlive.sh
also my startup file is rc.local as ive read an in it ive written the path to my program so it will be run how can i tell it is being run and how do i tell it to run as root?
It will run as root. If you are really suspecting that rc.local is not being run, try echoing something from there, like echo hello > /tmp/hello .
Does your script work if you run it from a terminal, as root, after the computer is fully booted? If so, then may be your desktop environment (which, I guess, starts up after rc.local) is messing up your card settings.
It will run as root. If you are really suspecting that rc.local is not being run, try echoing something from there, like echo hello > /tmp/hello .
Does your script work if you run it from a terminal, as root, after the computer is fully booted? If so, then may be your desktop environment (which, I guess, starts up after rc.local) is messing up your card settings.
well for some reason my script doesnt work when run by itself (right click>open as admin) doesnt seem to work at all
I cant seem to figure out where i went wrong especially considering when i enter these commands in myself it always works
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.