Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
354bdce5ab | |||
6099dd399d | |||
9fe316ad44 |
@ -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
2
go.mod
@ -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
|
||||
|
@ -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"
|
||||
}
|
||||
|
@ -1 +0,0 @@
|
||||
../../init.d/dkl-boot
|
@ -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)
|
||||
|
Reference in New Issue
Block a user