You are not logged in.

#1 2010-03-23 19:23:00

DarkVenger
Member
Registered: 2008-11-24
Posts: 35

[SOLVED]Halt/Shut-down sequence?

Hello,

don't know if this is the right place to post but I've been searching through the forums and wiki and haven't found neither an answer nor a conclusion about the right place to post. So newbie it is smile

How does the shut-down sequence processes itself on Arch?

Is there a way to control the order by which the processes go down?


My problem:
The rpcbind daemon (from nfs) shuts down before the wicd daemon.
The latter is responsible for the correct umount of my nfs shares.
So this results in a "wait for timeout" at shutdown...which takes quite a few tens of seconds and is simply boring...

Does I need it to be the other way around...


Thanks

Last edited by DarkVenger (2010-03-24 11:52:53)

Offline

#2 2010-03-23 20:04:47

ruffedgz
Member
From: Michigan
Registered: 2009-07-23
Posts: 54

Re: [SOLVED]Halt/Shut-down sequence?

When I first read this post, I was interested myself as I know how Red Hat does they shutdown and start up process.

I didn't find anything that extensive on Arch's Wiki but I did find something about /etc/rc.shutdown (http://wiki.archlinux.org/index.php/Arc … c.shutdown)

This doesn't solve your problem but this is probably the file you will need to read and understand how to have rpcbind daemon turn off after wicd daemon turns off.

I did read this one line that would probably interest you alot:

# Shutdown daemons in reverse order
let i=${#DAEMONS[@]}-1
while [ $i -ge 0 ]; do
        if [ "${DAEMONS[$i]:0:1}" != '!' ]; then
                ck_daemon ${DAEMONS[$i]#@} || stop_daemon ${DAEMONS[$i]#@}
        fi
        let i=i-1
done

Hope this helps.


Arch linux i686 | Dell XPS m1530 | Intel Core 2 Duo 2 GHz | 3 GB RAM | 250GB HDD

Offline

#3 2010-03-23 20:30:15

DarkVenger
Member
Registered: 2008-11-24
Posts: 35

Re: [SOLVED]Halt/Shut-down sequence?

Thanks a lot.
I never remembered to look for my answer in a /etc/rc.*...
But it confirms what I though I had read one time, the "reverse order".
It seems the most easy thing to do is to start rpcbind before wicd, this way at shutdown they will be reversed.
I'll give it a try if it fails I'll modify the rc.shutdown since it is easy enough to understand smile

Offline

#4 2010-03-23 21:20:30

Surgat_
Member
Registered: 2007-08-08
Posts: 317

Re: [SOLVED]Halt/Shut-down sequence?

Any modifications to rc.shutdown will be overwritten by the next update to initscripts. Instead, you can do whatever you want in /etc/rc.shutdown.local, which will be executed before stopping any daemons.

Offline

#5 2010-03-24 09:14:54

Larsson
Member
From: Sweden
Registered: 2010-03-22
Posts: 156

Re: [SOLVED]Halt/Shut-down sequence?

Surgat_ wrote:

Any modifications to rc.shutdown will be overwritten by the next update to initscripts. Instead, you can do whatever you want in /etc/rc.shutdown.local, which will be executed before stopping any daemons.

if [ -x /etc/rc.local.shutdown ]; then
    /etc/rc.local.shutdown
fi

is the code in /etc/rc.shutdown, so the locl file should be  /etc/rc.local.shutdown


"If the person you are talking to doesn't appear to be listening, be patient. It may simply be that he has a small piece of fluff in his ear." - A.A. Milne (Winnie-the-Pooh)

Offline

#6 2010-03-24 11:52:30

DarkVenger
Member
Registered: 2008-11-24
Posts: 35

Re: [SOLVED]Halt/Shut-down sequence?

Going for the /etc/rc.local.shutdown was in fact the best solution because, I don't have rpcbind directly in the DAEMONS array, since it is started by nfs-common (which is in the array).
This way, rpcbind was always going to be shutdown prior to wicd which is in the array.

/etc/rc.local.shutdown now looks like this,

#!/bin/bash
#
# /etc/rc.local.shutdown: Local shutdown script.
#
. /etc/rc.d/functions

ck_daemon netfs || stop_daemon netfs
ck_daemon wicd || stop_daemon wicd

As a side discovery. Wicd support running scripts according to the connections status and though it effectively mounts my nfs shares it fails to umount them.
According to its logs it seems the connection is lost prior to running the pre-disconnect script so I had to use netfs script to correctly umount the shares. 

Thanks a lot guys.

Offline

#7 2010-03-24 14:39:14

Surgat_
Member
Registered: 2007-08-08
Posts: 317

Re: [SOLVED]Halt/Shut-down sequence?

Larsson wrote:
Surgat_ wrote:

Any modifications to rc.shutdown will be overwritten by the next update to initscripts. Instead, you can do whatever you want in /etc/rc.shutdown.local, which will be executed before stopping any daemons.

if [ -x /etc/rc.local.shutdown ]; then
    /etc/rc.local.shutdown
fi

is the code in /etc/rc.shutdown, so the locl file should be  /etc/rc.local.shutdown

Damn! I looked into rc.shutdown and then misspelled what I had read

Offline

Board footer

Powered by FluxBB