From af1886005b426de37079485349f611af74680370 Mon Sep 17 00:00:00 2001 From: default Date: Thu, 19 Jan 2023 21:06:07 +0100 Subject: [PATCH] new: initial work on cupsd service --- cupsd/hooks/init | 21 +++++++++++++++++++++ cupsd/metadata.yml | 25 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100755 cupsd/hooks/init create mode 100755 cupsd/metadata.yml diff --git a/cupsd/hooks/init b/cupsd/hooks/init new file mode 100755 index 0000000..8efb38d --- /dev/null +++ b/cupsd/hooks/init @@ -0,0 +1,21 @@ +#!/bin/bash +## Init is run on host +## For now it is run every time the script is launched, but +## it should be launched only once after build. + +## Accessible variables are: +## - SERVICE_NAME Name of current service +## - DOCKER_BASE_IMAGE Base image from which this service might be built if any +## - SERVICE_DATASTORE Location on host of the DATASTORE of this service +## - SERVICE_CONFIGSTORE Location on host of the CONFIGSTORE of this service + + +set -e +mkdir -p "$SERVICE_DATASTORE/etc" + +if [ ! -d "$SERVICE_DATASTORE/etc/cups" ]; then + ## first time we need to extract configuration from image + rm -rf "$SERVICE_DATASTORE/etc/cups" + mkdir -p "$SERVICE_DATASTORE/etc" + service_base_image_export_dir "$SERVICE_NAME" /etc/cups "$SERVICE_DATASTORE/etc/" +fi \ No newline at end of file diff --git a/cupsd/metadata.yml b/cupsd/metadata.yml new file mode 100755 index 0000000..d126d5b --- /dev/null +++ b/cupsd/metadata.yml @@ -0,0 +1,25 @@ +description: "Cupsd Server" +maintainer: "Nicolas JEUDY" +## XXXnjeudy: docker uses the 'build' directory or the 'image:' option here. +## based on olbat/cupsd:2023-01-06 +docker-image: olbat/cupsd:2023-01-06 +data-resources: + - /etc/cups +#docker-compose: +# ports: +# - "631:631" +# add -v /var/run/dbus:/var/run/dbus +# no custom cupsd.conf : -v $PWD/cupsd.conf:/etc/cups/cupsd.conf + +# default-options: +# config: | + +provides: + printer-service: + +uses: + backup: + constraint: recommended + auto: pair + solves: + backup: "Automatic regular backup" -- 2.30.2