Mail archive
alpine-aports

[alpine-aports] Re: [alpine-aports, 3/9] main/s6: start a supervision tree in /run/service when installed, make doc package

From: Timo Teras <timo.teras_at_iki.fi>
Date: Thu, 24 Nov 2016 08:31:09 +0200

The:
> start a supervision tree in /run/service when installed

is a bad idea. We don't want the packages to do things like this
automatically. This is especially bad because s6-dev pulls s6, so this
can royally mess up builders.

> --- /dev/null
> +++ b/main/s6/s6.post-deinstall
> _at_@ -0,0 +1,6 @@
> +#!/bin/sh
> +
> +rm -rf /run/service /run/uncaught-logs
> +deluser catchlog
> +delgroup catchlog
> +exit 0

Normally we don't try to delete users.

> diff --git a/main/s6/s6.post-install b/main/s6/s6.post-install
> new file mode 100644
> index 0000000..84a8b04
> --- /dev/null
> +++ b/main/s6/s6.post-install
> _at_@ -0,0 +1,11 @@
> +#!/bin/sh
> +
> +if grep -qFx "::respawn:/lib/s6/s6-svscanboot /run/service"
> < /etc/inittab ; then
> + :
> +else
> + cat >> /etc/inittab <<EOF
> +# Launch and supervise s6-svscan
> +::respawn:/lib/s6/s6-svscanboot /run/service
> +EOF
> + kill -HUP 1
> +fi

This should be separate 'setup-s6' script. This must not be done
automatically.

Also HUPing init does not work inside containers. And when apk
installing with --root this breaks.

> diff --git a/main/s6/s6.post-upgrade b/main/s6/s6.post-upgrade
> new file mode 100644
> index 0000000..84a8b04
> --- /dev/null
> +++ b/main/s6/s6.post-upgrade
> _at_@ -0,0 +1,11 @@
> +#!/bin/sh
> +
> +if grep -qFx "::respawn:/lib/s6/s6-svscanboot /run/service"
> < /etc/inittab ; then
> + :
> +else
> + cat >> /etc/inittab <<EOF
> +# Launch and supervise s6-svscan
> +::respawn:/lib/s6/s6-svscanboot /run/service
> +EOF
> + kill -HUP 1
> +fi

Same here. We'll implement restarting things after upgrade somehow else
than post-install. Admin should be able to upgrade packages without
restarting system daemons.

> diff --git a/main/s6/s6.pre-deinstall b/main/s6/s6.pre-deinstall
> new file mode 100644
> index 0000000..9d44c6f
> --- /dev/null
> +++ b/main/s6/s6.pre-deinstall
> _at_@ -0,0 +1,9 @@
> +#!/bin/sh -e
> +
> +stamp=`echo | /bin/s6-tai64n`
> +tmp=/tmp/inittab.$$.${stamp%% }
> +grep -vFx -e '# Launch and supervise s6-svscan' -e
> '::respawn:/lib/s6/s6-svscanboot /run/service' < /etc/inittab >
> "$tmp" || true +mv -f "$tmp" /etc/inittab +s6-svc
> -X /run/service/s6-svscan-log || true +s6-svscanctl -q /run/service
> || true +kill -HUP 1
> diff --git a/main/s6/s6.pre-install b/main/s6/s6.pre-install
> new file mode 100644
> index 0000000..6d9b6d5
> --- /dev/null
> +++ b/main/s6/s6.pre-install
> _at_@ -0,0 +1,5 @@
> +#!/bin/sh
> +
> +addgroup -S catchlog 2>/dev/null
> +adduser -S -D -H -s /bin/false -G catchlog -g catchlog catchlog
> 2>/dev/null +exit 0
> diff --git a/main/s6/s6.pre-upgrade b/main/s6/s6.pre-upgrade
> new file mode 100644
> index 0000000..6d9b6d5
> --- /dev/null
> +++ b/main/s6/s6.pre-upgrade
> _at_@ -0,0 +1,5 @@
> +#!/bin/sh
> +
> +addgroup -S catchlog 2>/dev/null
> +adduser -S -D -H -s /bin/false -G catchlog -g catchlog catchlog
> 2>/dev/null +exit 0
> diff --git a/main/s6/s6.trigger b/main/s6/s6.trigger
> new file mode 100644
> index 0000000..8db8d9a
> --- /dev/null
> +++ b/main/s6/s6.trigger
> _at_@ -0,0 +1,3 @@
> +#!/bin/execlineb -P
> +
> +s6-svscanctl -aN /run/service



---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Thu Nov 24 2016 - 08:31:09 GMT