Search the web
Sign In
New User? Sign Up
FreeBSD-rc · Improving FreeBSD startup scripts
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Enhancement to gbde rc.d script   Message List  
Reply | Forward Message #659 of 729 |
Hello

I have enhanced the gbde rc.d script a bit, so it asks the user X times
(normally 3) for the pass-phrase. I have also added support for having
the lockfiles in another other directories than /etc. Both features are
documented, and the existing feature of specifying the exact filename of
a lockfile is also documented in this patch.

Comments, or, even better, approval for me to commit it from a src
committer would be great :-).

--
Simon L. Nielsen
FreeBSD Documentation Team


Sat Jan 17, 2004 5:39 pm

simon@...
Send Email Send Email

Index: etc/rc.d/gbde
===================================================================
RCS file: /home/ncvs/src/etc/rc.d/gbde,v
retrieving revision 1.1
diff -u -r1.1 gbde
--- etc/rc.d/gbde 17 Jun 2003 02:56:29 -0000 1.1
+++ etc/rc.d/gbde 17 Jan 2004 17:09:14 -0000
@@ -72,10 +72,20 @@
for device in $gbde_devices; do
parentdev=${device%.bde}
parent=${parentdev#/dev/}
- eval "lock=\${gbde_lock_${parent}-\"/etc/${parent}.lock\"}"
- if [ -e $lock ]; then
+ eval "lock=\${gbde_lock_${parent}-\"${gbde_lockdir}/${parent}.lock\"}"
+ if [ -e ${lock} -a ! -e ${device} ]; then
echo "Configuring Disk Encryption for ${device}."
- gbde attach ${parentdev} -l ${lock}
+
+ count=1
+ while [ ${count} -le ${gbde_attach_attempts} ]; do
+ gbde attach ${parentdev} -l ${lock}
+ if [ -e ${device} ]; then
+ break
+ fi
+ echo "Attach failed; attempt ${count} of ${gbde_attach_attempts}."
+ count=$((${count} + 1))
+ done
+
fi
done
}
Index: etc/defaults/rc.conf
===================================================================
RCS file: /home/ncvs/src/etc/defaults/rc.conf,v
retrieving revision 1.195
diff -u -r1.195 rc.conf
--- etc/defaults/rc.conf 25 Dec 2003 23:29:19 -0000 1.195
+++ etc/defaults/rc.conf 17 Jan 2004 17:29:15 -0000
@@ -45,6 +45,8 @@
# Experimental - test before enabling
gbde_autoattach_all="NO" # YES automatically mounts gbde devices from fstab
gbde_devices="NO" # Devices to automatically attach (list, or AUTO)
+gbde_attach_attempts="3" # Number of times to attempt attaching gbde devices.
+gbde_lockdir="/etc" # Where to look for gbde lockfiles.

fsck_y_enable="NO" # Set to YES to do fsck -y if the initial preen fails.
background_fsck="YES" # Attempt to run fsck in the background where possible.
Index: share/man/man5/rc.conf.5
===================================================================
RCS file: /home/ncvs/src/share/man/man5/rc.conf.5,v
retrieving revision 1.203
diff -u -r1.203 rc.conf.5
--- share/man/man5/rc.conf.5 26 Dec 2003 03:41:27 -0000 1.203
+++ share/man/man5/rc.conf.5 17 Jan 2004 17:29:49 -0000
@@ -922,13 +922,40 @@
If set to
.Dq Li YES ,
.Pa /etc/rc.d/gbde
-will attempt to automatically initialize your .bde devices in
+will attempt to automatically initialize your
+.Xr gbde 4
+devices in
.Pa /etc/fstab .
.It Va gbde_devices
.Pq Vt str
List the devices that the script should try to attach,
or
.Dq Li AUTO .
+.It Va gbde_lockdir
+.Pq Vt str
+The directory where the
+.Xr gbde 4
+lockfiles are located.
+The default lockfile directory is
+.Pa /etc .
+.Pp
+The lockfile for each individual
+.Xr gbde 4
+device can be overridden by setting the variable
+.Va gbde_lock_ Ns Aq Ar device ,
+where
+.Ar device
+is the encrypted device without the
+.Dq Pa /dev/
+and
+.Dq Pa .bde
+parts.
+.It Va gbde_attach_attempts
+.Pq Vt int
+Number of times to attempt attaching to a
+.Xr gbde 4
+device, i.e. how many times the user is asked for the pass-phrase.
+Default is 3.
.It Va fsck_y_enable
.Pq Vt bool
If set to


Attachment
attachment
Type:
application/pgp-signature
Forward
Message #659 of 729 |
Expand Messages Author Sort by Date

Hello I have enhanced the gbde rc.d script a bit, so it asks the user X times (normally 3) for the pass-phrase. I have also added support for having the...
Simon L. Nielsen
simon@...
Send Email
Jan 17, 2004
5:39 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help