dot

packages and services management
Log | Files | Refs | README

commit 8174c3a96f3cf2aa7f587b47d368544761f3c830
parent 68789e025ce0b0f998e40b24e43887b09009f439
Author: Josuah Demangeon <mail@josuah.net>
Date:   Fri,  9 Nov 2018 23:31:15 +0100

bin/service-*: have /{etc,var,run}/s6/ contain one immediate directory per service

Diffstat:
Mbin/service-disable | 2+-
Mbin/service-enable | 2+-
Mbin/service-init | 10+++++-----
Mbin/service-load | 8++++----
Abin/service-log | 6++++++
Mbin/service-shutdown | 2+-
Mbin/service-start | 2+-
Mbin/service-status | 2+-
Mbin/service-stop | 2+-
9 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/bin/service-disable b/bin/service-disable @@ -1,5 +1,5 @@ #!/usr/bin/env execlineb -cd /var/s6/current +cd /var/s6 if { mkdir -p ok-all } if { touch ok-all/contents } diff --git a/bin/service-enable b/bin/service-enable @@ -1,5 +1,5 @@ #!/usr/bin/env execlineb -cd /var/s6/current +cd /var/s6 ifelse { pipeline { dollarat } grep -Evq "^[^/]+/[^/]+\$" } { foreground { echo "usage: service-enable service/version..." } diff --git a/bin/service-init b/bin/service-init @@ -1,11 +1,11 @@ #!/usr/bin/env execlineb -if { s6-rmrf /run/s6 /var/s6/init } -if { s6-mkdir -p /run/s6 /var/log /var/s6/init /var/s6/current } -if { s6-mkfifo /var/s6/init/fifo } +if { s6-rmrf /run/s6 /var/s6/.s6-rc/log } +if { s6-mkdir -p /run/s6 /var/log /var/s6/.s6-rc } +if { s6-mkfifo /var/s6/.s6-rc/log } cd /var/s6 -if { cp -r /etc/s6/s6-svscan/log /var/s6/current/s6-svscan-log } +if { cp -r /etc/s6/s6-svscan/log /var/s6/s6-svscan-log } background { redirfd -r 1 init/fifo @@ -15,7 +15,7 @@ background { background { backtick -n t { s6-clock } importas t t if { s6-rc-compile compiled$t current } - if { s6-rc-init -c /var/s6/compiled$t -l /var/s6/live /run/s6 } + if { s6-rc-init -c /var/s6/.s6-rc/compiled$t -l /var/s6/.s6-rc/live /run/s6 } if { s6-ln -nsf compiled$t compiled } redirfd -w 1 init/fifo # wait that s6-svscan start diff --git a/bin/service-load b/bin/service-load @@ -1,7 +1,7 @@ #!/usr/bin/env execlineb backtick -n t { s6-clock } importas t t -if { s6-rc-compile /var/s6/compiled$t /var/s6/current } -if { s6-rc-update -l /var/s6/live /var/s6/compiled$t } -if { s6-ln -nsf /var/s6/compiled$t /var/s6/compiled } -if { s6-rc -l /var/s6/live -u change ok-all } +if { s6-rc-compile /var/s6/.s6-rc/compiled$t /var/s6 } +if { s6-rc-update -l /var/s6/.s6-rc/live /var/s6/.s6-rc/compiled$t } +if { s6-ln -nsf /var/s6/.s6-rc/compiled$t /var/s6/.s6-rc/compiled } +if { s6-rc -l /var/s6/.s6-rc/live -u change ok-all } diff --git a/bin/service-log b/bin/service-log @@ -0,0 +1,6 @@ +#!/usr/bin/env execlineb + +cd /var/log + +backtick @ { pipeline { dollarat } tr / - } importas -sn @ @ +pipeline { tail -f ${@}/current } s6-tai64nlocal diff --git a/bin/service-shutdown b/bin/service-shutdown @@ -1,3 +1,3 @@ #!/usr/bin/env execlineb -s6-rc -l /var/s6/live -d -a change +s6-rc -l /var/s6/.s6-rc/live -d -a change diff --git a/bin/service-start b/bin/service-start @@ -1,4 +1,4 @@ #!/usr/bin/env execlineb backtick -n @ { pipeline { dollarat } tr / - } importas @ @ -s6-rc -l /var/s6/live -u change $@ +s6-rc -l /var/s6/.s6-rc/live -u change $@ diff --git a/bin/service-status b/bin/service-status @@ -1,4 +1,4 @@ #!/usr/bin/env execlineb backtick -n @ { pipeline { dollarat } tr / - } importas @ @ -s6-rc -l /var/s6/live listall $@ +s6-rc -l /var/s6/.s6-rc/live listall $@ diff --git a/bin/service-stop b/bin/service-stop @@ -1,4 +1,4 @@ #!/usr/bin/env execlineb backtick -n @ { pipeline { dollarat } tr / - } importas @ @ -s6-rc -l /var/s6/live -d change $@ +s6-rc -l /var/s6/.s6-rc/live -d change $@