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!
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.
So i want to run some scripts automatically after reboot. I use Ubuntu 6.06 RC.
I have tried to place it in the /etc/init.d directory but the script cannot run because it needs additional files (example: 'Unable to open dat/userlist.db! Aborting connection')
So how can i make it happen?
Depending on your system, it goes in init.d--AND must be linked somewhere. In my system, it's one of the rcX.d directories.
<<edit--just noticed that you have Ubuntu also--look in /etc for a string of directories rc1.d, rc2.d, etc.>>
As for this:
'Unable to open dat/userlist.db! Aborting connection'
We can't help you if we don't know what the file is that it is trying to access.
Hint: Get the script working before you try putting it in your startup routine.
Ok--where is the file that it is trying to open? Could it be that it wants that file to be in the same directory? (You may have to go into the script to see how the file is called.)
To set up the init scripts:
init goes to one of the rcx.d directories depending on what runlevel is selected--eg runlevel 5 for the full GUI. In the rcx.d directory, there are links to the actual scripts in init.d The links have a special format: K means kill, S means start--then the numbers are used to control the order in which things are started.
Example: you will be booting into runlevel 5 and you want to start the script "sally":
put the script in init.d and make sure it is executable
in rc5.d, run "ln -s ../init.d/sally S##sally, where ## is a number that will put it in the right sequence. The default would be to put it after all the other "S"s in the folder.
"man init" for more details......and peruse the various links and scripts to get a feel for what is happening.