Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: prenice(1) problem? Or pilot error?



On Mon, 18 Apr 2016, Ian D. Leroux wrote:

On Mon, 18 Apr 2016 08:15:58 +0800 (PHT) Paul Goyette
<paul%whooppee.com@localhost> wrote:
But when I try to prenice(1) those processes, I get no results:

 	# prenice -l 20 -g 20012
 	#

Shouldn't I expect prenice(1) to show me which processes are being
affected?  And shouldn't that list match the list from pgrep(1)
(modulo any processes which may have been newly created or exited)?

Well, the usual rule is to be silent on success, so I wouldn't
expect any output from prenice(1) if it did what you asked, any more
than pkill(1) outputs the names of the processes it killed.  What's the
exit code?

That said, the manpage is a little confusing, since it tries to
describe the behaviour of pgrep(1) (which must of course give output)
alongside prenice(1) and pkill(1)(which shouldn't, unless something
goes wrong).

The synopsis explicitly lists -l for prenice, and the text says that it produces more detailed info than without the option. I would therefore assume that

1. there is some minimal output without the option, and
2. there is more-than-minimal output with the option.

:)

In any case, I was able to get what I really wanted by

	#  pgrep -g 20012 | xargs renice 20 -p
	15415: old priority 20, new priority 20
	5031: old priority 20, new priority 20
	1964: old priority 20, new priority 20
	7111: old priority 20, new priority 20
	23969: old priority 20, new priority 20
	577: old priority 20, new priority 20
	6604: old priority 20, new priority 20
	4187: old priority 20, new priority 20
	28804: old priority 20, new priority 20
	6691: old priority 20, new priority 20
	16959: old priority 20, new priority 20
	14794: old priority 20, new priority 20
	18504: old priority 20, new priority 20
	20012: old priority 20, new priority 20
	#


+------------------+--------------------------+------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
+------------------+--------------------------+------------------------+


Home | Main Index | Thread Index | Old Index