How to run inetd daemon on Cygwin?

1

I want to get inetd daemon working on a machine running Cygwin. I know how to do this on Centos 4, but on Cygwin it does not seem to work.

Commands I tried are:

cygrunsrv -I xinetd -d "Cygwin Xinetd" -p /usr/sbin/xinetd -e CYGWIN=ntsec
cygrunsrv -S xinetd
/etc/rc.d/init.d/xinetd start

On Linux, I would just do:

/sbin/service xinetd restart

After editing my configuration file:

/etc/xinetd.d/<myAppHere>

I've created this file on Cygwin, but can't seem to figure out how to start the service.


[si-xp-pro-sp3 ~] /etc/rc.d/init.d/xinetd start
/etc/rc.d/init.d/xinetd: line 22: /etc/init.d/functions: No such file or directory
Starting xinetd: /etc/rc.d/init.d/xinetd: line 59: daemon: command not found

[si-xp-pro-sp3 ~] /usr/sbin/xinetd start
Usage: xinetd [-d] [-f config_file] [-filelog filename] [-syslog facility] [-reuse]
[-limit proc_limit] [-pidfile filename] [-logprocs limit] [-shutdownprocs limit]
[-cc interval]

WilliamKF

Posted 2011-02-22T01:03:12.720

Reputation: 6 916

Answers

1

cygrunsrv does most of the magic but your Windows file system permissions need to be open.

This is more than just doing ls -l

You have to do this via CMD.EXE or, easier, through the EXPLORER.EXE GUI.

You specifically need to open for FULL CONTROL for SYSTEM the following directories (folders):

C:\CYGWIN
C:\CYGWIN\VAR
C:\CYGWIN\VAR\LOG

Select file properties on each of these and look for the Security tab.

If there is no Security tab, you have "Simple File Sharing". Turn that off with Tools -> Folder Options -> View then scroll to the very last checkbox: [ ] Use simple file sharing (recommended)

Make sure that is UNCHECKED - then you should be able to get too the Security tab for each folder.

Make sure that SYSTEM is listed under the Group or user names. Add it if not. Then make sure that when SYSTEM is highlighted that Full Control Allow is checked.

See this link for a discussion of this issue with sshd - http://www.noah.org/ssh/cygwin-sshd.html

lcbrevard

Posted 2011-02-22T01:03:12.720

Reputation: 568

3

Running /usr/bin/xinetd-config to set up xinetd should resolve these two errors:

/etc/rc.d/init.d/xinetd: line 22: /etc/init.d/functions: No such file or directory

Starting xinetd: /etc/rc.d/init.d/xinetd: line 59: daemon: command not found

Aaron

Posted 2011-02-22T01:03:12.720

Reputation: 31

I am here trying to install cygwin+proftpd+xinetd. I was having some troubles, and the above answer worked for me after I did a clean install of cygwin. – user2426679 – 2016-01-05T22:49:08.607

1

Does /etc/rc.d/init.d/xinetd exist? What kind of messages do you get?

Did you try simply running xinetd or /usr/sbin/xinetd?

Simply, does not mean using "start" as an argument. Check the man page for xinetd.

Fundamentally you are confused between the usage of /etc/init.d and /usr/sbin. The init.d folder contains shell scripts that are used to automatically start server processes, but can be used manually as well. sbin contains the binaries of applications. The scripts in init.d all take arguments like start and stop, but if you want to know what arguments an sbin binary takes, you have to read the man page.

When I said simpy run xinetd, I meant to type in the following shell command.

xinetd

and if that doesn't work, then try

/usr/sbin/xinetd

When you put spurious arguments on the command line, xinetd gets confused and doesn't even try to startup.

Michael Dillon

Posted 2011-02-22T01:03:12.720

Reputation: 899

Please see added info in question. – WilliamKF – 2011-02-23T02:37:21.747

Executing /usr/sbin/xinetd gives no output and a zero status result. Should it give any output or does it just silently start up? – WilliamKF – 2011-02-25T01:54:27.917

1An appropriate test for a network daemon like xinetd is to attempt to make a network connection. Or at least to use ps and see if the process appears to be running and netstat -a to see if it is listening on all the ports that you specified in the config. – Michael Dillon – 2011-02-25T02:25:28.793

The network connecion fails, a ps shows nothing running whose name includes inetd, and netstat -a does not show the port being monitored. – WilliamKF – 2011-02-26T16:59:59.643

1@WilliamKF you really do need to read the xinetd man page. What does the -d option show? – Michael Dillon – 2011-02-26T21:08:16.920

0

Here is how:

xinetd-config
cygrunsrv -I xinetd -p /usr/sbin/xinetd -d 'CYGWIN xinetd' -a '-stayalive -pidfile /var/run/xinetd.pid'
cygrunsrv -S xinetd

hawkeye

Posted 2011-02-22T01:03:12.720

Reputation: 407

2

This is Aaron's answer (from four years ago), plus what the OP was already doing, plus the -a option.  Does that really make all the difference? And are you sure about that syntax?  It looks odd. Can you explain it?

– Scott – 2016-10-28T01:49:02.200

Nothing on this page worked for me. I found this somewhere else and it solved my problem in a way that nothing else did. I was trying to contribute to solving this problem in a practical way. – hawkeye – 2016-10-28T02:14:03.410