LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   init script type (https://www.linuxquestions.org/questions/slackware-14/init-script-type-4175431336/)

charging-ibis 10-09-2012 08:44 AM

init script type
 
I have a question about the init script type for slackware 13.37, What type is the init scripts in slackware 13.37?

Part of it looks like BSD and another part looks like System V.

I also noticed that the parameters to run a init script is:

Code:

{start | stop | restart | graceful | graceful-stop}
But there is no 'status' parameter and what dose 'graceful' and 'graceful-stop' mean as perameters?

tronayne 10-09-2012 09:02 AM

Are you talking about the scripts in /etc/init.d?

If so, there're
Code:

fubar-trona-/etc/rc.d/init.d: file *
README.functions: ASCII English text
collectl:        POSIX shell script, ASCII text executable
collectl-debian:  POSIX shell script, ASCII text executable
collectl-generic: POSIX shell script, ASCII text executable
collectl-suse:    POSIX shell script, ASCII text executable
functions:        ASCII English text

and the README.functions states:
Code:

fubar-trona-/etc/rc.d/init.d: cat README.functions

If you're reading this in /etc/init.d/, Slackware's real init directory is
/etc/rc.d/.  Maybe you already knew this, but it never hurts to say.  :-)

This script was taken from Fedora (and is presumably licensed under the GPL).
While I don't see Slackware init scripts making much use of it (but use it
if you wish), some third party init scripts (such as for commercial software
designed to run on Red Hat based systems) expect this script and use it in
their own init scripts, so it's a good idea to make it available here.

These functions are provided solely for commercial (or other) software that
expects to find "Red Hat-isms".  I wouldn't use them to write new init
scripts (personally), but if you've had experience with them in the past
and like them, by all means feel free.

It's planned to continue support for them.

Hope this helps some.

GazL 10-09-2012 09:14 AM

Slackware's approach to init-scripts is pretty much a hybrid between the bsd and sysv styles (IMO taking the best parts of both)

Didier Spaier 10-09-2012 09:44 AM

Quote:

Originally Posted by charging-ibis (Post 4801281)
I have a question about the init script type for slackware 13.37, What type is the init scripts in slackware 13.37?

Part of it looks like BSD and another part looks like System V.

I also noticed that the parameters to run a init script is:

Code:

{start | stop | restart | graceful | graceful-stop}
But there is no 'status' parameter and what dose 'graceful' and 'graceful-stop' mean as parameters?

I suppose you are speaking about the files in /etc/rc.d

To answer your first question, which seems me to be rather rhetorical, they are of Slackware type :cool:

If you look at some you will see that the main ones (those which end in one digit or letter after the dot) are the "real" init scripts, whose purpose is to change the state of the system (its run level) as a whole. Others are scripts used to start or stop a particular service or set of services and can be run in the course of a change in the run level or independently.

As fot the parameters, they are not the same in every script. To understand why, just look at some of them at random.

charging-ibis 10-09-2012 03:22 PM

Quote:

Originally Posted by tronayne (Post 4801290)
Are you talking about the scripts in /etc/init.d?

If so, there're
Code:

fubar-trona-/etc/rc.d/init.d: file *
README.functions: ASCII English text
collectl:        POSIX shell script, ASCII text executable
collectl-debian:  POSIX shell script, ASCII text executable
collectl-generic: POSIX shell script, ASCII text executable
collectl-suse:    POSIX shell script, ASCII text executable
functions:        ASCII English text

and the README.functions states:
Code:

fubar-trona-/etc/rc.d/init.d: cat README.functions

If you're reading this in /etc/init.d/, Slackware's real init directory is
/etc/rc.d/.  Maybe you already knew this, but it never hurts to say.  :-)

This script was taken from Fedora (and is presumably licensed under the GPL).
While I don't see Slackware init scripts making much use of it (but use it
if you wish), some third party init scripts (such as for commercial software
designed to run on Red Hat based systems) expect this script and use it in
their own init scripts, so it's a good idea to make it available here.

These functions are provided solely for commercial (or other) software that
expects to find "Red Hat-isms".  I wouldn't use them to write new init
scripts (personally), but if you've had experience with them in the past
and like them, by all means feel free.

It's planned to continue support for them.

Hope this helps some.

-> Hey thanks for the tip.


All times are GMT -5. The time now is 05:12 PM.