1. 03 Mar, 2018 1 commit
  2. 02 Mar, 2018 1 commit
    • Masatake YAMATO's avatar
      pidof: allow to change a separator put between pids · 73492b18
      Masatake YAMATO authored
      I frequency use pidof command with strace system call tracer.
      strace can trace MULTIPLE processes specified with "-p $PID"
      arguments like:
      
      	  strace -p 1 -p 1030 -p 3043
      
      Sometimes I want to do as following
      
      	  strace -p $(pidof httpd)
      
      However, above command line doesn't work because -p option
      is needed for specifying a pid. pidof uses a whitespace as
      a separator. For passing the output to strace, the separator
      should be replaced with ' -p '.
      
      This maybe not a special to my use case.
      
      This commit introduces -S option that allows a user to specify a
      separator the one wants.
      
          $ ./pidof bash
          ./pidof bash
          24624 18790 12786 11898 11546 10766 7654 5095
          $ ./pidof -S ',' bash
          ./pidof -S ',' bash
          24624,18790,12786,11898,11546,10766,7654,5095
          $ ./pidof -S '-p ' bash
          ./pidof -S '-p ' bash
          24624-p 18790-p 12786-p 11898-p 11546-p 10766-p 7654-p 5095
          $ ./pidof -S ' -p ' bash
          ./pidof -S ' -p ' bash
          24624 -p 18790 -p 12786 -p 11898 -p 11546 -p 10766 -p 7654 -p 5095
          $ strace -p $(./pidof -S ' -p ' bash)
          strace -p $(./pidof -S ' -p ' bash)
          strace: Process 24624 attached
          strace: Process 18790 attached
          strace: Process 12786 attached
          ...
      Signed-off-by: 's avatarMasatake YAMATO <yamato@redhat.com>
      73492b18
  3. 14 Oct, 2013 1 commit
  4. 10 Oct, 2013 1 commit
    • Jaromir Capik's avatar
      pidof: reimplemented from scratch (replacing sysvinit pidof) · afe862eb
      Jaromir Capik authored
      As the sysvinit becomes obsolete, some of the bundled tools
      need to find a new home. The procps-ng project seems to be
      the most suitable project for adopting the pidof tool.
      This commit introduces a redesigned version of pidof
      that satisfies the LSB requirements.
      In corner cases the behaviour might differ from the former
      one as the new version doesn't use any stat(2) calls.
      afe862eb