aboutsummaryrefslogtreecommitdiff
path: root/bin/pwait
Commit message (Collapse)AuthorAgeFilesLines
* pwait: Add SPDX-License-Identifier tagsTuukka Pasanen2026-02-181-0/+2
| | | | | | Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55211
* pwait: Add an option to print remaining processesDag-Erling Smørgrav2025-10-283-35/+107
| | | | | | | | | | | * On startup, insert all valid PIDs into a tree. * In our main loop, whenever a process terminates, remove its PID from the tree. * On exit, if the -p flag was specified, print the remaining PIDs. MFC after: 3 days Reviewed by: bcr, markj Differential Revision: https://reviews.freebsd.org/D53293
* pwait: Avoid calling getpid(2) for each proc.Bryan Drewery2025-10-241-1/+3
|
* pwait: Fix timeout unit parserDag-Erling Smørgrav2025-09-231-12/+18
| | | | | | | | | | | The timeout parser would check the first character after the number and ignore any subsequent ones. While here, switch to bool for booleans and fix some style nits. MFC after: 1 week Reviewed by: 0mp, markj Differential Revision: https://reviews.freebsd.org/D52612
* pwait tests: Fix some exit annotationsMark Johnston2025-04-181-6/+6
| | | | | | | | A number of tests rely on timeout(1) to kill a pwait instance, and with --preserve-status the corresponding exit status is propagated to atf_check. Update the checks to reflect this. MFC after: 2 weeks
* Remove residual blank line at start of MakefileWarner Losh2024-07-152-2/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* pwait.1: add missing prompt and command in examplesMike Karels2023-11-271-2/+2
| | | | | Two examples showed '$?' alone on a line, which should be '$ echo $?'. The third example got it right. Fix the first two.
* bin: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-165-5/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+0
|
* Fix typo in pwait.c introduced in 5bdce6ff546eAlexander V. Chernikov2021-01-211-1/+1
| | | | Reported by: kevans
* Remove deadlock in rc caused by pwait waiting for itself.Alexander V. Chernikov2021-01-212-1/+9
| | | | | | | | | | | | | | | | | | | | The following situation can trigger the deadlock: 1) Long time ago a_service was started through rc.d 2) We want to restart a_service and issue service a_service restart 3) rc.subr reads current process PID (via file or process), sends TERM signal and runs pwait with PID harvested 4) a_service process dies very quickly so it's PID becomes available. It is possible that while original process was running, PID counter overflowed and pwait got assigned a_service's PID. This patch ignores pid(s) to wait that are equal to pwait PID. Reported by: Dan McGregor, Boris Lytochkin Submitted by: Boris Lytochkin <lytboris at gmail.com> Reviewed By: 0mp MFC after: 2 weeks PR: 218598 Differential Revision: https://reviews.freebsd.org/D28240
* pwait(1): Add EXAMPLES section to man pageFernando Apesteguía2020-10-051-2/+50
| | | | | | | | | | | | * Add small EXAMPLES section to the man page showing the different flags and exit codes. * Complete description for -v flag. Approved by: manpages (bcr@) Notes: svn path=/head/; revision=366444
* Remove unused include.Xin LI2020-02-021-1/+0
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=357420
* Restore previous usage presentation (without "pwait: " prefix).Pawel Jakub Dawidek2020-02-011-1/+2
| | | | | | | Pointed out by: jilles Notes: svn path=/head/; revision=357362
* Style changes, mostly usage of braces around single line statements -Pawel Jakub Dawidek2020-01-261-21/+34
| | | | | | | | | it is safer and allowed for some time now by style(9). Sponsored by: Fudo Security Notes: svn path=/head/; revision=357143
* Implement tests for the newly added -o flag.Pawel Jakub Dawidek2020-01-261-0/+80
| | | | | | | Sponsored by: Fudo Security Notes: svn path=/head/; revision=357142
* Implement -o flag which tells pwait(1) to exit if any of the given processesPawel Jakub Dawidek2020-01-262-8/+21
| | | | | | | | | has terminated. Sponsored by: Fudo Security Notes: svn path=/head/; revision=357141
* Don't setup a timeout if we are exiting.Pawel Jakub Dawidek2020-01-261-1/+1
| | | | | | | Sponsored by: Fudo Security Notes: svn path=/head/; revision=357140
* Check for duplicated PID without using additional variable.Pawel Jakub Dawidek2020-01-261-11/+12
| | | | | | | Sponsored by: Fudo Security Notes: svn path=/head/; revision=357139
* - Be consistent with using sysexits(3) codes.Pawel Jakub Dawidek2020-01-261-6/+5
| | | | | | | | | - Turn fprintf()+exit() into errx(). Sponsored by: Fudo Security Notes: svn path=/head/; revision=357138
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Add HAS_TESTS to all Makefiles that use the SUBDIR.${MK_TESTS}+= tests idiomEnji Cooper2017-08-021-0/+1
| | | | Notes: svn path=/projects/make-check-sandbox/; revision=321911
* Rename some tests to end in _test.Bryan Drewery2017-03-092-1/+1
| | | | | | | | | Requested by: ngie MFC after: 2 weeks X-MFC-With: r314886 Notes: svn path=/head/; revision=314944
* Remove unneeded -x from tests.Bryan Drewery2017-03-091-22/+22
| | | | | | | | | Reported by: ngie MFC after: 2 weeks X-MFC-With: r314886 Notes: svn path=/head/; revision=314943
* pwait: Add a -t flag to specify a timeout before exiting, and tests.Bryan Drewery2017-03-076-11/+347
| | | | | | | | | | | The exit status will be 124, as the timeout(1) utility uses. Reviewed by: jilles MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D9697 Notes: svn path=/head/; revision=314886
* Explicitly add unmarked bin/ binaries to the runtime package.Glen Barber2016-02-091-0/+1
| | | | | | | | | | | Note: tcsh(1) has a MK_TCSH=no test, so this should be a separate package, which requires pre-install/post-install scripts, to be added later. Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295439
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * Sync with HEAD.David E. O'Brien2013-02-081-1/+1
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=246555
| * Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | Use a different way to silence clang analyzer as done in r245494 byXin LI2013-01-161-2/+1
| | | | | | | | | | | | | | | | | | explicitly telling the compiler that we are on the exit route. X-MFC: together with r245494 Notes: svn path=/head/; revision=245506
* | Free memory before exiting in order to silence a warning from the clangEitan Adler2013-01-161-0/+1
|/ | | | | | | | | | static analyzer Approved by: cperciva MFC after: 3 days Notes: svn path=/head/; revision=245494
* Remove trailing whitespace per mdoc lint warningEitan Adler2012-03-291-1/+1
| | | | | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days Notes: svn path=/head/; revision=233648
* Remove superfluous paragraph macro.Joel Dahl2012-03-251-1/+0
| | | | Notes: svn path=/head/; revision=233457
* mdoc: order prologue macros consistently by Dd/Dt/OsUlrich Spörlein2010-04-141-1/+1
| | | | | | | | | | | Although groff_mdoc(7) gives another impression, this is the ordering most widely used and also required by mdocml/mandoc. Reviewed by: ru Approved by: philip, ed (mentors) Notes: svn path=/head/; revision=206622
* Add pwait utility, which waits for any process to terminate.Jilles Tjoelker2009-11-173-0/+228
This is similar to the Solaris utility of the same name. Some use cases: * rc.subr's wait_for_pids * interactive use, e.g. to shut down the computer when some task is done even if the task is already running Discussed on: hackers@ Notes: svn path=/head/; revision=199458