3 ms·
Oh, I see. Okay then. $ pgrep() { for proc in /proc/[0-9]*; do read CMDLINE < $proc/cmdline; if [[ ${CMDLINE/*$1*/x} == x ]]; then echo ${proc#/proc/}; retur
by Hello71 13y ago
Oh, I see. Okay then.
$ pgrep() { for proc in /proc/[0-9]*; do read CMDLINE < $proc/cmdline; if [[ ${CMDLINE/*$1*/x} == x ]]; then echo ${proc#/proc/}; return 0; fi; done; return 1; }
$ kill $(pgrep mysqld)
$ while pgrep mysqld; do sleep 5; done
$ echo s >/proc/sysrq-trigger
$ while sleep 2; do dmesg | tail; done
$ echo b >/proc/sysrq-trigger
- Nursie 13y agoI admire your tenacity, but I think sleep, dmesg and tail are all out as well! Though all could b mitigated by leaving it for a minute or two at the relevant point, and manually checking for the mysql process every so often. I'll keep this on file for next time it happens (though I'm hoping to replace the dodgy parts at the weekend).
- Hello71 13y agogrumble grumble $ pgrep() { for proc in /proc/[0-9]*; do read CMDLINE < $proc/cmdline; if [[ ${CMDLINE/*$1*/x} == x ]]; then echo ${proc#/proc/}; return 0; fi; done; return 1; } $ kill $(pgrep mysqld) $ pgrep mysqld; echo $? $ echo s >/proc/sysrq-trigger $ while read LAST; do; done < /proc/kmsg; echo $LAST $ echo b >/proc/sysrq-trigger
- Nursie 13y agoYou, sir or madam, are awesome and very resourceful. I'll use this one :)