ALT Linux Bugzilla
– Attachment 1251 Details for
Bug 8509
[PATCH] locking for /etc/net
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Собственно патч
etcnet-0715.patch (text/plain), 6.10 KB, created by
Yuriy Kashirin
on 2005-11-17 14:35:21 MSK
(
hide
)
Description:
Собственно патч
Filename:
MIME Type:
Creator:
Yuriy Kashirin
Created:
2005-11-17 14:35:21 MSK
Size:
6.10 KB
patch
obsolete
>diff -Nru 0.7.15-alt1/etc/net/options.d/00-default 0.7.15-uka/etc/net/options.d/00-default >--- 0.7.15-alt1/etc/net/options.d/00-default 2005-10-19 09:59:52 +0300 >+++ 0.7.15-uka/etc/net/options.d/00-default 2005-11-16 18:16:10 +0200 >@@ -25,6 +25,7 @@ > # config files > IFACEDIR=/etc/net/ifaces > VARLIBDIR=/var/lib/etcnet >+VARLOCKDIR=/var/lock/etcnet > VLANTAB=/etc/net/vlantab > HOSTTAB=/etc/net/hosttab > IFTAB=/etc/net/iftab >diff -Nru 0.7.15-alt1/etc/net/scripts/create-ppp 0.7.15-uka/etc/net/scripts/create-ppp >--- 0.7.15-alt1/etc/net/scripts/create-ppp 2005-10-26 21:34:18 +0300 >+++ 0.7.15-uka/etc/net/scripts/create-ppp 2005-11-17 07:25:31 +0200 >@@ -26,7 +26,7 @@ > CHAT_CMD="$CHAT ${CHATOPTIONS:-$DEFAULT_CHATOPTIONS} -f" > > # This one is a must. >-BASIC_PPPOPTIONS="nolog updetach unit ${NAME//ppp/}" >+BASIC_PPPOPTIONS="nolog updetach unit ${NAME//ppp/} ipparam etcnet-$NAME" > > PROF_PPPOPTIONSFILE=`profiled_filename $MYIFACEDIR/${PPPOPTIONSFILE:=$DEFAULT_PPPOPTIONSFILE}` > [ -s $PROF_PPPOPTIONSFILE ] || PROF_PPPOPTIONSFILE= >diff -Nru 0.7.15-alt1/etc/net/scripts/ifconfig-ipv4 0.7.15-uka/etc/net/scripts/ifconfig-ipv4 >--- 0.7.15-alt1/etc/net/scripts/ifconfig-ipv4 1970-01-01 03:00:00 +0300 >+++ 0.7.15-uka/etc/net/scripts/ifconfig-ipv4 2005-11-17 08:18:14 +0200 >@@ -0,0 +1,33 @@ >+#!/bin/bash >+ >+usage() >+{ >+ echo "Usage: $0 <interface>" >&2 >+ exit 1 >+} >+ >+[ -z "$1" ] && usage >+NAME=$1 >+ >+. ${SCRIPTDIR:=/etc/net/scripts}/functions >+if [ -d $IFACEDIR/$NAME@$NETHOST ]; then >+ MYIFACEDIR=$IFACEDIR/$NAME@$NETHOST >+else >+ MYIFACEDIR=$IFACEDIR/$NAME >+fi >+ >+[ -d "$MYIFACEDIR" ] || { >+ print_error "interface configuration directory '$MYIFACEDIR' not found" >+ exit 1 >+} >+export IFACEDIR MYIFACEDIR SCRIPTDIR NAME NETPROFILE SEEN_IFACES >+ >+# Check if interface lock file is present. If true this means that >+# ifup/ifdown script is working, this script will configure iface >+# itself, so we exit >+IFACE_LOCK_FILE="${VARLOCKDIR:=var/lock/etcnet}/if-updown-$NAME.lock" >+[ -f "$IFACE_LOCK_FILE" ] && exit 0 >+ >+${SCRIPTDIR}/config-ipv4 2>/dev/null >+exit 0 >+ >diff -Nru 0.7.15-alt1/etc/net/scripts/ifdown 0.7.15-uka/etc/net/scripts/ifdown >--- 0.7.15-alt1/etc/net/scripts/ifdown 2005-08-03 13:41:34 +0300 >+++ 0.7.15-uka/etc/net/scripts/ifdown 2005-11-16 20:55:12 +0200 >@@ -20,6 +20,19 @@ > fi > > export IFACEDIR MYIFACEDIR SCRIPTDIR NAME NETPROFILE SEEN_IFACES >+ >+# ifup/ifdown script creates a lock file while being running for >+# following popouses: >+# 1. This prevents running more then one instance of this script >+# simultaniously >+# 2. Presence of lockfile shows other processes that interface is >+# under up/down progress >+ >+IFACE_LOCK_FILE="${VARLOCKDIR:=var/lock/etcnet}/if-updown-$NAME.lock" >+mkdir -p ${VARLOCKDIR} >+/usr/bin/lockfile "$IFACE_LOCK_FILE" || exit 3 >+trap 'rm -f "$IFACE_LOCK_FILE" ' EXIT SIGHUP SIGTERM SIGINT >+ > init_netprofile > pickup_options > >diff -Nru 0.7.15-alt1/etc/net/scripts/ifup 0.7.15-uka/etc/net/scripts/ifup >--- 0.7.15-alt1/etc/net/scripts/ifup 2005-09-16 21:38:01 +0300 >+++ 0.7.15-uka/etc/net/scripts/ifup 2005-11-16 20:56:54 +0200 >@@ -28,6 +28,18 @@ > } > export IFACEDIR MYIFACEDIR SCRIPTDIR NAME NETPROFILE SEEN_IFACES > >+# ifup/ifdown script creates a lock file while being running for >+# following popouses: >+# 1. This prevents running more then one instance of this script >+# simultaniously >+# 2. Presence of lockfile shows other processes that interface is >+# under up/down progress >+ >+IFACE_LOCK_FILE="${VARLOCKDIR:=var/lock/etcnet}/if-updown-$NAME.lock" >+mkdir -p ${VARLOCKDIR} >+/usr/bin/lockfile "$IFACE_LOCK_FILE" || exit 3 >+trap 'rm -f "$IFACE_LOCK_FILE" ' EXIT SIGHUP SIGTERM SIGINT >+ > init_netprofile > pickup_options > >diff -Nru 0.7.15-alt1/etc/ppp/ip-down.d/etcnet 0.7.15-uka/etc/ppp/ip-down.d/etcnet >--- 0.7.15-alt1/etc/ppp/ip-down.d/etcnet 1970-01-01 03:00:00 +0300 >+++ 0.7.15-uka/etc/ppp/ip-down.d/etcnet 2005-11-17 12:13:45 +0200 >@@ -0,0 +1,35 @@ >+#!/bin/bash >+ >+# Check if interface up by etcnet. In this case "$6" must >+# be set as "etcnet-$NAME" due to pppd ipparam option >+# when interface was created >+ >+NAME="$1" >+IPPARAM="$6" >+ >+test "$IPPARAM" = "etcnet-$NAME" || exit >+ >+. ${SCRIPTDIR:=/etc/net/scripts}/functions >+if [ -d $IFACEDIR/$NAME@$NETHOST ]; then >+ MYIFACEDIR=$IFACEDIR/$NAME@$NETHOST >+else >+ MYIFACEDIR=$IFACEDIR/$NAME >+fi >+ >+[ -d "$MYIFACEDIR" ] || exit >+export IFACEDIR MYIFACEDIR SCRIPTDIR NAME NETPROFILE SEEN_IFACES >+ >+# Check if ifdown script is in progress. If true then ifdown >+# do all itself, so we exit >+ >+IFACE_LOCK_FILE="${VARLOCKDIR:=var/lock/etcnet}/if-updown-$NAME.lock" >+test -f "$IFACE_LOCK_FLE" && exit >+ >+# At this point we are sure that interface is up by etcnet system >+# and this script is called by pppd before ifdown was started >+# (e.g. when reconnected due to persist option) >+ >+# Call custom scripts >+ExecIfExecutable ${SCRIPTDIR}/ifdown-pre-local $NAME >+ExecIfExecutable ${MYIFACEDIR}/ifdown-pre $NAME >+ >diff -Nru 0.7.15-alt1/etc/ppp/ip-up.d/etcnet 0.7.15-uka/etc/ppp/ip-up.d/etcnet >--- 0.7.15-alt1/etc/ppp/ip-up.d/etcnet 1970-01-01 03:00:00 +0300 >+++ 0.7.15-uka/etc/ppp/ip-up.d/etcnet 2005-11-17 12:13:58 +0200 >@@ -0,0 +1,38 @@ >+#!/bin/bash >+ >+# Check if interface up by etcnet. In this case "$6" must >+# be set as "etcnet-$NAME" due to pppd ipparam option >+# when interface was created >+ >+NAME="$1" >+IPPARAM="$6" >+ >+test "$IPPARAM" = "etcnet-$NAME" || exit >+ >+. ${SCRIPTDIR:=/etc/net/scripts}/functions >+if [ -d $IFACEDIR/$NAME@$NETHOST ]; then >+ MYIFACEDIR=$IFACEDIR/$NAME@$NETHOST >+else >+ MYIFACEDIR=$IFACEDIR/$NAME >+fi >+ >+[ -d "$MYIFACEDIR" ] || exit >+export IFACEDIR MYIFACEDIR SCRIPTDIR NAME NETPROFILE SEEN_IFACES >+ >+# Check if ifup script is in progress. If true then ifup >+# do all itself, so we exit >+ >+IFACE_LOCK_FILE="${VARLOCKDIR:=var/lock/etcnet}/if-updown-$NAME.lock" >+test -f "$IFACE_LOCK_FLE" && exit >+ >+# At this point we are sure that interface is up by etcnet system >+# and this script is called by pppd after ifup was completed >+# (e.g. when reconnected due to persist option) >+ >+# Reconfiguring iface and routes >+ExecIfExecutable ${SCRIPTDIR}/ifconfig-ipv4 $NAME >+ >+# Call custom scripts >+ExecIfExecutable ${SCRIPTDIR}/ifup-post-local $NAME >+ExecIfExecutable ${MYIFACEDIR}/ifup-post $NAME >+
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 8509
: 1251 |
1316