LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   How can I set scripts to run at startup? openSuSE 10.1 x86 (https://www.linuxquestions.org/questions/suse-opensuse-60/how-can-i-set-scripts-to-run-at-startup-opensuse-10-1-x86-485426/)

iceportal 09-20-2006 05:08 PM

How can I set scripts to run at startup? openSuSE 10.1 x86
 
Current OS: openSuSE 10.1 x86

I'm trying to write a few scripts that will run each time I restart or power up the computer. (Each time the OS loads.)

For example, I've written a script that automatically sends my IP to my webserver (offsite).

I need this to run each time I turn on my system.

Which files should I modify?

(( If you can, plz email me the answer at chris[AT]gridrunners.com. Thanks! ))

kilgoretrout 09-21-2006 10:27 AM

If you are running, kde, you can just put the scripts in ~/.kde/Autostart. That's probably the easiest.

iceportal 09-21-2006 02:47 PM

I guess that would work, but I wanted something that runs regardless of whether I run a GUI or not.

I set this up on Ubuntu once, but I forget the location of the script. Basically, it ran my script before it ever started X.

This way, even if X doesn't work for some reason, my script still gets run (the script sends my IP to a webserver so I can check the webserver from work to know where to point my SSH client when I wanna use my home computer from work).

Leisy 09-21-2006 07:17 PM

I guess, that editing rc.local is what you need.

iceportal 09-21-2006 11:36 PM

That's what I thought too, but the problem is...

I can't find it!

Anyone know in which directory the rc.local resides for OpenSuSE 10.1?

:newbie:

ccin1492 09-21-2006 11:40 PM

If you want to find the file, you can try (as root of course):

% find / -name "rc.local"

This will search your entire file system. Might take a while though ;-)

iceportal 09-22-2006 12:03 AM

I believe I've tried that (one of the first things I tried before coming here - I do my homework). :)

I will check again, however. See if I didn't just miss it due to sleep deprived visual hallucinations or something.

kilgoretrout 09-22-2006 12:11 AM

rc.local is normally placed in /etc/rc.d. However, in debian based systems there is no rc.local.

iceportal 09-22-2006 12:13 AM

What do debian based systems use?

iceportal 09-22-2006 12:13 AM

Ubuntu uses /etc/rc.local...

kilgoretrout 09-22-2006 08:07 AM

These artricles describe the debian way of handling startup scripts:

http://www.justlinux.com/nhf/Distrib..._Commands.html

http://www.debian.org/doc/FAQ/ch-customizing.en.html

iceportal 09-23-2006 12:23 AM

Ahh but that's the problem, see, because I don't need the Debian way, I need the openSuSE way!

kilgoretrout 09-25-2006 09:22 AM

Sorry for the confusion. I don't have suse installed anywhere, but have you searched your /etc directory for rc.local? All your init scripts are located somewhere in /etc on all *nix systems I'm familiar with and rc.local is designated as the last init script to run on any system that has an rc.local. If suse doesn't have an rc.local, which may very well be the case, you can edit some existing init script to run your scripts at boot but you would want to make sure you do it late in the boot process. For that you would have to be pretty familiar with suse's init process. Alternatively, here's an article on creating your own init script in suse:

http://en.opensuse.org/SDB:How_to_Cr...wn_Init_Script

This init script could be configured to launch whatever scripts you want at boot.

iceportal 09-25-2006 10:29 AM

Thanks! I'll check it out.


All times are GMT -5. The time now is 07:04 PM.