Limit resources for a given program
steve at sohara.org
Tue Jan 23 10:23:21 UTC 2018
On Tue, 23 Jan 2018 12:40:17 +0700
Olivier <Olivier.Nicole at cs.ait.ac.th> wrote:
> Is there a way, in FreeBSD, to limit the clocktime for a given command?
> I use LibreOffice to automatically convert many types of documents to
> PDF. When it is an HTML document with external links, it will run
> indefinitely, trying to access the external resources. It will not use
> much CPU but mostly sits idled, so limits(8) -t is not the solution, nor
> is rctl(8) that needs a process ID (but I only have the command name) or
> a user ID (but I don't want to limit a user, just that program).
> Any idea how I can solve that?
Something like this (untested) should do the trick:
libreoffice "$@" &
rctl -a process:$$:wallclock:sigterm=3600
Steve O'Hara-Smith <steve at sohara.org>
More information about the freebsd-questions