Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jan 2001 21:39:24 +0200
From:      Peter Pentchev <roam@orbitel.bg>
To:        Allen Edwards <aedwards@hiqinternet.com>
Cc:        freebsd-security@FreeBSD.ORG
Subject:   Re: Newbie Post - Limiting processes
Message-ID:  <20010125213924.E1122@ringworld.oblivion.bg>
In-Reply-To: <NCBBKJBPKLMFELAPAEHGAEMCCCAA.aedwards@hiqinternet.com>; from aedwards@hiqinternet.com on Thu, Jan 25, 2001 at 02:26:52PM -0500
References:  <20010125211418.B1122@ringworld.oblivion.bg> <NCBBKJBPKLMFELAPAEHGAEMCCCAA.aedwards@hiqinternet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 25, 2001 at 02:26:52PM -0500, Allen Edwards wrote:
> Thank you all kindly.  I am the kind of newbie who has a few brain cells
> left, and little hints like a file existing called "login.conf" and the man
> works on it was a great help.  Also thanks for the tips here, I had it set
> for 2 and might bump it up to 5.
> 
> I got the idea of background process from a web-site that sells shell
> accounts.
> 
> http://www.digital-galaxy.net/index2.htm
> 
> They sell based on HDD space as well as background processes.
> 
> Thanks again for everyone's help.

An additional point.

You can limit the number of background processes with some daemon
which wakes up periodically, then either does a ps, or uses libkvm
to gather process info, and looks for such.  It's something that's
not too hard to do in Perl.. there are some race conditions to bear
in mind, but writing a mostly-working version won't be too hard.

You might also want to do something like:

	find /tmp/screens -type s -ls

and add this to the background processes' number.  This is a quite
commonly used trick - running processes inside a detached screen
session.  How to detect *which* processes are actually run within
that particular session.. well, the filename of the screen socket
is easily parseable into a pid - in the already-built process tree,
look for children of that pid, and add *them*, too, to the backgnd
processes you might want to kill.

<PLUG> For a very primitive example of building a process tree
in a Perl script, look at the sysutils/pslist port. </PLUG>

G'luck,
Peter

-- 
This inert sentence is my body, but my soul is alive, dancing in the sparks of your brain.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-security" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010125213924.E1122>