Re: dh_installinit

2007-11-12 Thread Martijn van Oosterhout
On Nov 12, 2007 11:00 PM, Arthur de Jong <[EMAIL PROTECTED]> wrote: > Anyone have a better way to detect the highest open file descriptor > (preferably something that also works inside a chroot jail that does not > have /proc mounted)? NetBSD seems to have fcntl(F_MAXFD) that should do > the trick,

Re: dh_installinit

2007-11-12 Thread Arthur de Jong
On Mon, 2007-11-12 at 12:34 -0600, Steve Greenland wrote: > On 11-Nov-07, 14:25 (CST), Arthur de Jong <[EMAIL PROTECTED]> wrote: > > This seems to be quite common code (from one of my packages (cvsd), > > don't know what the original source for this code was): > > > > m=sysconf(_SC_OPEN_MAX);

Re: dh_installinit

2007-11-12 Thread Steve Greenland
On 11-Nov-07, 14:25 (CST), Arthur de Jong <[EMAIL PROTECTED]> wrote: > > This seems to be quite common code (from one of my packages (cvsd), > don't know what the original source for this code was): > > m=sysconf(_SC_OPEN_MAX); > for (i=0;i close(i); > > There are hurd packages for this

Re: dh_installinit

2007-11-11 Thread Michal Čihař
Hi On Sun, 11 Nov 2007 20:31:55 -0700 Tim Spriggs <[EMAIL PROTECTED]> wrote: > Is there no way of listing open file handles within a process? It seems > like there should be a better way. If the kernel knows what file handles > exist (and lsof can get the info) then what's stopping a process fr

Re: dh_installinit

2007-11-11 Thread Tim Spriggs
Russ Allbery wrote: Steve Langasek <[EMAIL PROTECTED]> writes: On Sun, Nov 11, 2007 at 09:25:11PM +0100, Arthur de Jong wrote: This seems to be quite common code (from one of my packages (cvsd), don't know what the original source for this code was): m=sysconf(_SC_OP

Re: dh_installinit

2007-11-11 Thread Russ Allbery
Steve Langasek <[EMAIL PROTECTED]> writes: > On Sun, Nov 11, 2007 at 09:25:11PM +0100, Arthur de Jong wrote: >> This seems to be quite common code (from one of my packages (cvsd), >> don't know what the original source for this code was): >> m=sysconf(_SC_OPEN_MAX); >> for (i=0;i> close(i

Re: dh_installinit

2007-11-11 Thread Steve Langasek
On Sun, Nov 11, 2007 at 09:25:11PM +0100, Arthur de Jong wrote: > On Sun, 2007-11-11 at 11:04 +0100, Vincent Danjean wrote: > > When these mechanisms will be ready, a deamon will be unable to close > > all its file descriptors (unless it closes the whole range of fd > > (0--2^16 ?) or unless an ap

Re: dh_installinit

2007-11-11 Thread Arthur de Jong
On Sun, 2007-11-11 at 11:04 +0100, Vincent Danjean wrote: > When these mechanisms will be ready, a deamon will be unable to close > all its file descriptors (unless it closes the whole range of fd > (0--2^16 ?) or unless an application can get a list of its open fds). This seems to be quite commo

Re: dh_installinit

2007-11-11 Thread Russ Allbery
Manoj Srivastava <[EMAIL PROTECTED]> writes: > I would agree that no entity should be passing open file > descriptors off to other processes unless this is deliberate, and in > that case a proper policy has been written for it. Okay, I think we're in agreement there. The only open que

Re: dh_installinit

2007-11-11 Thread Russ Allbery
Vincent Danjean <[EMAIL PROTECTED]> writes: > I agree, too. If I remember correctly, there has been discussion in libc > and/or kernel to be able to open files with random high-numbered file > descriptors. When these mechanisms will be ready, a deamon will be > unable to close all its file descrip

Re: dh_installinit

2007-11-11 Thread Vincent Danjean
Manoj Srivastava wrote: > On Sat, 10 Nov 2007 23:45:01 -0800, Russ Allbery <[EMAIL PROTECTED]> said: >> I'd say that passing the open debconf file descriptor to the >> daemon is wrong regardless of whether the daemon closes it or not. > > Yes. I agree, too. If I remember correctly, there

Re: dh_installinit

2007-11-11 Thread Manoj Srivastava
On Sat, 10 Nov 2007 23:45:01 -0800, Russ Allbery <[EMAIL PROTECTED]> said: > Manoj Srivastava <[EMAIL PROTECTED]> writes: >> Wearing my SELinux hat on, I find that daemons not closing file >> descriptors when forking children result in a large number of AVC >> denied messages. Of course, someti

Re: dh_installinit

2007-11-10 Thread Russ Allbery
Manoj Srivastava <[EMAIL PROTECTED]> writes: > On Fri, 09 Nov 2007 10:03:40 -0800, Russ Allbery <[EMAIL PROTECTED]> said: >> Those file descriptor close loops are somewhat controversial. Not >> everyone agrees that they're a good idea, and some upstreams will push >> back on doing it. I find th

Re: dh_installinit

2007-11-10 Thread Manoj Srivastava
On Fri, 09 Nov 2007 10:03:40 -0800, Russ Allbery <[EMAIL PROTECTED]> said: > Petter Reinholdtsen <[EMAIL PROTECTED]> writes: >> This might work, but the correct fix is to get the daemon to close >> all file descriptors when it daemonizes. > Those file descriptor close loops are somewhat controve

Re: dh_installinit

2007-11-09 Thread Russ Allbery
Petter Reinholdtsen <[EMAIL PROTECTED]> writes: > [Russ Allbery] >> Those file descriptor close loops are somewhat controversial. Not >> everyone agrees that they're a good idea, and some upstreams will push >> back on doing it. I find them a bit dubious myself; there are various >> hacks that,

Re: dh_installinit

2007-11-09 Thread Petter Reinholdtsen
[Russ Allbery] > Those file descriptor close loops are somewhat controversial. Not > everyone agrees that they're a good idea, and some upstreams will > push back on doing it. I find them a bit dubious myself; there are > various hacks that, while hacks, come in very handy but are broken > by da

Re: dh_installinit

2007-11-09 Thread Russ Allbery
Petter Reinholdtsen <[EMAIL PROTECTED]> writes: > This might work, but the correct fix is to get the daemon to close all > file descriptors when it daemonizes. Those file descriptor close loops are somewhat controversial. Not everyone agrees that they're a good idea, and some upstreams will push

Re: dh_installinit

2007-11-09 Thread Petter Reinholdtsen
[Sylvain Garcia] > Thanks all for your answer, It's work. > > I have modify my init script with [pathToTheScriptDaemon] 3> /dev/null This might work, but the correct fix is to get the daemon to close all file descriptors when it daemonizes. Happy hacking, -- Petter Reinholdtsen -- To UNSUBS

Re: dh_installinit

2007-11-08 Thread Sylvain Garcia
Russ Allbery wrote: Sylvain Garcia <[EMAIL PROTECTED]> writes: Thanks for your anwswer How verify if the the program start by init script wait an entry on standard input; because when use init y hand this script work perfectly. Ah, hm. This may be a different problem, then. Some daemons

Re: dh_installinit

2007-11-07 Thread Russ Allbery
Sylvain Garcia <[EMAIL PROTECTED]> writes: > Thanks for your anwswer > How verify if the the program start by init script wait an entry on > standard input; because when use init y hand this script work perfectly. Ah, hm. This may be a different problem, then. Some daemons don't close file des

Re: dh_installinit

2007-11-07 Thread Stephen Gran
This one time, at band camp, Sylvain Garcia said: > How verify if the the program start by init script wait an entry on standard > input; because when use init y hand this script work perfectly. strace the process - if it is waiting on input, it will be stuck in a read on an fd. Compare that fd t

Re: dh_installinit

2007-11-07 Thread Hamish Moffatt
On Wed, Nov 07, 2007 at 08:59:00PM +0100, Sylvain Garcia wrote: > Selon Russ Allbery <[EMAIL PROTECTED]>: > > Sylvain Garcia <[EMAIL PROTECTED]> writes: > > > I would like package an application for debian and use dh_installinit > > > for install init script, but I have problem. > > > > > dh_instal

Re: dh_installinit

2007-11-07 Thread Sylvain Garcia
Selon Russ Allbery <[EMAIL PROTECTED]>: > Sylvain Garcia <[EMAIL PROTECTED]> writes: > > > I would like package an application for debian and use dh_installinit > > for install init script, but I have problem. > > > dh_installinit has add installation script at the of postint, but when i > > want

Re: dh_installinit

2007-11-07 Thread Mark Brown
On Wed, Nov 07, 2007 at 10:33:58AM -0800, Russ Allbery wrote: > Sounds like a bug in the init script. In particular, it sounds like the > init script is starting some program that's waiting for input on standard > input. This would be bad when the init script is run during system boot > as well.

Re: dh_installinit

2007-11-07 Thread Russ Allbery
Sylvain Garcia <[EMAIL PROTECTED]> writes: > I would like package an application for debian and use dh_installinit > for install init script, but I have problem. > dh_installinit has add installation script at the of postint, but when i > want install my .deb the postinst script take a pause when

Re: dh_installinit and update-rc.d start vs. restart

2005-01-29 Thread W. Borgert
Quoting Henrique de Moraes Holschuh <[EMAIL PROTECTED]>: > File a serious bug against package Y. initscripts have to exit with a > successfull status if the daemon is already running. OK. As this package Y is not (yet) part of Debian, I just changed it: I added --oknodo to start-stop-daemon and

Re: dh_installinit and update-rc.d start vs. restart

2005-01-29 Thread Henrique de Moraes Holschuh
On Sat, 29 Jan 2005, W. Borgert wrote: > config, restarts daemon of Y, finally Y tries to start its > daemon, but fails, as it already runs. File a serious bug against package Y. initscripts have to exit with a successfull status if the daemon is already running. -- "One disk to rule them all