From 6ac2abcba25090cfd4b91e02408a2889a987981d Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 6 May 2005 00:38:36 +0000 Subject: Convert rc.shutdown to php script, gracefully shutdown carp interfaces on shutdown --- etc/rc.shutdown | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'etc') diff --git a/etc/rc.shutdown b/etc/rc.shutdown index 08e22ad..2f7bc60 100755 --- a/etc/rc.shutdown +++ b/etc/rc.shutdown @@ -1,19 +1,23 @@ -#!/bin/sh +#!/usr/local/bin/php # $Id$ -stty status '^T' +exec("stty status '^T'"); # Set shell to ignore SIGINT (2), but not children; # shell catches SIGQUIT (3) and returns to single user after fsck. -trap : 2 -trap : 3 # shouldn't be needed +exec("trap : 2"); +exec("trap : 3"); -HOME=/ -PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin -export HOME PATH +require("guiconfig.inc"); -# Insert other shutdown procedures here +/* bring down carp gracefully */ +$carp_counter=find_number_of_created_carp_interfaces(); +mwexec("/sbin/sysctl net.inet.carp.allow=0"); +for($x=0; $x<$carp_counter; $x++) { + mwexec("/sbin/ifconfig carp{$x} down"); + mwexec("/sbin/ifconfig carp{$x} destroy"); +} -exit 0 +exit 0; -- cgit v1.1