Re: cygrunsrv: trailing command line arguyments not allowed

2024-04-20 Thread enrique--- via Cygwin

Den 2024-04-20 14:12, skrev enrique--- via Cygwin:

$ cygrunsrv -I -p /usr/sbin/cron.exe -a -n
cygrunsrv: Trailing commandline arguments not allowed
Try `cygrunsrv --help' for more information.

[snip]

What am I doing wrong?


I found it: Missing service name after "-I".

-Thanks

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


Re: cygrunsrv: trailing command line arguments not allowed

2024-04-20 Thread Brian Inglis via Cygwin

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) = 0x0010 (16)
Start (REG_DWORD) = 0x0002 (2)
ErrorControl (REG_DWORD) = 0x0001 (1)
ImagePath (REG_EXPAND_SZ) = ".../bin/cygrunsrv.exe"
ObjectName (REG_SZ) = "LocalSystem"
Description (REG_SZ) = "Cygwin Command Execution Scheduler cron daemon"
DelayedAutoStart (REG_DWORD) = 0x0001 (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) = 0x0001 (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

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


Re: cygrunsrv: trailing command line arguyments not allowed

2024-04-20 Thread Eliot Moss via Cygwin

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?

Thanks


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.

Best - Eliot Moss


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


cygrunsrv: trailing command line arguyments not allowed

2024-04-20 Thread enrique--- via Cygwin

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?

Thanks

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


Re: Howto request an upgrade for keychain package

2024-04-20 Thread J M via Cygwin
El vie., 19 abr. 2024 21:19, Brian Inglis via Cygwin 
escribió:

> On 2024-04-19 08:53, J M via Cygwin wrote:
> > El jue., 18 abr. 2024 20:10, J M 
> escribió:
> >> I'm having some problems (gpg2, and some for ssh management) with
> keychain
> >> package: https://www.cygwin.com/packages/summary/keychain.html
> >>
> >> It version is 2.7.1, can be upgraded to, by example the last 2.8.5?
> >>
> >> It is here: https://github.com/funtoo/keychain/tree/2.8.5
>
> > Fow now, I implement a very weird implementation to fix this (very old
> > keychain version) in pseudocode:
> >
> > If I am inside Cygwin and keychain version is 2.7.1 then:
> > curl -L -o /usr/bin/keychain
> > https://raw.githubusercontent.com/funtoo/keychain/2.8.5/keychain
> >
> > But it is a weird workaround, you can upgrade this package? If not exists
> > any security problem clearly...
>
> The upstream repo has not been updated since 2018.
> You might be better finding a more modern, secure, compatible login
> manager like
> gnome-keyring or KDE kwalletmanager, or improved process like using known
> hosts
> and authorized keys files to limit access.
>

Hi Brian,

Yes, I know gnome-keyring or for the kde, but keychain not depends for X11,
and installs multiple packages not used.
The keychain is the better for text mode and lightweight. Has not been
updated since 2018 (I see that are finding maintainers), but work well and
support for GPG2. The actual is very old 2013...
Improve solution is not an option.
The Cygwin has the possibility to select exact versions and can be live two
versions.

Regards

>
>

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


Re: 3.5.x regression: misquoting command line arguments from native processes

2024-04-20 Thread David Allsopp via Cygwin
Hi Corinna,

> On Apr  9 22:38, Corinna Vinschen via Cygwin wrote:
> > On Apr  3 16:53, David Allsopp via Cygwin wrote:
> > > I have what appears to be a regression in Cygwin 3.5.0 which, owing to
> > > a CI system lagging behind, we've only just discovered.
> > > [...]
> > > $ ./t.exe 'C:\Devel\🐫реализация-mingw64\flexdll\flexdll_mingw64.o'
> > > stat: cannot stat
> > > '"C:\Devel\'$'\360\237\220\253''реализация-mingw64\flexdll\flexdll_mingw64.o':
> > > No such file or directory
> >
> > Thanks a lot for the STC!
> >
> > I think I fixed that for 3.5.4.  I pushed a patch and the test release
> > cygwin-3.6.0-0.115.g579064bf4d40 is just building and should be ready
> > for testing in an hour or two.
> >
> > Please give it a try.
>
> Sorry for nagging, but do you have some feedback, be it bad or good?

Sorry for having needed nagging! It does indeed fix it, thank you -
our smoke-test Bactrian camels can be restored 🐫

All best,


David

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