Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a262b60d3f718305

Jump to content

Wikipedia:Reference desk/Archives/Computing/2017 October 9

From Wikipedia, the free encyclopedia
Computing desk
< October 8 << Sep | October | Nov >> Current desk >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


October 9

[edit]

Runtime Limit

[edit]

What is the best way to set a runtime limit on a process in Linux? If the cronjob foobar.sh doesn't finish within an hour I want it to be killed. Dragons flight (talk) 17:54, 9 October 2017 (UTC)reply

One way is to use the timeout command; for example
timeout 3600 foobar.sh
will send SIGTERM to the foobar.sh process after it has been running for one hour. But you need to make sure that foobar.sh exits cleanly when it receives SIGTERM. CodeTalker (talk) 19:55, 9 October 2017 (UTC)reply
Note that this limits the amount of elapsed time, not CPU time. StuRat (talk) 00:09, 10 October 2017 (UTC)reply
Thanks. Dragons flight (talk) 04:13, 10 October 2017 (UTC)reply
To limit CPU time, use ulimit, which is a bash built-in; for example
ulimit -t 3600; foobar.sh
--69.159.60.147 (talk) 02:10, 10 October 2017 (UTC)reply