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

Adjust wants/requires to ensure services run as expected #18

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bakins
Copy link
Contributor

@bakins bakins commented Feb 18, 2015

Can rearrange based on people's unit file layout preferences.

Review on Reviewable

@mmlb
Copy link
Member

mmlb commented Feb 18, 2015

Comments from the review on Reviewable.io

Reviewed files:

  • roles/dhcpd/templates/dhcpd-announce.service.j2 @ r1

roles/dhcpd/templates/dhcpd.service.j2, line 5 [r1] (raw file):
I would think this should be Requires no? If we aren't announcing then what's the point? Ditto for those below.


@bakins
Copy link
Contributor Author

bakins commented Feb 18, 2015

Comments from the review on Reviewable.io


roles/dhcpd/templates/dhcpd.service.j2, line 5 [r1] (raw file):
There's a "Chicken-and-egg" with requires and BindsTo. Also, we only want to announce when running - if we announce and are not running, then bad things happen - opposite is not true.


@mmlb
Copy link
Member

mmlb commented Feb 18, 2015

Comments from the review on Reviewable.io


roles/dhcpd/templates/dhcpd.service.j2, line 5 [r1] (raw file):
So I just checked this because it seems that this should be possible.

I created 2 services sleep and announce, both BindsTo (no Requires) the other and as far as I can tell systemd does what we want.

❯ tail -n +1 sleep.service announce.service
==> sleep.service <==
[Unit]
BindsTo=announce.service

[Service]
ExecStart=/usr/bin/sh -c 'sleep 30d'
Restart=always

==> announce.service <==
[Unit]
BindsTo=sleep.service

[Service]
ExecStart=/usr/bin/sh -c 'while true; do echo sleeper is sleeping; sleep 5; done'
Restart=always

killing one restarts the other, and stopping one stops the other.


@bakins
Copy link
Contributor Author

bakins commented Feb 18, 2015

Comments from the review on Reviewable.io


roles/dhcpd/templates/dhcpd.service.j2, line 5 [r1] (raw file):
interesting. let me give that a go


@mmlb
Copy link
Member

mmlb commented Feb 18, 2015

Comments from the review on Reviewable.io

Reviewed files:

  • roles/dhcpd/templates/dhcpd-announce.service.j2 @ r2
  • roles/dhcpd/templates/dhcpd.service.j2 @ r2
  • roles/dhcrelay/templates/dhcrelay-announce.service.j2 @ r3
  • roles/dhcrelay/templates/dhcrelay.service.j2 @ r2
  • roles/dns/templates/named.service.j2 @ r1
  • roles/dns/templates/queensland.service.j2 @ r1
  • roles/enfield/templates/enfield-announce.service.j2 @ r2
  • roles/enfield/templates/enfield.service.j2 @ r2
  • roles/lochness/templates/node-announce.service.j2 @ r2
  • roles/tftpd/templates/tftpd-announce.service.j2 @ r2
  • roles/tftpd/templates/tftpd.service.j2 @ r2

roles/lochness/templates/node-announce.service.j2, line 8 [r2] (raw file):
hmm, I wonder what the diff actually is here


@mmlb
Copy link
Member

mmlb commented Feb 18, 2015

Comments from the review on Reviewable.io

Reviewed files:

  • roles/dhcpd/templates/dhcpd-announce.service.j2 @ r2
  • roles/dhcpd/templates/dhcpd.service.j2 @ r2
  • roles/dhcrelay/templates/dhcrelay-announce.service.j2 @ r3
  • roles/dhcrelay/templates/dhcrelay.service.j2 @ r2
  • roles/dns/templates/named.service.j2 @ r1
  • roles/dns/templates/queensland.service.j2 @ r1
  • roles/enfield/templates/enfield-announce.service.j2 @ r2
  • roles/enfield/templates/enfield.service.j2 @ r2
  • roles/lochness/templates/node-announce.service.j2 @ r2
  • roles/tftpd/templates/tftpd-announce.service.j2 @ r2
  • roles/tftpd/templates/tftpd.service.j2 @ r2

1 similar comment
@mmlb
Copy link
Member

mmlb commented Feb 18, 2015

Comments from the review on Reviewable.io

Reviewed files:

  • roles/dhcpd/templates/dhcpd-announce.service.j2 @ r2
  • roles/dhcpd/templates/dhcpd.service.j2 @ r2
  • roles/dhcrelay/templates/dhcrelay-announce.service.j2 @ r3
  • roles/dhcrelay/templates/dhcrelay.service.j2 @ r2
  • roles/dns/templates/named.service.j2 @ r1
  • roles/dns/templates/queensland.service.j2 @ r1
  • roles/enfield/templates/enfield-announce.service.j2 @ r2
  • roles/enfield/templates/enfield.service.j2 @ r2
  • roles/lochness/templates/node-announce.service.j2 @ r2
  • roles/tftpd/templates/tftpd-announce.service.j2 @ r2
  • roles/tftpd/templates/tftpd.service.j2 @ r2

@bakins
Copy link
Contributor Author

bakins commented Feb 18, 2015

@bakins
Copy link
Contributor Author

bakins commented Mar 4, 2015

This probably needs some attention to decide how we want to approach.

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

Successfully merging this pull request may close these issues.

2 participants