Skip to content
Snippets Groups Projects
Commit 226b63b2 authored by Jupiter Hu's avatar Jupiter Hu
Browse files

fixed nhc mark-online script and added slurm log relotate script

parent 26499945
No related branches found
No related tags found
No related merge requests found
...@@ -154,7 +154,6 @@ class HpcIdInit(): ...@@ -154,7 +154,6 @@ class HpcIdInit():
institute = Institute.objects.get(name = user["institute_name"]) institute = Institute.objects.get(name = user["institute_name"])
if institute: if institute:
person = Person.objects.create(username = user["username"], email = user["email"], password = self.password, short_name = user["short_name"], full_name = user["full_name"], is_admin = True, is_active = True, institute = institute) person = Person.objects.create(username = user["username"], email = user["email"], password = self.password, short_name = user["short_name"], full_name = user["full_name"], is_admin = True, is_active = True, institute = institute)
person.full_clean()
if person: if person:
person.set_password(self.password) person.set_password(self.password)
person.save() person.save()
...@@ -163,6 +162,7 @@ class HpcIdInit(): ...@@ -163,6 +162,7 @@ class HpcIdInit():
log("Add super user %s to institute %s delegate" %(person.username, institute.name)) log("Add super user %s to institute %s delegate" %(person.username, institute.name))
else: else:
log("Faired to add super user %s to institute %s delegate" %(person.username, institute.name)) log("Faired to add super user %s to institute %s delegate" %(person.username, institute.name))
person.full_clean()
except: except:
log("Create super user exception: %s" %(traceback.format_exc())) log("Create super user exception: %s" %(traceback.format_exc()))
finally: finally:
...@@ -194,7 +194,7 @@ class HpcIdInit(): ...@@ -194,7 +194,7 @@ class HpcIdInit():
if self.mc: if self.mc:
mc = self.getOrCreateMachineCategory(self.mc) mc = self.getOrCreateMachineCategory(self.mc)
if mc: if mc:
self.log("Get machine category = '%s'" %(mc.name)) self.log("Get machine category = '%s'" %(self.mc))
else: else:
self.log("Failed to get machine category = '%s'" %(self.mc)) self.log("Failed to get machine category = '%s'" %(self.mc))
if su: if su:
......
...@@ -32,3 +32,8 @@ ...@@ -32,3 +32,8 @@
args: args:
chdir: /tmp/slurm-{{ slurm_version }} chdir: /tmp/slurm-{{ slurm_version }}
creates: "{{ slurm_dir }}/bin/srun" creates: "{{ slurm_dir }}/bin/srun"
- name: add slurm log rotate config
template: src=slurmlog.j2 dest=/etc/logrotate.d/slurm mode=644
sudo: true
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
missingok missingok
notifempty notifempty
weekly weekly
size 200k compress
size 800k
} }
{{ slurmddebug.log }}/slurm*.log
{
compress
missingok
nocopytruncate
nocreate
nodelaycompress
nomail
notifempty
noolddir
rotate 5
sharedscripts
size=5M
create 640 slurm root
{% if slurmctrl == inventory_hostname %}
{% if ansible_os_family == 'RedHat' and ansible_distribution_version >= 7 %}
systemctl restart slurmdbd
{% else %}
postrotate /etc/init.d/slurmdbd reconfig
{% endif %}
{% endif %}
{% if ansible_os_family == 'RedHat' and ansible_distribution_version >= 7 %}
systemctl restart slurmd
{% else %}
postrotate /etc/init.d/slurm reconfig
{% endif %}
endscript
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment