Open
Conversation
added 4 commits
August 26, 2016 00:06
- log the process tree - log revealer activation - decent to_s method on ProcessInfo
FreeBSD has this to say about the "command" aka "args" output field: > The ps utility first tries to obtain the arguments cached by the kernel > (if they were shorter than the value of the kern.ps_arg_cache_limit > sysctl). The process can change the arguments shown with > setproctitle(3). Otherwise, ps makes an educated guess as to the file > name and arguments given when the process was created by examining > memory or the swap area. The method is inherently somewhat unreliable > and in any event a process is entitled to destroy this information. tl;dr it's gonna give you monkey business instead of actual args sometimes. Rather than try to parse the varying different output formats, just add the "command name" field to provide the ProcessInfo.name attribute in a reliable manner. Switch to using the "args" output field for clarity.
Lsof does not come pre-installed on FreeBSD systems. Instead, we can use `fstat`, an lsof-like tool that comes with the system by default. `fstat` is actually really fast (at least for ptys), so we can skip all the memoization and threading mumbo-jumbo on FreeBSD.
658b928 to
3f773bf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This branch adds basic support for FreeBSD, which is different enough from Linux/macOS that customizations were required. The branch is developed on a FreeBSD 10 server, in a jail. The only supported revealer on FreeBSD is the tmux revealer.
Currently, this branch can reveal a tmux pane, but then crashes afterwards in the
#tmux_client_for_treemethod. Appear dies trying to runlsofagainst a non-existent /dev/pts/1, which is the TTY that tmux reports its client is attached to. This is rather odd -- maybe it has something to do with jails?