You are not logged in.

#1 2006-01-13 03:21:27

loserMcloser
Member
From: Canada
Registered: 2004-12-15
Posts: 130

rc.local.shutdown

Just a suggestion: We have an rc.local script so we don't have to muck around in the initscripts to do custom startup stuff, why don't we have an rc.local.shutdown?

Offline

#2 2006-01-13 03:38:33

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: rc.local.shutdown

Cool idea.... do you have an example of when it would be useful?

Dusty

Offline

#3 2006-01-13 11:02:13

Cam
Member
From: Brisbane, Aus
Registered: 2004-12-21
Posts: 658
Website

Re: rc.local.shutdown

Would /etc/rc.shutdown be the file you are chasing?

Offline

#4 2006-01-13 14:37:51

loserMcloser
Member
From: Canada
Registered: 2004-12-15
Posts: 130

Re: rc.local.shutdown

Cam wrote:

Would /etc/rc.shutdown be the file you are chasing?

No, the point is I want to be able to do local stuff at shutdown without hacking rc.shutdown -- as it is I have a few hacks in the rc.* files and it makes pacman -S initscripts a real pain in the butt to sort out.

Of course I know I can make my own rc.local.shutdown, but I still have to run it from rc.shutdown.

Offline

#5 2006-01-13 14:47:25

loserMcloser
Member
From: Canada
Registered: 2004-12-15
Posts: 130

Re: rc.local.shutdown

Dusty wrote:

Cool idea.... do you have an example of when it would be useful?

To cleanly undo anything that's done in rc.local   tongue

I don't have any examples that would be useful for the whole arch userbase, but I assume that if there's stuff I want to do at shutdown, some other users have stuff they want to do at shutdown too.

The changes to initscripts would be pretty minimal too -- just add a blank rc.local.shutdown file, and then add

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

to the beginning of rc.shutdown.

One thing that I do when I shut down my main workstation is have a message sent over the network to my fileserver telling it to shutdown as well -- the fileserver then shuts down or not depending on whether any other machines are accessing it and depending on the existence of a certain LOCK file.

Offline

#6 2006-01-13 14:55:32

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: rc.local.shutdown

I think, the easiest solution would be adding a file to /etc/rc.d that has proper start and stop sections. Then add it to DAEMONS in rc.conf and be happy.
That's exactly what those scripts are for: Doing something when you boot and undoing it when you shut down.

Offline

#7 2006-01-13 15:12:54

loserMcloser
Member
From: Canada
Registered: 2004-12-15
Posts: 130

Re: rc.local.shutdown

brain0 wrote:

I think, the easiest solution would be adding a file to /etc/rc.d that has proper start and stop sections. Then add it to DAEMONS in rc.conf and be happy.
That's exactly what those scripts are for: Doing something when you boot and undoing it when you shut down.

Yeah, I do that for some things, like setting up and disabling encrypted swap. Some other things there are some timing issues with other daemons being fully up and running that would make the necessary /etc/rc.d script too messy for my tastes.

Regardless, there's no place to put any shutdown tasks that have nothing to do with tasks in rc.local except right into rc.shutdown.

You could argue that we don't need an /etc/rc.local, just add a file to /etc/rc.d that has a start section that does what you want, and a stop section that does nothing.

I guess the lack of symmetry of having an /etc/rc.local for startup but no similar initscript for shutdown bugs me. (sorry, I'm a mathematician  wink )

Offline

#8 2006-01-13 23:26:46

Cam
Member
From: Brisbane, Aus
Registered: 2004-12-21
Posts: 658
Website

Re: rc.local.shutdown

loserMcloser wrote:

No, the point is I want to be able to do local stuff at shutdown without hacking rc.shutdown -- as it is I have a few hacks in the rc.* files and it makes pacman -S initscripts a real pain in the butt to sort out.

Of course I know I can make my own rc.local.shutdown, but I still have to run it from rc.shutdown.

Ahh I get you now big_smile Cool idea, submit a bug report and see if you get lucky wink

Offline

Board footer

Powered by FluxBB