Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 149101 Details for
Bug 208156
net-misc/ucarp init script
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
ucarp.initd
ucarp.initd (text/plain), 1.61 KB, created by
Natanael Copa
on 2008-04-08 13:17:29 UTC
(
hide
)
Description:
ucarp.initd
Filename:
MIME Type:
Creator:
Natanael Copa
Created:
2008-04-08 13:17:29 UTC
Size:
1.61 KB
patch
obsolete
>#!/sbin/runscript ># Copyright 1999-2008 Gentoo Foundation ># Distributed under the terms of the GNU General Public License v2 ># $Header: $ > > ># A simple script to start and stop a ucarp instance ># Things you can set here ># REALIP - if not set, will be first addr on iface ># VHID - Virtual Server ID ># VIP - The Virtual IP ># PASSWORD - The password for the carp announcements > >REALIP= >VHID=2 >VIP=127.0.0.1 >PASSWORD=SecretPassword >DAEMON=/usr/sbin/ucarp > >IFACE="${SVCNAME#*.}" >if [ -n "$IFACE" ] && [ "${SVCNAME}" != "ucarp" ]; then > UP="/etc/ucarp/vip-up-$IFACE.sh" > DOWN="/etc/ucarp/vip-down-$IFACE.sh" > . /etc/ucarp/$IFACE.conf >else > UP="/etc/ucarp/vip-up.sh" > DOWN="/etc/ucarp/vip-down.sh" >fi > > ># Get the primary ip address for a given interface >get_first_ip() { > local foo=$( ip addr show $1 ) > [ $? != 0 ] && foo="" > echo $( echo "$foo" | grep "inet " | head -n1 | \ > sed "s+^.*inet ++g; s+/.*$++g" ) >} > >if [ -z "$REALIP" ]; then > REALIP=$( get_first_ip $IFACE ) >fi > >start () { > ebegin "Starting ucarp $IFACE" > start-stop-daemon --start --exec $DAEMON \ > --background -m -p /var/run/ucarp-$IFACE.pid -- \ > -i $IFACE -s $REALIP -v $VHID -p $PASSWORD -a $VIP \ > -u $UP -d $DOWN -z > eend $? >} > >status () { > ebegin "ucarp $IFACE is ..." > PIDS=$( pidof $( basename $DAEMON )) > PID=$( cat /var/run/ucarp-$IFACE.pid 2>/dev/null ) > [ -n "$PID" ] && OK=$( echo "$PIDS" | grep "$PID" ) > if [ -n "$OK" ]; then > echo "running" > exit 0 > else > echo "not running" > exit 1 > fi >} > >stop () { > ebegin "Shuting down ucarp $IFACE" > start-stop-daemon --stop --exec $DAEMON \ > -p /var/run/ucarp-$IFACE.pid > [ $? -eq 0 ] && rm /var/run/ucarp-$IFACE.pid > eend $? >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 208156
:
142187
|
142189
| 149101 |
168520
|
201601
|
254339
|
254341
|
254343
|
254345
|
254347
|
254349
|
295733
|
295735