mirror of
https://codeberg.org/cunicu/cunicu.git
synced 2025-10-05 08:47:03 +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.
|
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.
|
So runtime changes will also be taken into account for subsequent starts of the daemon.
|
||||||
|
|
||||||
## DNS Auto-configuration
|
## DNS Auto-configuration
|
||||||
|
@@ -21,7 +21,7 @@ backends:
|
|||||||
rpc:
|
rpc:
|
||||||
# Path to a Unix socket for management
|
# Path to a Unix socket for management
|
||||||
# and monitoring of the cunicu daemon.
|
# and monitoring of the cunicu daemon.
|
||||||
socket: /var/run/cunicu.sock
|
socket: /run/cunicu.sock
|
||||||
|
|
||||||
# Start of cunīcu daemon will block until
|
# Start of cunīcu daemon will block until
|
||||||
# its unblocked via the control socket.
|
# its unblocked via the control socket.
|
||||||
|
@@ -104,7 +104,7 @@ $defs:
|
|||||||
description: |
|
description: |
|
||||||
Path to a Unix socket for management and monitoring of the cunīcu daemon.
|
Path to a Unix socket for management and monitoring of the cunīcu daemon.
|
||||||
type: string
|
type: string
|
||||||
default: /var/run/cunicu.sock
|
default: /run/cunicu.sock
|
||||||
|
|
||||||
wait:
|
wait:
|
||||||
description: |
|
description: |
|
||||||
|
@@ -18,8 +18,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
DefaultSocketPath = "/var/run/cunicu.sock"
|
|
||||||
|
|
||||||
// Ephemeral Port Range (RFC6056 Sect. 2.1)
|
// Ephemeral Port Range (RFC6056 Sect. 2.1)
|
||||||
EphemeralPortMin = (1 << 15) + (1 << 14)
|
EphemeralPortMin = (1 << 15) + (1 << 14)
|
||||||
EphemeralPortMax = (1 << 16) - 1
|
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-FileCopyrightText: 2023-2024 Steffen Vogel <post@steffenvogel.de>
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
//go:build unix
|
||||||
|
|
||||||
package config
|
package config
|
||||||
|
|
||||||
|
const DefaultSocketPath = "/run/cunicu.sock"
|
||||||
|
|
||||||
//nolint:gochecknoglobals
|
//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) {
|
func (a *Agent) Start(_, dir string, args ...any) (err error) {
|
||||||
cfgPath := fmt.Sprintf("%s/%s.yaml", dir, a.Name())
|
cfgPath := fmt.Sprintf("%s/%s.yaml", dir, a.Name())
|
||||||
logPath := fmt.Sprintf("%s/%s.log", 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
|
// Create agent configuration
|
||||||
cfg := a.Config.Copy()
|
cfg := a.Config.Copy()
|
||||||
|
Reference in New Issue
Block a user