LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 09-20-2006, 05:08 PM   #1
iceportal
Member
 
Registered: Sep 2006
Posts: 36

Rep: Reputation: 15
Question 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! ))
 
Old 09-21-2006, 10:27 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,988

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
If you are running, kde, you can just put the scripts in ~/.kde/Autostart. That's probably the easiest.
 
Old 09-21-2006, 02:47 PM   #3
iceportal
Member
 
Registered: Sep 2006
Posts: 36

Original Poster
Rep: Reputation: 15
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).
 
Old 09-21-2006, 07:17 PM   #4
Leisy
Member
 
Registered: Sep 2006
Location: Brno, Czech Republic
Distribution: Fedora
Posts: 56

Rep: Reputation: 15
I guess, that editing rc.local is what you need.
 
Old 09-21-2006, 11:36 PM   #5
iceportal
Member
 
Registered: Sep 2006
Posts: 36

Original Poster
Rep: Reputation: 15
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?

 
Old 09-21-2006, 11:40 PM   #6
ccin1492
Member
 
Registered: Feb 2004
Location: SoCal
Distribution: openSUSE 10.3
Posts: 139

Rep: Reputation: 15
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 ;-)
 
Old 09-22-2006, 12:03 AM   #7
iceportal
Member
 
Registered: Sep 2006
Posts: 36

Original Poster
Rep: Reputation: 15
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.
 
Old 09-22-2006, 12:11 AM   #8
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,988

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
rc.local is normally placed in /etc/rc.d. However, in debian based systems there is no rc.local.
 
Old 09-22-2006, 12:13 AM   #9
iceportal
Member
 
Registered: Sep 2006
Posts: 36

Original Poster
Rep: Reputation: 15
What do debian based systems use?
 
Old 09-22-2006, 12:13 AM   #10
iceportal
Member
 
Registered: Sep 2006
Posts: 36

Original Poster
Rep: Reputation: 15
Ubuntu uses /etc/rc.local...
 
Old 09-22-2006, 08:07 AM   #11
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,988

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
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
 
Old 09-23-2006, 12:23 AM   #12
iceportal
Member
 
Registered: Sep 2006
Posts: 36

Original Poster
Rep: Reputation: 15
Ahh but that's the problem, see, because I don't need the Debian way, I need the openSuSE way!
 
Old 09-25-2006, 09:22 AM   #13
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,988

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
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.

Last edited by kilgoretrout; 09-25-2006 at 09:30 AM.
 
Old 09-25-2006, 10:29 AM   #14
iceportal
Member
 
Registered: Sep 2006
Posts: 36

Original Poster
Rep: Reputation: 15
Thanks! I'll check it out.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically run scripts on startup? Phaethar Fedora 10 09-24-2004 02:35 AM
how to make/run startup scripts/commands ViN86 Slackware 3 04-24-2004 10:02 AM
How do I run startup scripts?O gaborn415 Linux - Newbie 1 04-15-2004 08:54 PM
how do I set run level for startup? jdruin Linux - Newbie 3 09-23-2003 10:06 PM
The wide world of scripts run at startup, big question here SrConchiwa Linux - General 5 07-18-2003 08:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 11:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration