3 Commits

5 changed files with 11 additions and 34 deletions

View File

@ -1,8 +1,8 @@
# ------------------------------------------------------------------------
from mcluseau/golang-builder:1.19.4 as build
from mcluseau/golang-builder:1.21.4 as build
# ------------------------------------------------------------------------
from alpine:3.17
from alpine:3.18.4
entrypoint mksquashfs /layer /layer.squashfs -noappend -comp xz >&2 && base64 </layer.squashfs

2
go.mod
View File

@ -1,6 +1,6 @@
module novit.nc/direktil/inits
go 1.19
go 1.21
require (
github.com/antage/mntent v0.0.0-20141129103236-834970000c6c

View File

@ -2,29 +2,12 @@
description="Direktil user services."
pidfile=/run/direktil/services.pid
supervisor=supervise-daemon
command="/sbin/dkl init services"
pidfile=/run/dkl-init-services.pid
depend()
{
need dkl-default
}
start()
{
mkdir -p $(dirname $pidfile)
einfo "Starting Direktil services manager"
start-stop-daemon --start \
--pidfile $pidfile \
--background \
--exec "/sbin/dkl" \
-- init services
eend $? "Failed to start Direktil services manager"
}
stop()
{
einfo "Stopping Direktil services manager"
start-stop-daemon --stop --pidfile $pidfile
eend $? "Failed to stop Direktil services manager"
}

View File

@ -1 +0,0 @@
../../init.d/dkl-boot

View File

@ -1,9 +1,7 @@
package applyconfig
import (
"flag"
"os"
"strings"
"github.com/spf13/cobra"
"novit.nc/direktil/inits/pkg/apply"
@ -13,8 +11,8 @@ import (
)
var (
filesFilters string
log = dlog.Get("dkl")
filters []string
log = dlog.Get("dkl")
)
func Command() (c *cobra.Command) {
@ -26,7 +24,8 @@ func Command() (c *cobra.Command) {
Run: run,
}
flag.StringVar(&filesFilters, "files-filters", "", "comma-separated filters to select files to apply")
flag := c.Flags()
flag.StringArrayVarP(&filters, "filter", "F", []string{}, "glob filter to select files to apply")
return c
}
@ -52,10 +51,6 @@ func run(_ *cobra.Command, args []string) {
log.Print("failed to load config: ", err)
}
filters := []string{}
if filesFilters != "" {
filters = strings.Split(filesFilters, ",")
}
if err = apply.Files(cfg /*log,*/, filters...); err != nil {
log.Taint(dlog.Fatal, "failed to apply files: ", err)
os.Exit(1)