Skip to content
Permalink
Browse files

Use killall instead of ps | grep | kill

  • Loading branch information...
ndmckinley authored and riccardomurri committed Mar 1, 2019
1 parent 2b5a080 commit eb080893a1cbebda56dd1398f1b808e7f09309cd
Showing with 2 additions and 9 deletions.
  1. +2 −9 elasticluster/share/playbooks/roles/slurm-resume.yml
@@ -28,16 +28,9 @@
path: /var/run/slurm-llnl
state: directory
when: 'is_debian_compatible and (is_debian_8_or_later or is_ubuntu_15_10_or_later)'

- name: Get running slurm processes
shell: "ps -ef | grep -v grep | grep -w slurmd | awk '{print $2}'"
register: running_slurm
when: 'is_debian_compatible and (is_debian_8_or_later or is_ubuntu_15_10_or_later)'
- name: Kill running slurm processes
shell: "kill -9 {{ item }}"
with_items: "{{ running_slurm.stdout_lines }}"
- name: Kill any running slurm processes
shell: "killall -w -g slurmd"
when: 'is_debian_compatible and (is_debian_8_or_later or is_ubuntu_15_10_or_later)'

- systemd:
name: slurmd
state: started

0 comments on commit eb08089

Please sign in to comment.
You can’t perform that action at this time.