Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket support for manage unit and dropin #350

Merged
merged 1 commit into from
Jun 15, 2023

Conversation

traylenator
Copy link
Contributor

Pull Request (PR) description

A socket file can now be created:

systemd::manage_unit{'arc.socket':
  ensure => present,
  unit_entry => {
    'Description' => 'My great socket',
  },
  socket_entry => {
    'Type'         => 'simple',
    'ExecStart'    => '/usr/sbin/arcd /usr/libexec/arcd/arcd.pl',
    'StandardInput => 'socket',

  }

All socket directives from 253.

This Pull Request (PR) fixes the following issues

Fixes #348

A socket file can now be created:

```puppet
systemd::manage_unit{'arc.socket':
  ensure => present,
  unit_entry => {
    'Description' => 'My great socket',
  },
  socket_entry => {
    'Type'         => 'simple',
    'ExecStart'    => '/usr/sbin/arcd /usr/libexec/arcd/arcd.pl',
    'StandardInput => 'socket',

  }
```

All socket directives from 253.

* https://www.freedesktop.org/software/systemd/man/systemd.socket.html
@traylenator traylenator added the enhancement New feature or request label Jun 14, 2023
Copy link
Member

@smortex smortex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@traylenator traylenator merged commit f7ad996 into voxpupuli:master Jun 15, 2023
@traylenator traylenator deleted the socket branch June 15, 2023 06:14
@mplaats
Copy link

mplaats commented Jun 15, 2023

Works perfect! For reference the hiera code used to test the new feature.

systemd::manage_unit:
  'pdnsadmin.socket':
    ensure: present
    unit_entry:
      'Description': 'PowerDNS-Admin socket'
    socket_entry:
      'ListenStream': '/run/pdnsadmin/socket'
    install_entry:
      'WantedBy': 'sockets.target'

# socket_entry => {
# 'ListenStream' => 4241,
# 'Accept' => true,
# 'BindIPv6Only' => 'both',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Late to the party, but I think this is missing a closing }.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request for socket unit files
4 participants