Skip to main content
deleted 14 characters in body
Source Link
rjt
  • 397
  • 1
  • 5
  • 15
deleted 14 characters in body
Source Link
muru
  • 77.9k
  • 16
  • 212
  • 317
     
#!/usr/bin/env bash
    echo "pgrep not finding systemd-resolved has bitten many times."
    if [ -z $(pgrep systemd-resolved) ]; then 
      echo -e "systemd-resolved not found by pgrep, trying another way.\n"; 
      ps aux | egrep -i '(DNS|HOST|DH|RESOLV|systemd-resolved)' | egrep -v 'grep -E'; 
    fi;
 
systemd-resolved not found by pgrep, trying another way:    
systemd+     **914**  0.0  0.0  26196  4048 ?        Ss   Nov12   0:02 /lib/systemd/**systemd-resolved**
rjt        73300  0.0  0.0   9228  2160 pts/2    S+   23:02   0:00 grep -E --color=auto -i (DNS|HOST|DH|RESOLV|systemd-resolved)
systemd-resolved not found by pgrep, trying another way:    
systemd+     **914**  0.0  0.0  26196  4048 ?        Ss   Nov12   0:02 /lib/systemd/**systemd-resolved**
rjt        73300  0.0  0.0   9228  2160 pts/2    S+   23:02   0:00 grep -E --color=auto -i (DNS|HOST|DH|RESOLV|systemd-resolved)

I work on many different systems of various age. Need to know the backend name resolution system and what is covered by the name resolver. So I often use pgrep to find all dns related processes.

Appears to be a string length limit for pgrep?

    #!/usr/bin/env bash
    echo "pgrep not finding systemd-resolved has bitten many times."
    if [ -z $(pgrep systemd-resolved) ]; then 
      echo -e "systemd-resolved not found by pgrep, trying another way.\n"; 
      ps aux | egrep -i '(DNS|HOST|DH|RESOLV|systemd-resolved)' | egrep -v 'grep -E'; 
    fi;
 
systemd-resolved not found by pgrep, trying another way:    
systemd+     **914**  0.0  0.0  26196  4048 ?        Ss   Nov12   0:02 /lib/systemd/**systemd-resolved**
rjt        73300  0.0  0.0   9228  2160 pts/2    S+   23:02   0:00 grep -E --color=auto -i (DNS|HOST|DH|RESOLV|systemd-resolved)

I work on many different systems of various age. Need to know the backend name resolution system and what is covered by the name resolver. So I often use pgrep to find all dns related processes.

Appears to be a string length limit for pgrep?

 
#!/usr/bin/env bash
echo "pgrep not finding systemd-resolved has bitten many times."
if [ -z $(pgrep systemd-resolved) ]; then 
  echo -e "systemd-resolved not found by pgrep, trying another way.\n"; 
  ps aux | egrep -i '(DNS|HOST|DH|RESOLV|systemd-resolved)' | egrep -v 'grep -E'; 
fi;
systemd-resolved not found by pgrep, trying another way:    
systemd+     **914**  0.0  0.0  26196  4048 ?        Ss   Nov12   0:02 /lib/systemd/**systemd-resolved**
rjt        73300  0.0  0.0   9228  2160 pts/2    S+   23:02   0:00 grep -E --color=auto -i (DNS|HOST|DH|RESOLV|systemd-resolved)

I work on many different systems of various age. Need to know the backend name resolution system and what is covered by the name resolver. So I often use pgrep to find all dns related processes.

Appears to be a string length limit for pgrep?

Source Link
rjt
  • 397
  • 1
  • 5
  • 15

Why does pgrep not find systemd-resolved?

    #!/usr/bin/env bash
    echo "pgrep not finding systemd-resolved has bitten many times."
    if [ -z $(pgrep systemd-resolved) ]; then 
      echo -e "systemd-resolved not found by pgrep, trying another way.\n"; 
      ps aux | egrep -i '(DNS|HOST|DH|RESOLV|systemd-resolved)' | egrep -v 'grep -E'; 
    fi;

systemd-resolved not found by pgrep, trying another way:    
systemd+     **914**  0.0  0.0  26196  4048 ?        Ss   Nov12   0:02 /lib/systemd/**systemd-resolved**
rjt        73300  0.0  0.0   9228  2160 pts/2    S+   23:02   0:00 grep -E --color=auto -i (DNS|HOST|DH|RESOLV|systemd-resolved)

I work on many different systems of various age. Need to know the backend name resolution system and what is covered by the name resolver. So I often use pgrep to find all dns related processes.

Appears to be a string length limit for pgrep?