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

 
Page 1 of 2 1 2
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-Dec-2004, 18:04
mis22y
Guest
 
Posts: n/a
Default

I have a script that I need to have run after starting networking. I'm more used to RH and moving to SuSE and there is no rc.local file. I know there is a boot.local in /etc/rc.d, but that starts the services before any networking. any help would be appreciated.

M
  #2 (permalink)  
Old 09-Dec-2004, 22:41
dago
Guest
 
Posts: n/a
Default

Yes, this is one thing I really hate on Suse.
It really got me crazy wondering why they took it off.

The conclusion I got is: Suse is X oriented, their users don't need command line, they don't want it.
That's why they created tools like Yast. Very simple things are solved running Yast, they are unable to open a simple file and edit it, check the forum.

The solution for your problem is very simple, do it yourself:
* create your own /etc/init.d/rc.local as root (you know how, right?)
* write whatever you need on it, but place a preamble at the very beginning:
#!/bin/sh
### BEGIN INIT INFO
# Provides: rc.local
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: whatever
### END INIT INFO

* then chmod 755 rc.local
* and finally chkconfig --add rc.local

That's it
  #3 (permalink)  
Old 10-Dec-2004, 09:42
69_rs_ss
Guest
 
Posts: n/a
Default

Quote:
The conclusion I got is: Suse is X oriented, their users don't need command line, they don't want it.
That's why they created tools like Yast. Very simple things are solved running Yast, they are unable to open a simple file and edit it, check the forum.
I don't believe this to be the case. I can change any file that I need just as I do in my Gentoo box. The only difference is that the config files in Suse have a warning.
  #4 (permalink)  
Old 10-Dec-2004, 20:53
dago
Guest
 
Posts: n/a
Default

Of course you can change the files that you need, it would be ridiculous if not.
What I mean is about the Suse philosophy behind configuration. Everything should be X oriented through whatever tool, they almost do not document the way via command line, simply because they think users don't want to handle command line.

This is Windows philosophy and Suse follows that. I don't think this is wrong, IMHO I think this is necessary for the good sake of Linux -- perhaps the single change against Bill Gates.

Unfortunately, sometimes is pretty easy to do things via command line and get very annoying when they changed that in order do provide an X solution.

Don't mind, I'm just a 28 years old Linux user since Red Hat 5.
I wander I may be too old now...
  #5 (permalink)  
Old 10-Dec-2004, 21:17
brucehohl
Guest
 
Posts: n/a
Default

What you need is /etc/init.d/boot.local. This is the SuSE equivalent of rc.local. See the comments in that file.
  #6 (permalink)  
Old 11-Dec-2004, 16:42
dago
Guest
 
Posts: n/a
Default

Wrong, boot.local is not equivalent to rc.local because this file is the last thing being executed on the boot process, so there is no equivalence in Suse.
Read the first post to get more details.
  #7 (permalink)  
Old 11-Dec-2004, 17:08
storm
Guest
 
Posts: n/a
Default

As you can read here boot.local is execute before network (runlevel 3,5)
Quote:
At* boot* time,* the* boot* level* * master* * script
* * * /etc/init.d/boot* is called to initialise the system (e.g.
* * * file system check, ...).* It also executes* some* hardware
* * * init* scripts* linked* into* /etc/init.d/boot.d/.* Then it
* * * calls /etc/init.d/boot.local,* which* executes* the* local
* * * commands.

* * * After* system* startup, /sbin/init will normally switch on
* * * the default run level given in /etc/inittab.* It calls the
* * * run* level* master* script /etc/init.d/rc to start or stop
* * * services provided by the other scripts under /etc/init.d/.
Another solution is create your own links in one of the desired runlevels following the lines in /etc/init.d/README
  #8 (permalink)  
Old 11-Dec-2004, 18:17
dago
Guest
 
Posts: n/a
Default

Yes, exactly what I'm saying
* boot.local is executed before network
* rc.local is executed as the last thing on the boot sequence

The question is: what is equivalent to rc.local on Suse? I guess nothing.
  #9 (permalink)  
Old 11-Dec-2004, 20:29
brucehohl
Guest
 
Posts: n/a
Default

Quote:
Wrong, boot.local is not equivalent to rc.local because this file is the last thing being executed on the boot process, so there is no equivalence in Suse.
I stand corrected. I offer the following from the SuSE Admin Guide:

13.4.1.
To create a custom init script for a given program or service, use the file /etc/init.d/skeleton as a template. Save a copy of this file under the new name and edit the relevant program and file names, paths, and other details as needed. You may also need to enhance the script with your own parts, so the correct actions are triggered by the init procedure.

The INIT INFO block at the top is a required part of the script and should be edited:
Example13.1.A Minimal INIT INFO Block
### BEGIN INIT INFO
# Provides: FOO
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Start FOO to allow XY and provide YZ
### END INIT INFO

In the first line of the INFO block, after Provides:, specify the name of the program or service controlled by this init script. In the Required-Start: and Required-Stop: lines, specify all services that need to be started or stopped, respectively, before the service itself is started or stopped. This information is used later to generate the numbering of script names, as found in the runlevel directories. Under Default-Start: and Default-Stop:, specify the runlevels in which the service should automatically be started or stopped. Finally, under Description:, provide a short description of the service in question.

To create the links from /etc/init.d/ to the corresponding runlevel directories (/etc/init.d/rc?.d/), enter the command insserv <new-script-name>. The insserv program evaluates the INIT INFO header to create the necessary links for start and stop scripts in the runlevel directories (/etc/init.d/rc?.d/). The program also takes care of the correct start and stop order for each runlevel by including the necessary numbers in the names of these links. If you prefer a graphical tool to create such links, use the runlevel editor provided by YaST, as described in Section 13.5. ?The YaST Runlevel Editor?.
  #10 (permalink)  
Old 15-Apr-2007, 15:41
robman
Guest
 
Posts: n/a
Default

Quote:
Yes, this is one thing I really hate on Suse.
It really got me crazy wondering why they took it off.

The conclusion I got is: Suse is X oriented, their users don't need command line, they don't want it.
That's why they created tools like Yast. Very simple things are solved running Yast, they are unable to open a simple file and edit it, check the forum.

The solution for your problem is very simple, do it yourself:
* create your own /etc/init.d/rc.local as root (you know how, right?)
* write whatever you need on it, but place a preamble at the very beginning:
#!/bin/sh
### BEGIN INIT INFO
# Provides: rc.local
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: whatever
### END INIT INFO

* then chmod 755 rc.local
* and finally chkconfig --add rc.local

That's it
[/b]
Kudos and thanks! This was helpful.

I was trying to get dynubasic to run without being put into .xinitrc. This works but it doesn't make sense to run X just to run a dynamic IP client (dynu.com)!
I'm running 10.2 and I'd like to note that in the man page of insserv it says .local file names are not acceptable now (among other names). So I renamed my rc.local to rclocal. Otherwise chkconfig gives you an error. I did use the skeleton (/etc/init.d/skeleton) file as my starting point.
 
Page 1 of 2 1 2

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