Skip to content

Commit

Permalink
systemd start/stop and enable/disable
Browse files Browse the repository at this point in the history
These changes use systemd stop/start commands to facilitate the
stop/start of the slurmctld daemon and remove the --now flag from
the enable and disable commands..
  • Loading branch information
jamesbeedy committed Dec 4, 2024
1 parent 274fc85 commit cb2ba57
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions charms/slurmctld/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,12 @@ def _on_install(self, event: InstallEvent) -> None:
self._stored.jwt_rsa = self._slurmctld.jwt.get()
self._slurmctld.munge.key.generate()
self._stored.munge_key = self._slurmctld.munge.key.get()
self._slurmctld.munge.service.restart()
self._slurmctld.service.restart()
self._slurmctld.munge.service.enable()
self._slurmctld.munge.service.start()
self._slurmctld.service.enable()
self._slurmctld.service.start()
self._slurmctld.exporter.service.enable()
self._slurmctld.exporter.service.start()
self.unit.set_workload_version(self._slurmctld.version())

self.slurm_installed = True
Expand Down Expand Up @@ -236,7 +239,7 @@ def _on_write_slurm_conf(
return

if slurm_config := self._assemble_slurm_conf():
self._slurmctld.service.disable()
self._slurmctld.service.stop()
self._slurmctld.config.dump(slurm_config)

# Write out any cgroup parameters to /etc/slurm/cgroup.conf.
Expand All @@ -246,7 +249,7 @@ def _on_write_slurm_conf(
cgroup_config.update(user_supplied_cgroup_params)
self._slurmctld.cgroup.dump(CgroupConfig(**cgroup_config))

self._slurmctld.service.enable()
self._slurmctld.service.start()
self._slurmctld.scontrol("reconfigure")

# Transitioning Nodes
Expand Down

0 comments on commit cb2ba57

Please sign in to comment.