Go Back   openSUSE Forums > Archives > SF Archives > ARCHIVES - Programming & Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read


ARCHIVES - Programming & Scripting A place to discuss website design, programming, shell scripts, etc

 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 16-May-2008, 17:41
xandir
Guest
 
Posts: n/a
Default

Hello!
I coded a bash script that needs root rights to be executed and i want it to be started everytime i boot.
Best would be if it displays some messages in the console mode (i always boot with boot-mode=verbose).
Oh and this script requires internet, so boot.local doesn't work (it isnt made for that at all i guess).

Now I think that there must be a way to add that script as service and get it executed in some specified runlevel (directly after internet connection is aviable?). Is this possible and if how to do it?

Thanks

EDIT: I am running openSUSE 10.3
  #2 (permalink)  
Old 16-May-2008, 18:12
ken_yap
Guest
 
Posts: n/a
Default

Make an init script using /etc/init.d/skeleton as an example.
  #3 (permalink)  
Old 17-May-2008, 03:18
xandir
Guest
 
Posts: n/a
Default

Quote:
Make an init script using /etc/init.d/skeleton as an example.
[/b]
Thanks for your reply. What must i do after i made such a script to get it started on boot?
  #4 (permalink)  
Old 17-May-2008, 05:34
Dean
Guest
 
Posts: n/a
Default

Quote:
Thanks for your reply. What must i do after i made such a script to get it started on boot?[/b]
Just put it in /etc/init.d and make sure it is executable.

It gets a bit more complicated, if you need to call them when runlevel changes, then you need to link it with a symbolic link in each of the required runlevel directories(/etc/init.d/rN.d where N=0 to 6).
  #5 (permalink)  
Old 17-May-2008, 07:04
ken_yap
Guest
 
Posts: n/a
Default

Use chkconfig to activate the "service", or do it from YaST. You need the information in the header for the link to be made. Do not try to make the link manually, SuSEconfig (which is called by YaST) will do that.
  #6 (permalink)  
Old 17-May-2008, 10:28
xandir
Guest
 
Posts: n/a
Default

thank you very much, i just did it like you said and now its working
 

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2