public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: init and xinetd woes
@ 2003-08-21  9:22 Vince Hoffman
  0 siblings, 0 replies; 5+ messages in thread
From: Vince Hoffman @ 2003-08-21  9:22 UTC (permalink / raw)
  To: 'Jonathan Simms', cygwin

> 
> 
> 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.
^^^^^^^^^^^^^^^^^
Er this could have been a problem, do you mean you ran init-config and said
yes overwrite the /etc/rc and /etc/inittab ?
if so try reinstalling init-scripts, as the defaults created by init-config
are very basic defaults.


> 
> /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/
> 

--
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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: init and xinetd woes
@ 2003-08-22  2:13 Jonathan Simms
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Simms @ 2003-08-22  2:13 UTC (permalink / raw)
  To: cygwin

Thank you so much!

that really did the trick.

-Jonathan

----- Original Message -----
From: "Bill C. Riemers" <cygwin@docbill.net>
To: "Jonathan Simms" <jonathan@embassynetworks.com>; <cygwin@cygwin.com>
Sent: Thursday, August 21, 2003 11:26 AM
Subject: Re: init and xinetd woes


> 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@embassynetworks.com>
> To: <cygwin@cygwin.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/
> >
>


----------------------------------------------------------------------------
----


> --
> 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/



--
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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: init and xinetd woes
  2003-08-21  9:18 Jonathan Simms
@ 2003-08-21 16:42 ` Bill C. Riemers
  0 siblings, 0 replies; 5+ messages in thread
From: Bill C. Riemers @ 2003-08-21 16:42 UTC (permalink / raw)
  To: Jonathan Simms, cygwin

[-- Attachment #1: Type: text/plain, Size: 3969 bytes --]

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@embassynetworks.com>
To: <cygwin@cygwin.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/
>

[-- Attachment #2: xinetd.conf --]
[-- Type: application/octet-stream, Size: 314 bytes --]

#
# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/

defaults
{
	instances               = 60
        log_type                = FILE /var/log/servicelog
        log_on_success		= HOST PID
        log_on_failure		= HOST
	cps			= 25 30
}

includedir /etc/xinetd.d


[-- Attachment #3: init.sh --]
[-- Type: application/octet-stream, Size: 315 bytes --]

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

[-- Attachment #4: inittab --]
[-- Type: application/octet-stream, Size: 1689 bytes --]

#
# inittab       This file describes how the INIT process should set up
#               the system in a certain run-level.
#
# Author:       Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
#               Modified for RHS Linux by Marc Ewing and Donnie Barnes
#

# Default runlevel. The runlevels used by RHS are:
#   0 - halt (Do NOT set initdefault to this)
#   1 - Single user mode
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
#   3 - Full multiuser mode
#   4 - unused
#   5 - X11
#   6 - reboot (Do NOT set initdefault to this)
# 
id:3:initdefault:

# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6

# Things to run in every runlevel.
#ud::once:/sbin/update

# Trap CTRL-ALT-DELETE (SIGINT on cygwin)
#ca::ctrlaltdel:/sbin/shutdown -t3 -r now

# When our UPS tells us power has failed, assume we have a few minutes
# of power left.  Schedule a shutdown for 2 minutes from now.
# This does, of course, assume you have powerd installed and your
# UPS connected and working correctly.  
#pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"

# If power was restored before the shutdown kicked in, cancel it.
#pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"


# Run agettys in standard runlevels
#S0:2345:respawn:/sbin/agetty -L -T vt100 -n ttyS0 9600 ttyS0

# Run xdm in runlevel 5
# xdm is now a separate service
#x:5:respawn:/etc/X11/prefdm -nodaemon



[-- Attachment #5: Type: text/plain, Size: 218 bytes --]

--
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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: init and xinetd woes
@ 2003-08-21 12:38 Brian.Kelly
  0 siblings, 0 replies; 5+ messages in thread
From: Brian.Kelly @ 2003-08-21 12:38 UTC (permalink / raw)
  To: cygwin





> 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


init is HYPER sensitive to the owner and group settings on the /var
directory.

To *just* get it working, try this:

      chown -R SYSTEM:None /var

Better security can be had with this depending on the group membership of
the
SYSTEM user:

      chown -R SYSTEM:Administrators /var

Or - if you've created a custom user, like "root":

      chown -R root:Administrators /var

Make sure that the *user* init is configured to use has write permissions:

      chmod -R 755 /var

If you want the group to have write permissions as well:

      chmod -R 775 /var

Also, consult the archives for previous discussions (like this one)

      http://sources.redhat.com/ml/cygwin/2003-08/msg00440.html


Enjoy,

Brian Kelly

(Oh - and yes - the error messages *SUCK* - obviously created for the
developers use and *not* end-users. A big PET PEEVE of mine - the
developer's ultimate revenge against the dreaded demanding and *ungrateful*
user. Actually, it's a sin of "omission" - but a sin nevertheless. Of
course they'll all cry overworked, underpaid (or not paid as the case
certainly is here - unless you work for Red Hat), "don't like it - do it
yourself", *&%$ YOU!:

      http://sources.redhat.com/ml/cygwin/2003-08/msg00454.html

etc etc. But alas - it is what it is ... I've always found the notion that
"complaints" == "ungrateful" and that I or anyone else should "thankfully"
accept whatever is created - even if takes 10 wasted hours from our lives
that could have been prevented with ten or fifteen minutes worth of effort
by the developer - *without complaint* to be a bunch of HOOEY! Add up your
ten hours, my ten hours, and the ten hours of all those before and after
and this *sin of omission* becomes quite glaring)





"WellChoice, Inc." made the following
 annotations on 08/21/2003 07:30:48 AM
------------------------------------------------------------------------------
Attention!  This electronic message contains information that may be legally
confidential and/or privileged.  The information is intended solely for the
individual or entity named above and access by anyone else is unauthorized.
If you are not the intended recipient, any disclosure, copying, distribution,
or use of the contents of this information is prohibited and may be unlawful.
If you have received this electronic transmission in error, please reply
immediately to the sender that you have received the message in error, and
delete it. Release/Disclosure Statement


--
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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* init and xinetd woes
@ 2003-08-21  9:18 Jonathan Simms
  2003-08-21 16:42 ` Bill C. Riemers
  0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Simms @ 2003-08-21  9:18 UTC (permalink / raw)
  To: cygwin

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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-08-22  0:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-21  9:22 init and xinetd woes Vince Hoffman
  -- strict thread matches above, loose matches on Subject: below --
2003-08-22  2:13 Jonathan Simms
2003-08-21 12:38 Brian.Kelly
2003-08-21  9:18 Jonathan Simms
2003-08-21 16:42 ` Bill C. Riemers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).