Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Bummer... :-)

    Random thoughts, which may or may not be helpful:

    • Skip the "grep -v grep" step:

      ps afxww |grep 'm[y]_proc_name'|tail --lines=+2|awk '{print$1}'|xargs kill -HUP

    • Replace the whole line with killall (if available):

      killall -HUP 'm[y]_proc_name'

    • Don't wrap commands in doublequotes :-)
    --


    --
    DO NOT LEAVE IT IS NOT REAL.

    • I once thought I could get around the "grep", "grep -v", AND the "tail" by doing:
      ps ... | awk 'NR > 1 && /[m]y_proc_name/{print $1}'
      But (maybe depending on your awk) awk blows up when there's more than 99 fields, and there were often 'ps' lines which had very long command lines. So it was good to filter before piping to awk (or maybe just do the whole thing in perl :).
    • Even better, change: ps afxww |grep 'm[y]_proc_name'|tail --lines=+2|awk '{print$1}'|xargs kill -HUP to ps afxww |grep 'm[y]_proc_name'|tail --lines=+2|awk '{print$1}'|less the first time you run it, and make sure those are the results you expected!
  • that programmers should never be given root...not /ever/. I hope those sysadmins guilt you out of enough beer that you begin to feel queasy the next time you even think about root. :)
    • While that's valid, it's not strictly relevant here as the RPM has to do this, and the programmers have to write the RPM generation code.

      The real issue is it not going through QA (and this happened because the code to build this RPM has been in the QA queue for 6 months and keeps getting overlooked in favour of more important projects).

      It also shows that developers need sleep. I'm very tired right now and not sleeping well and am making stupid decisions because of this.
    • Because, you know, there have never been any sysadmins who've made a mistake while they're working as root :-)