Skip to content

Commit

Permalink
slurmdbd service override
Browse files Browse the repository at this point in the history
These changes add a slurmdbd service override file that creates
a pid directory and changes the permissions to the slurm user.

Fixes: charmed-hpc/slurm-charms#76
  • Loading branch information
jamesbeedy committed Jan 29, 2025
1 parent 865d071 commit aa978be
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/charms/hpc_libs/v0/slurm_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,25 @@ def _apply_overrides(self) -> None:
"""
)
)
case "slurmdbd":
# TODO: https://github.com/charmed-hpc/hpc-libs/issues/39 -
# Make `slurmrestd` package preinst hook create the system user and group
# so that we do not need to do it manually here.
_logger.debug("Creating slurmdbd service override.")
slurmdbd_service_override = Path(
"/etc/systemd/system/slurmdbd.service.d/10-slurmdbd-exec-pre-pid.conf"
)
slurmdbd_service_override.parent.mkdir(exist_ok=True, parents=True)
slurmdbd_service_override.write_text(
textwrap.dedent(
"""
[Service]
ExecPreStart=/bin/mkdir /var/run/slurmdbd
ExecPreStart=/bin/chown slurm /var/run/slurmdbd
PidFile=/var/run/slurmdbd/slurmdbd.pid
"""
)
)
case _:
_logger.debug("'%s' does not require any overrides", self._service_name)

Expand Down

0 comments on commit aa978be

Please sign in to comment.