Merge lp:~morphis/core-snap/add-configure-hook-sshd-service into lp:core-snap
| Status: | Merged |
|---|---|
| Merged at revision: | 47 |
| Proposed branch: | lp:~morphis/core-snap/add-configure-hook-sshd-service |
| Merge into: | lp:core-snap |
| Diff against target: |
75 lines (+58/-0) 2 files modified
hooks/configure (+47/-0) snapcraft.yaml (+11/-0) |
| To merge this branch: | bzr merge lp:~morphis/core-snap/add-configure-hook-sshd-service |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| John Lenton | Needs Fixing on 2017-01-26 | ||
| Oliver Grawert | Approve on 2017-01-26 | ||
| Michael Vogt | 2017-01-20 | Approve on 2017-01-26 | |
|
Review via email:
|
|||
Commit Message
Add configure hook which only accepts a single option service.ssh.disable for now
The purpose of the service.ssh.disable option is to either enable or disable the ssh service on the system. A management snap can then use the snapd-control interface to change the configuration and enable/disable ssh depending on its needs.
| Simon Fels (morphis) wrote : | # |
The hook needs plugs added to allow access to /etc/ssh and restarting services via systemd. See https:/
| Simon Fels (morphis) wrote : | # |
Using now the new 'core-support' interface which was explicitly introduced for things the core has to do like this configure hook. See https:/
| Simon Fels (morphis) wrote : | # |
Spread test added to snapd with https:/
| Simon Fels (morphis) wrote : | # |
Switched to stop/disable and enable/start as suggested by Gustavo on Telegram. Status is back to work-in-progress as I am using this MP as a base to generate a new core snap on launchpad.
Also needs https:/
| John Lenton (chipaca) wrote : | # |
This is broken as is, unless i'm very mistaken.
'let' is a bashism
and
while $n -lt 10 $wait_attempts ! is_ssh_unit_enabled
is missing an &&
- 56. By Simon Fels on 2017-01-26
-
Fix leftover invalid shell syntax
- 57. By Simon Fels on 2017-01-26
-
Switch stop+disable to disable+stop
- 58. By Simon Fels on 2017-01-26
-
Fix condition
| Simon Fels (morphis) wrote : | # |
Fixed all review comments.
| Oliver Grawert (ogra) wrote : | # |
added some inline comments
- 59. By Simon Fels on 2017-01-26
-
Respect review comments
- 60. By Simon Fels on 2017-01-26
-
Add missing brackets
| Michael Vogt (mvo) wrote : | # |
Some nitpick.
- 61. By Simon Fels on 2017-01-27
-
Rework hook again to use plain systemctl
| Simon Fels (morphis) wrote : | # |
After some more discussion this was now reworked to use systemctl again. See https:/
Name of the configure option is now 'service.
Also note that proper documentation for this was added with https:/
- 62. By Simon Fels on 2017-01-27
-
Correct configure hook implementation
- 63. By Simon Fels on 2017-01-27
-
disable with --now doesn't work well for ssh.service
- 64. By Simon Fels on 2017-01-27
-
Only enable/disable when really needed
| Michael Vogt (mvo) wrote : | # |
Some nitpick
- 65. By Simon Fels on 2017-01-27
-
Rework logic again
- 66. By Simon Fels on 2017-01-27
-
Don't do anything when no value is set

Looks good!