delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/08/21/11:30:01

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <00d501c367f8$e2f62b80$c900000a@docbill002>
From: "Bill C. Riemers" <cygwin AT docbill DOT net>
To: "Jonathan Simms" <jonathan AT embassynetworks DOT com>, <cygwin AT cygwin DOT com>
References: <001501c367c1$622fba70$3701a8c0 AT williethepimp>
Subject: Re: init and xinetd woes
Date: Thu, 21 Aug 2003 11:26:22 -0400
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165

------=_NextPart_000_00BC_01C367D7.0CD3C2E0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Hi Jonathan,

I found I had to write a custom /usr/sbin/init.sh script to get init to work
properly.  It seems like the sysvinit has nothing in it that actually
controls setting the runlevels during startup and shutdown.   So I installed
the script as the service instead of the init program:

cygrunsrv -I init -p /usr/sbin/init.sh -c /tmp -d 'CYGWIN init' -t auto -s
INT -o

I find about once every few days, my services stop working for now apparent
reason.  In most cases I can restart them with:
    /sbin/telinit 0;sleep 60;/sbin/telinit 3

However, occasionally, that does not work.  Then I do:
       cygrunsrv -E init
        kill -9 <each of the surviving daemons>
       cygrunsrv -S init

I suspect the main cause of the failure, is execve() does not work the same
under Windows and Unix.  For Unix, the new program invoked by the execve()
command has the same process id as the original.  For Windows, the process
ID can be different from the original.  Consequently any script that
does something like:
        echo $$ > newProgram.id
        exec newProgram
might not have the newProgram's PID in the newProgram.id file.  This raises
havoc with scripts that try to automatically stop and restart daemons.

                                                       Bill


----- Original Message ----- 
From: "Jonathan Simms" <jonathan AT embassynetworks DOT com>
To: <cygwin AT cygwin DOT com>
Sent: Thursday, August 21, 2003 4:51 AM
Subject: init and xinetd woes


