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.
I'm trying to run a script upon startup. I've read that I should put the file into /etc/init.d. However, I cannot work in it. I can't make or paste files into that directory. Any help on how to move the file?
you need to be "root". In general it is a BAD idea to allow regular users access to the system areas. Use the commands "su" or "sudo" depending on how your distro is set up.
How do you be root exactly? I've used sudo -i and sudo bash. Do I have to use terminal to copy them? I don't see how being root in terminal helps me physically copy the files into /etc
If you don't know how to log on as "root" or to run the filemanager or editor as root, then you have absolutely no business putting a script into init.d at all. You need to learn your distro.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
i would agree with beoowulf999, if you don't even know HOW to log into your system as root, or temporarily become root, then it would be dangerous for you to be messing around with init scripts, as root you can torch your system and nothing will stop you. trust me i've done it.. when i was learning how to use Linux i lost count of how many times i hosed my system to the point of having to reformat it.
That being said, you should simply have to put a line to invoke your script in /etc/rc.local, but you'll have to use root powers to edit the file.
Okay before I couldn't open anything in /etc but now I can. I double click my script BUT it closes before it actually starts. (I have a sleep 10 in the beginning)
Usually, I would open the script using ./script1 in terminal. Am I supposed to change the type of way it opens up or something to make it work upon startup?
1. you need to answer my qn 2
2. if you don't know the answer to 3 & 4 its going to be impossible to help you.
Note that the answer to 2 will help, but you must ALSO tell us what the script is supposed(!) to do and we can make a guess based on that.
I don't see how being root in terminal helps me physically copy the files into /etc
'/' depicts the Root account directory. Root means that, that particular account directory has got some special set of permissions and to access and modify the files of that account directory you need to have those special permissions (which you can get by specifying that directory's password).
'/etc' means that 'etc' directory is in '/'.
and secondly, you can log in, in the root account directory through GUI too, logging in through terminal is not compulsory.
Last edited by Aquarius_Girl; 07-06-2011 at 01:00 AM.
Reason: frieza corrected the dumb mistake
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.