mirror of
https://codeberg.org/cunicu/cunicu.git
synced 2025-09-26 21:01:14 +08:00
fix(systemd): Make default paths for runtime config and RPC socket compatible with systemd
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
@@ -41,7 +41,7 @@ Please have a look at the [`cunicu config`](../usage/md/cunicu_config.md) comman
|
||||
|
||||
Currently, not all settings are runtime tunable.
|
||||
|
||||
Changed settings via the `cunicu config set` command are persisted in a runtime configuration file at `/var/lib/cunicu.runtime.yaml`.
|
||||
Changed settings via the `cunicu config set` command are persisted in a runtime configuration file at `/var/lib/cunicu/runtime.yaml`.
|
||||
So runtime changes will also be taken into account for subsequent starts of the daemon.
|
||||
|
||||
## DNS Auto-configuration
|
||||
|
@@ -21,7 +21,7 @@ backends:
|
||||
rpc:
|
||||
# Path to a Unix socket for management
|
||||
# and monitoring of the cunicu daemon.
|
||||
socket: /var/run/cunicu.sock
|
||||
socket: /run/cunicu.sock
|
||||
|
||||
# Start of cunīcu daemon will block until
|
||||
# its unblocked via the control socket.
|
||||
|
@@ -104,7 +104,7 @@ $defs:
|
||||
description: |
|
||||
Path to a Unix socket for management and monitoring of the cunīcu daemon.
|
||||
type: string
|
||||
default: /var/run/cunicu.sock
|
||||
default: /run/cunicu.sock
|
||||
|
||||
wait:
|
||||
description: |
|
||||
|
@@ -18,8 +18,6 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
DefaultSocketPath = "/var/run/cunicu.sock"
|
||||
|
||||
// Ephemeral Port Range (RFC6056 Sect. 2.1)
|
||||
EphemeralPortMin = (1 << 15) + (1 << 14)
|
||||
EphemeralPortMax = (1 << 16) - 1
|
||||
|
11
pkg/config/defaults_nonunix.go
Normal file
11
pkg/config/defaults_nonunix.go
Normal file
@@ -0,0 +1,11 @@
|
||||
// SPDX-FileCopyrightText: 2023 Steffen Vogel <post@steffenvogel.de>
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
//go:build !unix
|
||||
|
||||
package config
|
||||
|
||||
const DefaultSocketPath = "cunicu.sock"
|
||||
|
||||
//nolint:gochecknoglobals
|
||||
var RuntimeConfigFile = "runtime.yaml"
|
@@ -1,7 +1,11 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024 Steffen Vogel <post@steffenvogel.de>
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
//go:build unix
|
||||
|
||||
package config
|
||||
|
||||
const DefaultSocketPath = "/run/cunicu.sock"
|
||||
|
||||
//nolint:gochecknoglobals
|
||||
var RuntimeConfigFile = "/var/lib/cunicu.runtime.yaml"
|
||||
var RuntimeConfigFile = "/var/lib/cunicu/runtime.yaml"
|
||||
|
@@ -96,7 +96,7 @@ func NewAgent(m *g.Network, name string, opts ...g.Option) (*Agent, error) {
|
||||
func (a *Agent) Start(_, dir string, args ...any) (err error) {
|
||||
cfgPath := fmt.Sprintf("%s/%s.yaml", dir, a.Name())
|
||||
logPath := fmt.Sprintf("%s/%s.log", dir, a.Name())
|
||||
rpcPath := fmt.Sprintf("/var/run/cunicu.%s.sock", a.Name())
|
||||
rpcPath := fmt.Sprintf("/run/cunicu.%s.sock", a.Name())
|
||||
|
||||
// Create agent configuration
|
||||
cfg := a.Config.Copy()
|
||||
|
Reference in New Issue
Block a user