> hello all,
>
> I've been messing around with xinetd and init and I can't seem to get them
> to play nicely together.
>
> I've checked the archives and have reinstalled xinetd, sysvinit,
> initscripts, etc., run the appropriate config files (overwriting existing
> /etc/*config files) and I still can't get init to start xinetd.
>
> /var/log/init.log is empty
>
>
> net start init produces the following output:
>
> INIT: version 2.84 booting
> INIT: Entering runlevel: 3
> INIT: no more processes left in this runlevel
>
>
>
> $ ps -e |grep init
>      2916    3432    2916        816    ?   18 04:41:05 /sbin/init
>
> $ ps -e |grep xinetd
> <blank>
>
>
> i tried doing "chkconfig --level 12345 xinetd on" but it seemed to have no
> effect
>
> $ chkconfig --list
>
> sshd            0:off   1:off   2:off   3:off   4:off   5:off   6:off
> xinetd          0:off   1:on    2:on    3:on    4:on    5:on    6:off
> xinetd based services:
>         chargen:        on
>         chargen-udp:    on
>         daytime:        on
>         daytime-udp:    on
>         echo:   on
>         echo-udp:       on
>         ftpd:   on
>         imap:   on
>         rexec:  on
>         rlogin: on
>         rsh:    off
>         rsync:  off
>         servers:        on
>         services:       on
>         talk:   on
>         telnet: on
>         time:   off
>         time-udp:       off
>
> there are no init errors in the Event Viewer > Application logs.
>
>
> if i start xinetd "/etc/rc.d/init.d/xinetd start" it starts up alright,
but
> as soon as i try to connect (for example, to imap) I get:
>
> setuid failed. Permission denied (errno=13)
>
> I understand this is because I'm starting the xinetd process under the
local
> user account and it needs to be started under the SYSTEM account in order
to
> setuid.
>
>
> if it makes any difference, my /var/lock/subsys dir is empty
>
>
> I've really done the best I can searching google and the archives for
> answers as to how to resolve this problem. I've spent about 3 hours trying
> to get it to work to no avail. I know this list's attitude towards the
> asking of RTFM questions, or repeating questions easily answered by
> searching the archives, but I'm really stuck with this one. Please help.
>
> -Jonathan Simms
>
>
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
>

------=_NextPart_000_00BC_01C367D7.0CD3C2E0
Content-Type: application/octet-stream;
	name="xinetd.conf"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="xinetd.conf"

#=0A=
# Simple configuration file for xinetd=0A=
#=0A=
# Some defaults, and include /etc/xinetd.d/=0A=
=0A=
defaults=0A=
{=0A=
	instances               =3D 60=0A=
        log_type                =3D FILE /var/log/servicelog=0A=
        log_on_success		=3D HOST PID=0A=
        log_on_failure		=3D HOST=0A=
	cps			=3D 25 30=0A=
}=0A=
=0A=
includedir /etc/xinetd.d=0A=
=0A=

------=_NextPart_000_00BC_01C367D7.0CD3C2E0
Content-Type: application/octet-stream;
	name="init.sh"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="init.sh"

#!/usr/bin/bash=0A=
rm -f /var/lock/subsys/*=0A=
/sbin/init.exe -i 0 & p=3D$!=0A=
trap "/sbin/telinit 6;sleep 5;kill -INT $p;exit" SIGINT=0A=
sleep 5=0A=
/sbin/telinit 1=0A=
sleep 5=0A=
/sbin/telinit 2=0A=
sleep 5=0A=
/sbin/telinit 3=0A=
sleep 5=0A=
trap '/sbin/init -i 6 & p=3D$!;sleep 5;kill -INT $p;exit' SIGINT=0A=
while [ 1 ] ; do=0A=
  sleep 30=0A=
done=0A=

------=_NextPart_000_00BC_01C367D7.0CD3C2E0
Content-Type: application/octet-stream;
	name="inittab"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="inittab"

#=0A=
# inittab       This file describes how the INIT process should set up=0A=
#               the system in a certain run-level.=0A=
#=0A=
# Author:       Miquel van Smoorenburg, <miquels AT drinkel DOT nl DOT mugnet DOT org>=0A=
#               Modified for RHS Linux by Marc Ewing and Donnie Barnes=0A=
#=0A=
=0A=
# Default runlevel. The runlevels used by RHS are:=0A=
#   0 - halt (Do NOT set initdefault to this)=0A=
#   1 - Single user mode=0A=
#   2 - Multiuser, without NFS (The same as 3, if you do not have =
networking)=0A=
#   3 - Full multiuser mode=0A=
#   4 - unused=0A=
#   5 - X11=0A=
#   6 - reboot (Do NOT set initdefault to this)=0A=
# =0A=
id:3:initdefault:=0A=
=0A=
# System initialization.=0A=
si::sysinit:/etc/rc.d/rc.sysinit=0A=
=0A=
l0:0:wait:/etc/rc.d/rc 0=0A=
l1:1:wait:/etc/rc.d/rc 1=0A=
l2:2:wait:/etc/rc.d/rc 2=0A=
l3:3:wait:/etc/rc.d/rc 3=0A=
l4:4:wait:/etc/rc.d/rc 4=0A=
l5:5:wait:/etc/rc.d/rc 5=0A=
l6:6:wait:/etc/rc.d/rc 6=0A=
=0A=
# Things to run in every runlevel.=0A=
#ud::once:/sbin/update=0A=
=0A=
# Trap CTRL-ALT-DELETE (SIGINT on cygwin)=0A=
#ca::ctrlaltdel:/sbin/shutdown -t3 -r now=0A=
=0A=
# When our UPS tells us power has failed, assume we have a few minutes=0A=
# of power left.  Schedule a shutdown for 2 minutes from now.=0A=
# This does, of course, assume you have powerd installed and your=0A=
# UPS connected and working correctly.  =0A=
#pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting =
Down"=0A=
=0A=
# If power was restored before the shutdown kicked in, cancel it.=0A=
#pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown =
Cancelled"=0A=
=0A=
=0A=
# Run agettys in standard runlevels=0A=
#S0:2345:respawn:/sbin/agetty -L -T vt100 -n ttyS0 9600 ttyS0=0A=
=0A=
# Run xdm in runlevel 5=0A=
# xdm is now a separate service=0A=
#x:5:respawn:/etc/X11/prefdm -nodaemon=0A=
=0A=


------=_NextPart_000_00BC_01C367D7.0CD3C2E0
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
------=_NextPart_000_00BC_01C367D7.0CD3C2E0--


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019