Add new command line options -e, --echo to display what is
killed. Cost of this change is greater run time memory footprint,
because an union had to be changed to struct to allow name and
pid printing which what I as an user would expect to see in
verbose kill output.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
pgrep.c:786:4: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'int' [-Wformat]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Print correct pid number of process that was where not killed
because of kill was not successful. Incorrect behaviour before
this fix is bello.
-- snip
$ ps -elf | grep dh[c]
1 S root 1409 1 0 80 0 - 1782 poll_s 02:01 ? 00:00:00 dhclient wlan0
$ pkill dhc
pkill: killing pid 1 failed: Operation not permitted
-- snip
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Strings with lower caps & no trailing dots have greater change to
have multiple occurences, meaning less effort for translators, than
strings with them.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The catastrophic_failure function tries to make bug reporting useful
by telling in which line error occured, and drops core.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit addresses a long standing buglet (debian #441166) which
surfaces when the display mode is switched between task and threads.
An extra procps refresh is now forced upon such a transition which
parallels the approach used at startup for the exact same reason.
Reference: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=441166
The dejagnu tests for slabtop are skipped when "/proc/slabinfo" is
unreadable due to permissions. This commit provides the same check
for vmstat under its -m (slabinfo) option.
The man page has examples like sysctl -p filename. Optional arguments
using getopt cannot have a space between the option and argument.
So the correct format is sysctl -pfilename
Ps command does not display the nice value for processes with the SCHED_BATCH
scheduler policy, only for SCHED_OTHER.
Boinc (http://boinc.berkeley.edu/) client runs project processing jobs on
Linux using SCHED_BATCH scheduler policy and nice value 19. The nice value
is not displayable by ps.
Steps to Reproduce:
1. Run process using SCHED_BATCH scheduler policy with nice value.
./test-schedbatch 18 &
2. Display process details:
ps -o pid,ppid,user,comm,cls,nice
Results before:
[mike@rockover c]$ ps -o pid,ppid,user,comm,cls,nice
PID PPID USER COMMAND CLS NI
18205 2540 mike bash TS 0
20552 18205 mike test-schedbatch B -
20553 18205 mike ps TS 0
[mike@rockover c]$ awk '{printf "%5d %-17s %1d %2d\n", $1, $2, $41, $19}'
/proc/20552/stat
20552 (test-schedbatch) 3 18
Results after this patch:
[mike@rockover c]$ ps -o pid,ppid,user,comm,cls,nice
PID PPID USER COMMAND CLS NI
18205 2540 mike bash TS 0
20552 18205 mike test-schedbatch B 18
20553 18205 mike ps TS 0
Additional info: Here is the fragment from the sched_setscheduler(2) manual
page on the subject:
SCHED_BATCH: Scheduling batch processes
(Since Linux 2.6.16.) SCHED_BATCH can only be used at static
priority 0. This policy is similar to SCHED_OTHER in that it
schedules the process according to its dynamic priority (based on the
nice value). The difference is that this policy will cause the
scheduler to always assume that the process is CPU-intensive.
Consequently, the scheduler will apply a small scheduling penalty with
respect to wakeup behaviour, so that this process is mildly disfavored
in scheduling decisions.
This policy is useful for workloads that are noninteractive, but do
not want to lower their nice value, and for workloads that want a
determin- istic scheduling policy without interactivity causing extra
preemptions (between the workload's tasks).
Reference: https://bugzilla.redhat.com/show_bug.cgi?id=741090
Acked-by: Jaromir Capik <jcapik@redhat.com>
Acked-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Mike Fleetwood <mike.fleetwood@googlemail.com>
On non-linux systems, uts.version provides the version of that
specific kernel (FreeBSD or Hurd version, for example) and not the
emulated procfs pseudo version.
On those systems we need to directly read /proc/version and parse the
string. This change replaces Debian patches gnu-kbsd-version and
complain_unmounted_proc patches.
procps automake defines restrict which means the binaries for procps
binaries compile. However external programs may not of defined
restrict which means they will not complie if they include files found
in /usr/include/proc.
Includes from libc6 use __restrict and if is good enough for
them, its good enough for us.
Makes Debian patch makefile_watch_ncurses redundant.
watch was being linked to NCURSES_LIBS when it should of been
WATCH_NCURSES_LIBS which can be ncursesw with 8bit enabled.
Even as conservative project as coreutils has switched to xz distributions so
neither should we have any reason to use gz and waste space & bandwidth.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Change information submission address to be procps@freelists.org and
instruct people to send patches in 'git am' friendly format.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The option -f used too print `-' to FROM column when host was not
known. This commit changes behaviour back to what it was earlier.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The patch also has other maintenance fixes, such as man header fixes,
high lighting corrections and add bug report address.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Commit 0ac63f5bc1 messed up header
print order; the Total Slabs and Total Caches where reported in place
of each other.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This change allows user to see what was the last message before exit
on error, and when where the last update.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Bug-Debian: http://bugs.debian.org/654368
On systems with very large amonut of RAM when they use the -b or --bytes
option on free you get overflow and free shows a negative amount of
memory, which is obviously wrong.
The handling of the -c (count) option in free uses the standard string
handling and error utils. The program also checks for negative counts
and errors on these.
The -e option would print a confusing error message. This is because
most error messages in watch are one word. This fix makes a more
sensible message about what went wrong.
The -x option exited before the endwin() function was called, so if the
child process died the terminal was left in a funky state. endwin is now
called just before the exit(8) for the -x option.
Some of the latest changes to Makefile.am files are missing.
This patch restores the LOCALEDIR variable, among others,
and dispenses with the include directives in the ps/ and top/
subdirectories since they're no longer needed.
This commit corrects some outdated programmer comments.
Additionally, certain nls justifications might become
increasingly obscure with the passage of time so some
previous nls commit text has been added as comments.