| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
for the convenience of rc.d. Now it has happily lived there for quite
a while. So move the pkill(1) source files from usr.bin to bin, too.
Approved by: gad
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
wildcard specifications. Earlier the only wildcard syntax
was "-j 0" for "any jail". There were at least
two shortcomings in it: First, jail ID 0 was abused; it
meant "no jail" in other utils, e.g., ps(1). Second, it
was impossible to match processed not in jail, which could
be useful to rc.d developers. Therefore a new syntax is
introduced: "-j any" means any jail while "-j none" means
out of jail. The old syntax is preserved for compatibility,
but now it's deprecated because it's limited and confusing.
Update the respective regression tests. While I'm here,
make the tests more complex but sensitive: Start several
processes, some in jail and some out of jail, so we can
detect that only the right processes are killed by pkill
or matched by pgrep.
Reviewed by: gad, pjd
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This includes fixes and cleanups listed below:
- If a process dissappears while we are signalling it, don't count it as a
match/error.
- Better handling of errors and messages.
- Downgrade failure to kill(2) (other than ESRCH) from fatal error to a
warning; otherwise processing aborts and possibly matching killees would
remain unsignalled. This makes pkill match the Solaris behavior.
- Exit with 2 on usage errors as documented.
Obtained from: NetBSD
Glanced at by: maintainer (gad) [a bit different version of this patch]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
% pgrep <something> [to verify which processes match]
% pkill <something>
To speed such operation up, add -I option which works like rm(1)'s -i
option (unfortunately -i is already used in pkill(1)), ie. pkill will
ask for confirmation before killing each matching process.
After adding -j, -F, -i, -S, -o and -L options and other improvements,
I think I can add myself to the copyright header.
Glanced at by: maintainer (gad)
|
|
|
|
|
|
|
| |
tell pkill(1)/pgrep(1) to try to flock(2) pidfile before reading PID from
there.
Discussed with: jhb, gad
|
|
|
|
| |
an argument has to be locked.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
processes.
This option can be also found in Solaris and Linux.
- Use timercmp(9) macro for timeval comparsion.
- Include time.h directly, don't depend on stat.h doing it for us.
Reviewed by: gad (first point)
MFC after: 3 days
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Rename IS_KERNPROC() macro to PSKIP() and extend its functionality.
Now it'll skip calling process and system processes when -S is not given.
As a side effect it fixes '-n' option. Before it was always matching
calling process (because of missing 'if (kp->ki_pid == mypid)' check)
and after that, calling process was ignored.
- When '-l' option is given and there are no arguments, use p_comm as an
arguments list (this is helpful for kernel threads matching).
Reviewed by: gad
MFC after: 3 days
|
|
|
|
|
|
| |
Obtained from: NetBSD
Reviewed by: gad
MFC after: 3 days
|
|
|
|
|
|
|
| |
for matching.
Reviewed by: gad
MFC after: 3 days
|
|
|
|
|
|
|
| |
jail ID.
Reviewed by: gad
MFC after: 3 days
|
|
|
|
|
|
|
|
|
| |
the first user/group. Caused huge fun in error messages from large script.
Old: pgrep -u root,NoSuchUser,daemon -> pgrep: unknown user `root'
Now: pgrep -u root,NoSuchUser,daemon -> pgrep: unknown user `NoSuchUser'
Obtained from: NetBSD (rev. 1.8)
MFC After: 1 week (if re@ would have approved this)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The big lines are:
NODEV -> NULL
NOUDEV -> NODEV
udev_t -> dev_t
udev2dev() -> findcdev()
Various minor adjustments including handling of userland access to kernel
space struct cdev etc.
|
|
|
|
|
|
| |
so we get one line per process instead of one for each kernel-thread.
Noticed by: ache & tjr
|
|
|
|
|
| |
any better on 4.x than it does on 5.2. If that's true then there
is no point to the __FreeBSD_version check that I had added.
|
|
|
|
| |
Noticed by: bde
|
|
|
|
|
|
| |
man page: The swapfile argument is currently unused.
Noticed by: ru
|
|
|
|
|
|
| |
version isn't going to be committed to that branch...
Noticed by: des
|
|
|
|
|
|
| |
"system processes" to always ignore. Based on my testing with `-D',
I am pretty sure this is what we want for 5.x-current. If my thinking
is wrong, this also makes it easier to switch to a different check.
|
| |
|
|
|
|
| |
(this is a probably temporary option, and is not to be documented)
|
|
|
|
|
|
| |
the "Take the appropriate action" section).
Obtained from: the sysutils/pkill port
|
|
|
|
|
|
| |
needed because off_t == __int64_t, while size_t == __uint64_t. This
also compiles with WARNS=5 on amd64, but I haven't tested the other
platforms yet.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
what are supported in `ps':
-M Extract values associated with the name list from the
specified core instead of the default /dev/kmem.
-N Extract the name list from the specified system instead
of the default /kernel.
Written by: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
Obtained from: the sysutils/pkill port
|
|
|
|
|
|
|
| |
when compiling with WARNS=3
Written by: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
Obtained from: the sysutils/pkill port
|
|
|
|
|
| |
Written by: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
Obtained from: the sysutils/pkill port
|
|
straight from NetBSD (except to add the RCS-ID lines for FreeBSD).
These will probably require a few updates before they are added to
the FreeBSD buildworld. I might MFC these to 4.x-stable after 4.10.
Discussed on: freebsd-arch
Obtained from: NetBSD (and OpenBSD also has these)
|