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
|
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
|
module novit.nc/direktil/inits
|
||||||
|
|
||||||
go 1.19
|
go 1.21
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/antage/mntent v0.0.0-20141129103236-834970000c6c
|
github.com/antage/mntent v0.0.0-20141129103236-834970000c6c
|
||||||
|
@ -2,29 +2,12 @@
|
|||||||
|
|
||||||
description="Direktil user services."
|
description="Direktil user services."
|
||||||
|
|
||||||
pidfile=/run/direktil/services.pid
|
supervisor=supervise-daemon
|
||||||
|
command="/sbin/dkl init services"
|
||||||
|
|
||||||
|
pidfile=/run/dkl-init-services.pid
|
||||||
|
|
||||||
depend()
|
depend()
|
||||||
{
|
{
|
||||||
need dkl-default
|
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
|
package applyconfig
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"novit.nc/direktil/inits/pkg/apply"
|
"novit.nc/direktil/inits/pkg/apply"
|
||||||
@ -13,8 +11,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
filesFilters string
|
filters []string
|
||||||
log = dlog.Get("dkl")
|
log = dlog.Get("dkl")
|
||||||
)
|
)
|
||||||
|
|
||||||
func Command() (c *cobra.Command) {
|
func Command() (c *cobra.Command) {
|
||||||
@ -26,7 +24,8 @@ func Command() (c *cobra.Command) {
|
|||||||
Run: run,
|
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
|
return c
|
||||||
}
|
}
|
||||||
@ -52,10 +51,6 @@ func run(_ *cobra.Command, args []string) {
|
|||||||
log.Print("failed to load config: ", err)
|
log.Print("failed to load config: ", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
filters := []string{}
|
|
||||||
if filesFilters != "" {
|
|
||||||
filters = strings.Split(filesFilters, ",")
|
|
||||||
}
|
|
||||||
if err = apply.Files(cfg /*log,*/, filters...); err != nil {
|
if err = apply.Files(cfg /*log,*/, filters...); err != nil {
|
||||||
log.Taint(dlog.Fatal, "failed to apply files: ", err)
|
log.Taint(dlog.Fatal, "failed to apply files: ", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
Reference in New Issue
Block a user