Frederic Lepied wrote:
> Borsenkow Andrej <[EMAIL PROTECTED]> writes:
>
>
>>This script manages to shoot off all other processes. Because this
>>happens the very first time devfsd tuns (in rc.sysinit) it kills
>>rc.sysinit ... you get an idea :-)
>>
>>
>
> Could you try with dynamic-0.4-3mdk ?
>
Of course, it does not work. Have you tried to put echo `runlevel` in
rc.sysinit?
The attached patch
- prevents part.script when root is mounted ro (it is useless anyway, we
can neither edit fstab nor create/remove mount points)
- checks that $mpoint is really mounted before trying to shoot all
processes that may be using it.
I do not quite understand the purpose of this script anyway ... in
init.d/kudzu updfstab is commented out as unsupported ... but let's see.
enjoy :-)
-andrej
--- /etc/dynamic/scripts/part.script.bor Sun Sep 16 07:22:57 2001
+++ /etc/dynamic/scripts/part.script Sun Sep 16 11:44:26 2001
@@ -12,8 +12,12 @@
. /etc/dynamic/scripts/functions.script
-case `runlevel` in
- unknown) exit;;
+# Do nothing when root is mounted ro (mostly in rc.sysinit)
+ROOTOPTS=`awk '$2 == "/" {print $4}'`
+case ",$ROOTOPTS," in
+ *,ro,* )
+ exit 0
+ ;;
esac
if [ -x /usr/sbin/updfstab ]; then
@@ -31,8 +35,10 @@
call_hooks add part $mpoint $dev
;;
'-')
- fuser -skm $mpoint
- umount $mpoint
+ if grep "[[:space:]]$mpoint[[:space:]]" /proc/mounts > /dev/null 2>&1 ;
+then
+ fuser -skm $mpoint
+ umount $mpoint
+ fi
rmdir $mpoint
cp -f /etc/fstab.dynamic /etc/fstab
call_hooks del part $mpoint $dev