This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cygrunsrv stderr and stdout only to a syslog-ng log?

Bryan D. Thomas wrote:

> I've found in cygrunsrv.README that the -1 and -2
> arguments may be used to specify that output of stdout
> and stderr go to a log file instead of to the Windows
> Event Log.

You are probably misunderstanding, those options change the default which is to
send any cygrunsrv output to /var/log/<sevice_name.log> which usually is empty
since each service does its own logging.

> I'm using cygrunsrv to run two services: sshd and
> syslog-ng.  I'm using syslog-ng to collect timestamped
> log entries from sshd and do postprocessing with
> filters.  What I want to do is stop logging sshd
> events also to the Windows Event Log.

What you describe is already being done: if sshd, for instance, finds that
syslogd is running when it starts it uses it, if not it uses the Windows event log.

So all you need is to start syslogd, it works fine if all services are started
at the same time (automatic in services starup type).

> Is it possible to specify in the cygrunsrv arguments
> to install the sshd service (I suppose by editing the
> ssh-host-config script) that the log events will go to
> syslog-ng, but will not go to the Windows Event Log?

Only one log.  And don't change the script, if you need to change anything, and
you don't, change the sshd configuration.

> For example, if I used -1 /var/log/sshd.log and -2
> /var/log/sshd.log, would that work nicely with the
> syslog-ng which is using those same files as a target,
> or would I get contention, or duplicate lines?

It doesn't work as you describe at all.

> Or, could I use -1 /dev/log -2 /dev/log and syslog-ng
> would pick up all the output to the unix-dgram but
> only enter it once in the log?
> Or, could I use -1 /dev/null -2 /dev/null, but
> syslog-ng would keep working as it is today, and only
> the Windows Event Log would no longer get sshd events?
> I also cannot tell from the documentation I've been
> able to find whether it is possible to change the -1
> and -2 options for an installed service.  Can I simply
> stop the service, run cygrunsrv or edit the registry,
> then start the service?

Don't edit the registry (you are dangerous!), don't run cygrunsrv... just
install the service and start it (which in the case of sshd is done by the
installation script).
René Berber

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]