[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[plamo:02133] Re: リムーバブルメディアについて



新井正です。

 automount のパッケージ使用してみました。
ftp://ftp.linet.gr.jp/pub/Plamo/Update/1.4.1/autofs.tgz 

autofs にバグあるらしく /etc/rc.d/rc.autofs が1部不調でした。
不具合解消のためのパッチを作りましたので文末に示します。
当方、プログラム作成は苦手のため、識者の方の確認をお願いします。

なお症状は、
/etc/auto.master 内のオプションが反映されない、
/etc/rc.d/rc.autofs で restart  が効かないない、
なので、
automount のオプションなく rc.autofs の起動のみの利用なら
問題は顕在化しなしと思われます。

不具合点と修正のポイント
(1) /etc/auto.master 内のオプションが反映しない
    たとえば以下のようなタイムアウトの指定が有効にならない。
     /auto   /etc/auto.misc ---timeout 60

    対策
      automount のオプション位置の正常化
      automount $dir ...  $options $localoptions
      automount $options $dir ...  $localoptions

(2) /etc/rc.d/rc.autofs restart が効かない。

    エラーメッセージは以下のとおり。
    bash# /etc/rc.d/rc.autofs restart
    Checking for changes to /etc/auto.master ....
    /etc/rc.d/rc.autofs: tempfile: command not found
    /etc/rc.d/rc.autofs: tempfile: command not found
    /etc/rc.d/rc.autofs: : Ambiguous redirect
    /etc/rc.d/rc.autofs: : Ambiguous redirect
    Stop automount /auto file /etc/auto.misc

    対策は
    スクリプト中のテンポラリファイル TMP1 TMP2 作成の正常化
    /etc/auto.master の変更時に stop, start が正しくかかるよう
    TMP1 TMP2 の処理をみなおし。

    蛇足質問
    redhat系のディストリビューションをご存知の方、
    tempfile と言うコマンドが存在するかどうか教えてください。
    また /etc/rc.d/rc.autofs restart が有効か教えてください。

    実は/etc/rc.d/rc.autofs のスクリプト中に TMP1=`tempfile`; の
    記述あるものの Plamo では tempfile コマンドが見当たらず、
    質問した次第です。
    
     rc.autofs は 
    スクリプト中で debian タイプと redhat (非debian) タイプの
    2種に分類し、処理をかえているようです。
    ここでは Plamo は redhat 扱いですが、本来の redhat 系ならば
    バグの影響少なく動作するのか、興味あるところです。


以下、パッチ
##########################################################はじめ
--- rc.autofs.	Wed Mar 31 23:32:52 1999
+++ rc.autofs	Fri Apr  2 02:33:38 1999
@@ -50,11 +50,11 @@
 		map=`echo "/etc/$map" | sed -e 's:^/etc//:/:'`
 		options=`echo "$options" | sed -e 's/\(^\|[ \t]\)-/\1/g'`
 		if [ -x $map ]; then
-		    echo "automount $dir program $map $options $localoptions"
+		    echo "automount $options $dir program $map $localoptions"
 		elif [ -f $map ]; then
-		    echo "automount $dir file $map $options $localoptions"
+		    echo "automount $options $dir file $map $localoptions"
 		else
-		    echo "automount $dir `basename $map` $options $localoptions"
+		    echo "automount $options $dir `basename $map` $localoptions"
 		fi
 	    fi
 	done
@@ -74,7 +74,7 @@
 	    then
 		map=`echo "$map" | sed -e 's/^auto_/auto./'`
 		options=`echo "$options" | sed -e 's/\(^\|[ \t]\)-/\1/g'`
-		echo "automount $dir yp $map $options $localoptions"
+		echo "automount $options $dir yp $map $localoptions"
 	    fi
 	done
     )
@@ -126,13 +126,15 @@
 		exit 1
 	fi
 	echo "Checking for changes to /etc/auto.master ...."
-	TMP1=`tempfile`;
-	TMP2=`tempfile`;
-	getmounts >$TMP1
+	TMP1=/var/run/automount.tmp1
+	TMP2=/var/run/automount.tmp2
+        touch $TMP1 
+        touch $TMP2 
+	getmounts >>$TMP1
 	ps ax|grep "[0-9]:[0-9][0-9] automount " | (
 	    while read pid tt stat time command; do
 		echo "$command" >>$TMP2
-		if ! grep -q "^$command" $TMP2; then
+		if ! grep -q "^$command" $TMP1; then
 			kill -USR2 $pid
 			echo "Stop $command"
 		fi
##########################################################おわり

----
alai

References
[plamo:02066] Re: リムーバブルメディアについて, KOJIMA Mitsuhiro

[検索ページ] [メール一覧]
Plamo ML 公開システム