You are not logged in.

#1 2006-11-25 17:43:16

nornn
Member
From: Reykjavik
Registered: 2003-10-31
Posts: 35

init scripts

It has been a while since I last posted, but I like arch.
My question is regarding the init scripts used in arch.  Specifically, three common commands used in the init scipts, and they are "stat_fail","stat_done", and "add_daemon".
Could some refer me a wiki, webpage or man page for them, and yes I see there definitions in /etc/rc.d/functions file.


thank you thank you very much.

Offline

#2 2006-11-25 19:08:28

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: init scripts

I'm not aware of any such documentation for them. What else do you need to know, apart from the actual code in /etc/rc.d/functions?

Offline

#3 2006-11-27 00:45:33

nornn
Member
From: Reykjavik
Registered: 2003-10-31
Posts: 35

Re: init scripts

For example in add_daemon:
add_daemon() {
        [ -d /var/run/daemons ] || mkdir -p /var/run/daemons
        touch /var/run/daemons/$1
What is the variable $1 refer to?  I cannot see it defined anywhere else in the function or in the /etc/rc.d/functions script.  Could it be the function referred to in which /etc/rc.d/"script" is run; "script" being whatever init service that is started and stopped,  ie crond would be then touch /var/run/daemons/crond?
  For what it is worth I am just trying to improve my shell scripting skills.
[/i]


thank you thank you very much.

Offline

#4 2006-11-27 00:50:42

slubman
Member
From: Grenoble (France)
Registered: 2004-08-04
Posts: 86
Website

Re: init scripts

In a bash script $1 is the first parameter passed to the script , $2 the second one and so on. Also $0 is the name of the script itself.

Offline

#5 2006-11-27 17:14:04

nornn
Member
From: Reykjavik
Registered: 2003-10-31
Posts: 35

Re: init scripts

I just want to thank tomk and slubman for their time and help.  I of course have more questions relating to /etc/rc.d/functions, but I will try to research the bash script a little more on my own.  However, I now know that there is always someone to help point one in the right direction.


thank you thank you very much.

Offline

Board footer

Powered by FluxBB