pgrep nrpe > /dev/null || /etc/init.d/nagios-nrpe-server start > /dev/null
or using a subshell:
(pgrep nrpe || /etc/init.d/nagios-nrpe-server start) > /dev/null
From the pgrep(1) manpage:
pgrep looks through the currently running processes and lists the process IDs which match the selection criteria to stdout.
If the process name is ...
You need to switch your grep statements. Your second statement to filter out grep will always succeed, because it is always there.
So, first filter out grep and then check for the process:
ps auxw | grep -v grep | grep nrpe > /dev/null || /etc/init.d/nagios-nrpe-server start
According to the Debian package list the binary of the nagios-nrpe-server is ...
That is simple. You would just use After= in the [Unit] section to declare your desired service order. You can see that your existing unit already does this.
Depending on the nature of the dependencies between your services, you may also need to declare Requires= or BindsTo=. See the documentation for their semantics and you will be able to determine if your ...
Since you have installed a deb package, (as per the instructions for installing) type,
dpkg -l protonmail-bridge and press tab to complete the package name. It'll show you all the files and the paths installed by the package.
which protonmail-bridge will immediately show it it if it's in one of the dirs in your $PATH. (This will probably be the case).
If it's not in one of those dirs locate protonmail-bridge will find it fast if your locate-database is up to date (it probably is)
If the database is not up to date it will take a bit longer, you can:
Bring it up to date with sudo ...