LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Not sure how to run terminal commands at startup (https://www.linuxquestions.org/questions/linux-newbie-8/not-sure-how-to-run-terminal-commands-at-startup-398841/)

mandrakethepenguin 01-02-2006 10:00 PM

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.;)

kirtimaan_bkn 01-02-2006 10:54 PM

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

btmiller 01-02-2006 10:59 PM

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.

mandrakethepenguin 01-04-2006 07:47 PM

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

bosewicht 01-04-2006 08:04 PM

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.