paths

package
v0.0.0-...-b0bff92 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

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 TempDir

func TempDir(os OS) string

TempDir returns the path on disk to the correct tmp directory for the series. This value will be the same on virtually all linux systems, but will differ on windows

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 SeriesToOS

func SeriesToOS(ser string) OS

SeriesToOS converts the given series 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