Take a look at the following folders:
/Library/StartupItems
~/Library/StartupItems
(if you have one)
/Library/LaunchDaemons
/Library/LaunchAgents
~/Library/LaunchAgents
(if you have one)
You should be able to figure out what the StartupItems
do by name, but Google them if you're curious.
You can figure out exactly what the Launch Daemons and Launch Agents do by peeking inside their plist files. They'll usually contain a path to something, like a software updater.
As for removing the ones you don't want:
If you see something for a program you've deleted or uninstalled, by all means get rid of it.
If you see something for a program you do still have installed, be careful. These startup items can be as unimportant as an autoupdater or compatibility check, but it's entirely possible that the parent app needs the Item, Daemon, or Agent to run.
So, here's my advice: If you see something from an app(s) (or drivers, etc.) you do have installed, check that app's preferences to see if it lets you disable the function that requires the startup item. If it does, go ahead. If it doesn't, it's there for a reason; don't delete it.
If you really want to play with removing apps' startup stuff, do so carefully and at your own risk. Move the folder or plist to your desktop, restart, and test the app thoroughly. Even if you find it works without its startup item/agent/daemon, keep a copy so you can restore it if something goes wrong.
Where are you getting your version of pgrep from?
The version I have from MacPorts is coded such that if you do not supply a pattern it will match all processes even if you have qualifiers such as the -P
option.
When I issue pgrep -P<ppid>
I get a full list of processes. If add a pattern as in pgrep -P<ppid> \.
then it works as expected only providing processes with the given ppid.
As to the behavior difference, maybe you have a couple versions of pgrep on your machine and the jenkins jobs have a different PATH so are finding a different version?
From terminal window you can look for multiple versions with:
mdfind -name pgrep
I also suggest you compare the PATH variable used in the job vs. interactive.
To view which file the shell will use, you can use type -p pgrep
and type -a pgrep
will show all places in the PATH where pgrep can be found.
Best Answer
It does not give you the process name, but it does give you the parent's application name