paths

package
v0.0.0-...-b9bb202 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 6 Imported by: 29

Documentation

Index

Constants

View Source
const (
	// NixDataDir is location for agent binaries on *nix operating systems.
	NixDataDir = "/var/lib/juju"

	// NixTransientDataDir is location for storing transient data on *nix
	// operating systems.
	NixTransientDataDir = "/var/run/juju"

	// NixLogDir is location for Juju logs on *nix operating systems.
	NixLogDir = "/var/log"
)
View Source
const LogfilePermission = os.FileMode(0640)

LogfilePermission is the file mode to use for log files.

Variables

View Source
var Chown = os.Chown

Chown is a variable here so it can be mocked out in tests to a no-op. Agents run as root, but users don't.

Functions

func CertDir

func CertDir(os OS) string

CertDir returns a filesystem path to the folder used by juju to store certificates that are added by default to the Juju client api certificate pool.

func CloudInitCfgDir

func CloudInitCfgDir(os OS) string

CloudInitCfgDir returns the absolute path to the instance cloud config directory for a particular series.

func ConfDir

func ConfDir(os OS) string

ConfDir returns the path to the directory where Juju may store configuration files.

func CurtinInstallConfig

func CurtinInstallConfig(os OS) string

CurtinInstallConfig returns the absolute path the configuration file written by Curtin during machine provisioning.

func DataDir

func DataDir(os OS) string

DataDir returns a filesystem path to the folder used by juju to store tools, charms, locks, etc

func JujuDumpLogs

func JujuDumpLogs(os OS) string

JujuDumpLogs returns the absolute path to the juju-dumplogs binary for a particular series.

func JujuExec

func JujuExec(os OS) string

JujuExec returns the absolute path to the juju-exec binary for a particular series.

func JujuIntrospect

func JujuIntrospect(os OS) string

JujuIntrospect returns the absolute path to the juju-introspect binary for a particular series.

func LogDir

func LogDir(os OS) string

LogDir returns filesystem path the directory where juju may save log files.

func MachineCloudInitDir

func MachineCloudInitDir(os OS) string

MachineCloudInitDir returns the absolute path to the instance cloudinit directory for a particular series.

func MetricsSpoolDir

func MetricsSpoolDir(os OS) string

MetricsSpoolDir returns a filesystem path to the folder used by juju to store metrics.

func PrimeLogFile

func PrimeLogFile(path string) error

PrimeLogFile ensures that the given log file is created with the correct mode and ownership.

func SetOwnership

func SetOwnership(filePath string, wantedUser string, wantedGroup string) error

SetOwnership sets the ownership of a given file from a path. Searches for the corresponding id's from user, group and uses them to chown.

func SetSyslogOwner

func SetSyslogOwner(filename string) error

SetSyslogOwner sets the owner and group of the file to be the appropriate syslog users as defined by the SyslogUserGroup method.

func StorageDir

func StorageDir(os OS) string

StorageDir returns a filesystem path to the folder used by juju to mount machine-level storage.

func SyslogUserGroup

func SyslogUserGroup() (string, string)

SyslogUserGroup returns the names of the user and group that own the log files.

func TransientDataDir

func TransientDataDir(os OS) string

TransientDataDir returns a filesystem path to the folder used by juju to store transient data that will not survive a reboot.

Types

type OS

type OS int // strongly typed runtime.GOOS value to help with refactoring
const (
	OSWindows  OS = 1
	OSUnixLike OS = 2
)

func CurrentOS

func CurrentOS() OS

CurrentOS returns the OS value for the currently-running system.

func OSType

func OSType(osName string) OS

OSType converts the given os name to an OS value.

Directories

Path Synopsis
Package transientfile provides helpers for creating files that do not survive machine reboots.
Package transientfile provides helpers for creating files that do not survive machine reboots.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL