Skip to content
This repository has been archived by the owner on Aug 14, 2020. It is now read-only.

Commit

Permalink
schema/app: add annotation to expose sd_notify() support
Browse files Browse the repository at this point in the history
The annotation "appc.io/executor/systemd/support-notify" exposes
if or not an application supports notifications using sd_notify().
This information may be used to signal the init process when a service is ready.
  • Loading branch information
Alessandro Puccetti committed Jun 28, 2016
1 parent baa3e9c commit 8a9d130
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions examples/image.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@
{
"name": "homepage",
"value": "https://example.com"
},
{
"name": "appc.io/executor/systemd/support-notify",
"value": "false"
}
]
}
6 changes: 6 additions & 0 deletions schema/types/annotations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ func TestAnnotationsAssertValid(t *testing.T) {
},
false,
},
{
[]Annotation{
makeAnno("appc.io/executor/systemd/support-notify", "false"),
},
false,
},
// empty is OK
{
[]Annotation{},
Expand Down
7 changes: 6 additions & 1 deletion spec/aci.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ JSON Schema for the Image Manifest (app image manifest, ACI manifest), conformin
"count": 1000,
"protocol": "tcp"
}
]
],
},
"dependencies": [
{
Expand Down Expand Up @@ -211,6 +211,10 @@ JSON Schema for the Image Manifest (app image manifest, ACI manifest), conformin
{
"name": "homepage",
"value": "https://example.com"
},
{
"name": "appc.io/executor/supportsSystemdNotify",
"value": false
}
]
}
Expand Down Expand Up @@ -250,6 +254,7 @@ JSON Schema for the Image Manifest (app image manifest, ACI manifest), conformin
* **authors** contact details of the people or organization responsible for the image (freeform string)
* **homepage** URL to find more information on the image (string, must be a URL with scheme HTTP or HTTPS)
* **documentation** URL to get documentation on the image (string, must be a URL with scheme HTTP or HTTPS)
* **appc.io/executor/supportsSystemdNotify** (boolean, optional, defaults to "false" if unset) if set to true, the application MUST use the [sd_notify()](https://www.freedesktop.org/software/systemd/man/sd_notify.html) mechanism to signal when it is ready. An application with this parameter set to true MUST be able to detect if the executor had not set up the sd_notify mechanism and skip the notification without error ([sd_notify()](https://www.freedesktop.org/software/systemd/man/sd_notify.html) from libsystemd does that automatically).

#### Dependency Matching

Expand Down

0 comments on commit 8a9d130

Please sign in to comment.