delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/12/09/15:21:34

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <475C4E34.ADDC1217@dessent.net>
Date: Sun, 09 Dec 2007 12:21:08 -0800
From: Brian Dessent <brian AT dessent DOT net>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: cron_diagnose step in cron-config w/new mounts 1.5.25(0.156/4/2)
References: <200712091554 DOT lB9Fs42H004614 AT tigris DOT pounder DOT sol DOT net>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------2D08AF037A4744F9AC4C07E0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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
--------------2D08AF037A4744F9AC4C07E0
Content-Type: text/plain; charset=us-ascii;
 name="cron-config-registry.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="cron-config-registry.patch"

--- 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


--------------2D08AF037A4744F9AC4C07E0
Content-Type: text/plain; charset=us-ascii

--
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/
--------------2D08AF037A4744F9AC4C07E0--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019