Astrosteve
11-12-2006, 07:48 PM
I wanted to put some scripting in the rc.sysinit to backout changes by simply rebooting.
That way I don't have to pull out the drive if something goes wrong.
The idea came from someone elses entry on this forum.
The idea is something like this.
if [ -e /var/hack/foo ]; then
# put the original code here if applicable
rm -f /var/hack/foo
else
touch /var/hack/foo
# put your test code here
fi
I ran a test case where I just wanted to make sure I could create the file and delete the file by placing it inside the rc.sysinit and I found I could do neither.
I placed this section of scripting near the bottom of the rc.sysinit just after a loop that appear to be doing a lot of startup
initialization.
Does anyone have a suggestion.
Thanks
That way I don't have to pull out the drive if something goes wrong.
The idea came from someone elses entry on this forum.
The idea is something like this.
if [ -e /var/hack/foo ]; then
# put the original code here if applicable
rm -f /var/hack/foo
else
touch /var/hack/foo
# put your test code here
fi
I ran a test case where I just wanted to make sure I could create the file and delete the file by placing it inside the rc.sysinit and I found I could do neither.
I placed this section of scripting near the bottom of the rc.sysinit just after a loop that appear to be doing a lot of startup
initialization.
Does anyone have a suggestion.
Thanks