cron_diagnose step in cron-config w/new mounts 1.5.25(0.156/4/2)

Brian Dessent brian@dessent.net
Sun Dec 9 20:21:00 GMT 2007


Tom Rodman wrote:

> It's possible the cron-config script does not understand the new
> mount entries in the registry; or what am I missing?

Yes, the script needs updating.  However, it should *not* be looking at
the registry directly.  It should be using the mount command which is
the only supported interface for the mount table, like in the attached
patch.

Brian
-------------- next part --------------
--- cron-config.orig	2007-06-12 17:56:23.001000000 -0700
+++ cron-config	2007-12-09 12:19:11.953125000 -0800
@@ -343,8 +343,7 @@
     mnt_point=$1
     dos_dir=$2
 
-    SYSTEM_MOUNTS='/proc/registry/HKey_Local_Machine/Software/Cygnus Solutions/Cygwin/mounts v2'
-    if ls "$SYSTEM_MOUNTS" | grep -Eq "^${mnt_point}$"; then
+    if mount | grep -Eq "on ${mnt_point} type.*system"; then
 	true
     else
 	echo;
@@ -709,8 +708,7 @@
 	    servtest=no
 	fi
     elif [ -n "$nt" -a "${servtest}" = "0" ]; then
-	cronuserreg="/proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/cron/ObjectName"
-	cronusername="$(cat "${cronuserreg}")"
+	cronusername=$(cygrunsrv -VQ cron | awk '/^Account/ { print $3 }')
 	echo "Cron is already installed as a service under account ${cronusername}."
 	if request "Do you want to remove or reinstall it?"; then
 	    if cygrunsrv -R cron; then

-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list