Restarting Required Services on Windows

After the DHCP and TFTP services have been configured, and the NFS mapping file has been created, you must restart the NFS daemons, the Internet services daemon, the port-mapping daemon, and the DHCP server. In general, it is easier to use the Windows Services utility to do this; however, you might have to install xinetd and dhcpd using the cygrunsrv.exe command before you can start and stop them using this utility.

The cygrunsrv.exe Command

The cygrunsrv.exe command is installed with Cygwin, and manipulates Windows services from Cygwin. For additional information about the command’s options, use cygrunsrv.exe --help.

To run the script, open a Cygwin Bash shell and issue the following command from the directory containing the script, typically C:\Cygwin\bin. (You only need to use the --stop and --remove commands if the service was previously installed. Otherwise, you can run just the last command.)

Next, specify the Cygwin services that will be used. (Commands must be issued on one line, without the line breaks shown here.)

$ cygrunsrv.exe --stop "xinetd"
$ cygrunsrv.exe --remove "xinetd"
$ cygrunsrv.exe -I "xinetd" -d 'Cygwin xinetd' -f \
  'Cygwin xinetd service' -p /usr/sbin/xinetd -e \
  CYGWIN=ntsec -a "-filelog /var/log/xinetd.log"

$ cygrunsrv.exe --stop "dhcpd"
$ cygrunsrv.exe --remove "dhcpd"
$ cygrunsrv.exe -I "dhcpd" -d 'Cygwin dhcpd' -f \
  'Cygwin DHCP service' -p /usr/sbin/dhcpd -e \
  CYGWIN=ntsec -a "-f eth1"

Note that if your Windows system uses an Ethernet device other than eth1 to communicate with the target, you should substitute the appropriate network interface card. In this example, the option -a "-f eth1" in the last line restricts the server to using the NIC named eth1.

The Windows Services Utility

Choose Settings > Control Panel from the Start menu, open Administrative Tools and then open Services.

Note

The NFS server daemon (nfsd) and the NFS mount daemon (mountd) depend on the port-mapping service. You must start portmap before starting nfsd or mountd. You can start xinetd and dhcpd at any time.

In addition, when you shut down nfsd, it shuts down mountd, but when you restart nfsd, it does not restart mountd.

To start a service, select it from the list. Then either choose Action > Start, or right-click on the service and select Start from the context menu. Do this for each of the services.

Note

Starting other Cygwin services might cause the Services panel to erroneously show the xinetd daemon as stopped. To verify that xinetd is active, use a Cygwin Bash shell to search the running processes for xinetd by issuing the following command:

$ ps -a | grep xinetd 

If a process with that name is found, the xinetd daemon is active. If no value is returned from this search, start the xinetd service again.