Skip to main content

Application which scans a list of given pids and determines the executing user

Project description

An application which scans a list of given pids and determines the executing user.

Each line on stdout contains the result, either a username or a uid (if –uid is specified, or a username cannot be determined from a uid), or “unknown” on complete failure (like invalid PID).

Error messages are on the same line, but in stderr, such that any script can use the stdout result and simply check for “unknown” instead of needing to parse the errors.

Usage

Usage: findProcessOwner (options) [pid1] (optional: pid2, pid3)

Prints the owner (account running) processes, given their pids. They are returned one per line on stdout.

Any errors reported go to stderr. If no owner can be determined, stdout will contain “unknown” for that line.

Thus your program can always ensure parsable output by parsing stdout, one-entry per line, and checking for “unknown”.

If a username can not be determined (like user deleted, or uid changed, etc) a pid will be printed.

Options:

--uid Print the UID instead of the username

--version Print the version

Examples:

findProcessOwner 1234

findProcessOwner --uid 1234 3231

Return:

Returns zero if all searches were successful, otherwise non-zero.

Examples

Current shell user:

$] findProcessOwner $$

myuser

Three processes, two invalid:

$] findProcessOwner 12345 $$ 12233

unknown (Could not determine owner of pid 12345)

myuser

unknown (Could not determine owner of pid 12233)

Three processes, two invalid, stderr nullified:

$] findProcessOwner 12345 $$ 12233 2>/dev/null

unknown

myuser

unknown

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

findProcessOwner-1.0.0.tar.gz (10.0 kB view details)

Uploaded Source

File details

Details for the file findProcessOwner-1.0.0.tar.gz.

File metadata

File hashes

Hashes for findProcessOwner-1.0.0.tar.gz
Algorithm Hash digest
SHA256 aba089462e695fa5b28909b49fe6df278a1b1ca30d503db859cb6ca81aa5e920
MD5 2ba98f790c14dfd1ca5dfeeda6258f99
BLAKE2b-256 aea439fe9c0ea85368ed2b7252340733cb603dd4602123b9c29d471624b9e842

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page