ncsa / puppet-profile_influxdb

NCSA Common Puppet Profiles - configure InfluxDB service
0 stars 0 forks source link

Adjust systems service config from forking to simple #4

Open billglick opened 2 weeks ago

billglick commented 2 weeks ago

From JD:

My change that took care of things was in /usr/lib/systemd/system/influxdb.service I changed the Type from forking to simple and that took care of it. Systemd was otherwise cutting off the DB restart at 88 seconds when it needed 179 seconds to do the job

inwho commented 1 week ago

Would it be ok to include a puppet/systemd dependency to make this change or am I going about this the wrong way?

I was thinking of something like adding a drop-in file to override the service Type to simple

systemd::manage_dropin { 'influxdb.conf':
      ensure            =>  present,
      unit              => $service_name,
      service_entry     => {
           'Type'       => 'simple'
      }
}
billglick commented 1 week ago

I think you are on the right track there, but I'm not really sure how to use the systemd module to do what you want.

I know @jakerundall has some experience with using systemd::dropin_files to create/update the slurmdbd.service to run as a specific user. See the following in almost any project control repo:

systemd::dropin_files:
  slurmdbd-user.conf:
    unit: "slurmdbd.service"
    content: |
      # File managed by Puppet
      [Service]
      User=slurm
    notify_service: true

Perhaps that can be used as a template?

We would need to test this, but MS Copilot suggested the following should work:

systemd::dropin_file { 'influxdb-override.conf':
  unit     => 'influxdb.service',
  content  => "[Service]\nType=simple\n",
  notify   => Service['influxdb'],
}

That could either be added into this module, or added to the project's control repo as:

systemd::dropin_files:
  influxdb-override.conf:
    unit: "influxdb.service"
    content: |
      # File managed by Puppet
      [Service]
      Type=simple
    notify_service: true