Skip to content

basic management of systemd services (/etc/systemd/system/...)

Notifications You must be signed in to change notification settings

dzmitryv/eyp-systemd

 
 

Repository files navigation

systemd

PRs Welcome

Table of Contents

  1. Overview
  2. Module Description
  3. Setup
  4. Usage
  5. Reference
  6. Limitations
  7. Development

Overview

systemd service support

Module Description

basic systemd support implemented:

  • service definitions
  • logind.conf (disables IPC deletion on user logout)

Setup

What systemd affects

  • Creates service definitions: /etc/systemd/system/${servicename}.service
  • Manages /etc/systemd/logind.conf

Setup Requirements

This module requires pluginsync enabled

Beginning with systemd

basic example from eyp-kibana:

systemd::service { 'kibana':
  execstart => "${basedir}/${productname}/bin/kibana",
  require   => [ Class['systemd'], File["${basedir}/${productname}/config/kibana.yml"] ],
  before => Service['kibana'],
}

Usage

add service dependency:

systemd::service { 'oracleasm':
  description       => 'Load oracleasm Modules',
  after             => 'iscsi.service',
  type              => 'oneshot',
  remain_after_exit => true,
  execstart         => '/usr/sbin/service oracleasm start_sysctl',
  execstop          => '/usr/sbin/service oracleasm stop_sysctl',
  execreload        => '/usr/sbin/service oracleasm restart_sysctl',
}

Reference

classes

systemd

  • removeipc: IPC deletion on user logout (default: no)

defines

systemd::service

  • execstart: command to start daemon
  • execstop: command to stop daemon (if any)
  • restart: restart daemon if crashes (default: always)
  • user: username to use (default: root)
  • group: group to use (default: root)
  • servicename: service name (default: resource's name)
  • forking: expect fork to background (default: false)

Limitations

Should work anywhere, tested on CentOS 7

Development

We are pushing to have acceptance testing in place, so any new feature should have some test to check both presence and absence of any feature

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

basic management of systemd services (/etc/systemd/system/...)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Puppet 53.5%
  • Ruby 22.1%
  • HTML 18.7%
  • Shell 5.7%