From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by sourceware.org (Postfix) with ESMTPS id 3C03F3858D37 for ; Sat, 20 Apr 2024 14:56:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3C03F3858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSW.ab.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=SystematicSW.ab.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3C03F3858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=216.40.44.12 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713624997; cv=none; b=bQzmwdceWANzq8Q5fe8Vny6pGK2R7CcURTN0SLgcfWV7jncp3WxV5+rH1vTq8P5Ylr8M5v5hgXgRLV0/IPkoQpRRqFVHXUVe7fCPyVJ0boeFa2zKl78TGMPvEUQ5nKASlc6Czmsv5Hch+EZLfCkyN7ynDy5zVESbRNO+To/vmjA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713624997; c=relaxed/simple; bh=h2wLACYoaZlb2RMGAgguoetVOs1av/4KUEUDAm5k+js=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=JpKyPQpdE2ePY+9mZ3+6gPrzWjhUqLMMpyoU4QVFtOMf814uY/CCADsPxEketHxwzCxnrdGoQ/lFn6ziXpppsEcBFY1Z26TGD15mN5Pc8ci/7EwvzYv+W7WqtgxtvF9VTOLSaOGLxPAAAQ3M8/hKz+ZSzEtj9FrKjeE2QaTczM8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from omf01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id B044640574 for ; Sat, 20 Apr 2024 14:56:30 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: Brian.Inglis@SystematicSW.ab.ca) by omf01.hostedemail.com (Postfix) with ESMTPA id 4ABD260009 for ; Sat, 20 Apr 2024 14:56:29 +0000 (UTC) Message-ID: Date: Sat, 20 Apr 2024 08:56:28 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Reply-To: cygwin@cygwin.com Subject: Re: cygrunsrv: trailing command line arguments not allowed Content-Language: en-CA To: cygwin@cygwin.com References: <402bcd5955c3f4ec870e565ab14688dd@perezterron.net> From: Brian Inglis Organization: Systematic Software In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4ABD260009 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Stat-Signature: qhuzj1spkofrg9ke1qn7gd8tnc8o64kn X-Rspamd-Server: rspamout05 X-Session-Marker: 427269616E2E496E676C69734053797374656D6174696353572E61622E6361 X-Session-ID: U2FsdGVkX189Suw2Hxc2Z2u/cZwoPiDwVAVfT/Xk0Vs= X-HE-Tag: 1713624989-814041 X-HE-Meta: U2FsdGVkX19Ov4zCBVhJp6fGnNz8cr2OAZOi03I6D3+ttMAOmA6U3DnqJtu5vRJYjGSHf19QdmIqFgDyfw5OV99KYRMEIN8lp/VjWC6TXMuRUakAewaceJ8UjwK8igrAVpftBt/TMw8Czzz5Ib7b/ZpxAFki1Mj2wTppkP5pGTLfRZHYBGfgWIuUldo87Stzu12xaBismjLzS6rqUV6IG+jf4APcs4i6hGF8Aa/lE1/LtxBpfBPTkcpu5naM7Yv/6e5l4C0WdSYmJqSq9UOavizWXR8VeKLcRJCN7xggiZwTty+8TEpWvoi8UF+642IGbYdQ2SeLYyguhcXc6Pz5euZ2RJE5Gcz/ X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2024-04-20 06:31, Eliot Moss via Cygwin wrote: > On 4/20/2024 8:12 AM, enrique--- via Cygwin wrote: >> Hello, >> >> I am trying to install a service manually in an attempt to understand why >> cron-config did not work for me. >> >> So, I did this: >> >>> $ net stop cron >>> Tjenesten Cron daemon stopper . >>> Tjenesten Cron daemon ble stoppet. >>> >>> $ cygrunsrv -R cron >>> >>> $ cygrunsrv -I -p /usr/sbin/cron.exe -a -n >>> cygrunsrv: Trailing commandline arguments not allowed >>> Try `cygrunsrv --help' for more information. >> >> I also tried a number of other combinations and orders of arguments, all with >> similar results. >> >> What am I doing wrong? > I would try --args '-n' instead of -a -n.  Perhaps some other > variation of quoting will be needed to make clear to cygrunsrv > that the -n is for the application, not for cygrunsrv. Unadorned options anywhere on the command line are parsed by getopt, which is why the options are quoted by cron-config: $ awk '/cygrunsrv\s-I/,/[^\\]$/' /usr/bin/cron-config if cygrunsrv -I cron -p /usr/sbin/cron -e CYGWIN="${cygenv}" -e TMP="/tmp" \ -e TEMP="/tmp" -a "-n" -d "Cron daemon" -u "$cyg_username" -w "$password" if cygrunsrv -I cron -p /usr/sbin/cron -e CYGWIN="${cygenv}" \ -a "-n" -d "Cron daemon" I have normally found it more useful to run Cygwin *-config as elevated admin, and if from cmd with Cygwin /bin/ in path, then as `bash -c /usr/bin/*-config`. You can modify settings either with: $ cygrunsrv -E $srv; cygrunsrv -R $srv; cygrunsrv -I $srv ... possibly adding: -d, --disp "CYGWIN Cron daemon" -c, --chdir `cygpath -m /` -O, --preshutdown -y, --dep syslog-ng ... or with: $ sc config help DESCRIPTION: Modifies a service entry in the registry and Service Database. USAGE: sc config [service name] ... OPTIONS: NOTE: The option name includes the equal sign. A space is required between the equal sign and the value. To remove the dependency, use a single / as dependency value. type= start= error= binPath= group= tag= depend= obj= DisplayName= password= for example: $ sc cron config start= delayed-auto DisplayName= "CYGWIN Cron daemon" \ depend= syslog-ng or $ s=/proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/cron; \ regtool set -d $s/KEY DWORD-VALUE; \ ... giving something like: $ s=/proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/cron; \ for p in {'',/Parameters{,/Environment}}; do \ echo; echo $s$p:; regtool list -v $s$p; done /proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/cron: Parameters/ () DisplayName (REG_SZ) = "CYGWIN Cron daemon" Type (REG_DWORD) = 0x00000010 (16) Start (REG_DWORD) = 0x00000002 (2) ErrorControl (REG_DWORD) = 0x00000001 (1) ImagePath (REG_EXPAND_SZ) = ".../bin/cygrunsrv.exe" ObjectName (REG_SZ) = "LocalSystem" Description (REG_SZ) = "Cygwin Command Execution Scheduler cron daemon" DelayedAutoStart (REG_DWORD) = 0x00000001 (1) DependOnService (REG_MULTI_SZ) = "syslog-ng" /proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/cron/Parameters: Environment/ () AppPath (REG_SZ) = "/usr/sbin/cron" AppArgs (REG_SZ) = "-n" Preshutdown (REG_DWORD) = 0x00000001 (1) /proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/cron/Parameters/Environment: CYGWIN (REG_SZ) = " " -- Take care. Thanks, Brian Inglis Calgary, Alberta, Canada La perfection est atteinte Perfection is achieved non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut -- Antoine de Saint-Exupéry