Not sure how to run terminal commands at startup
Hi!
I just installed OpenSuSE Linux 10 on my machine to run a webserver. I configured everything so it would work, but I need to start the server when Linux boots. And the only way to do that is through super-user mode on my terminal. This is what I need to do to start my server: mandrakethepenguin@(hostname):~> cd /home/mandrakethepenguin/abyssws/ mandrakethepenguin@(hostname):~/abyssws> su Password: (my root password) (hostname):/home/mandrakethepenguin/abyssws # ./abyssws If I execute the server under normal user mode, the server has a listening problem (www on port 80 and web console on port 1024) Im sure there is a script i could bind this information to, but im unsure how. Any help would be apreciated.;) |
hello mandrakethepenguin,
Look at your services (via control panel) and enable apache or httpd service to start on boot. This will launch webserver on boot of your system. Thanks, Kirtimaan |
The first thing to do is figure out what runlevel your system boots into by default. Look for a line that liks like "id:n:initdefault" in /etc/inittab (the n is a number, usually 3 or 5 that specifies the runlevel to boot to). Then go into the /etc/init.d directory and create a script to start your service (look at the other scripts for examples, but if you call "<scriptname> start" it should start the service). Then add a symlink to your script in /etc/init.d/rcn.d, again replacing n with the runlevel you boot into, e.g. /etc/init.d/rc3.d for run level 3. The file name of the link should have the form SXXyourservice (again look at the other links in the directory). The XX is a number that describes where in the sequence it starts, higher numbers later -- put your service towards the end after networking and other system functions have been brought up.
Some distros provide a rc.local script that you can just add commands to, but I'm using SuSE 9.3 anbd it does not seem to have that (only a boot.init and you need to have networking set up before your server can start). Maybe SuSE 10 does. In any case, type "man init.d" (no quoters) at a command prompt to read up on mnore details about how the initialization works. SuSE uses standard System V style init scripts, so Googling on that term should also help. It looks complicated at first but is really dead simple once you have the knack of it. |
Actually....
Actually, I don't use Apache webserver, I use Abyss Webserver (aprelium.com). Im using OpenSuSE 10, it comes with a rc.local file
|
you could make a /bin/sh and put it in /etc/init.d/rcX.d, /sbin/init.d/rcX.d or ??? or I think mandriva may use /etc/modprobe.preload. Take a look at that as well.
|
All times are GMT -5. The time now is 09:22 AM. |