Documentation ¶
Index ¶
- Constants
- Variables
- func BaseCleanupDir(ctx *context.T, path, helper string)
- func ComputeDeviceProfile() (*profile.Specification, error)
- func DeleteFileTree(ctx *context.T, dirOrFile string, stdout, stderr io.Writer) error
- func GenerateScript(workspace string, configSettings []string, envelope *application.Envelope, ...) error
- func InitSuidHelper(ctx *context.T, helperPath string)
- func InvokeCallback(ctx *context.T, name string)
- func LinkSelf(workspace, fileName string) error
- func NewDispatcher(ctx *context.T, config *config.State, mtAddress string, testMode bool, ...) (rpc.Dispatcher, func(), error)
- func PermsDir(c *config.State) string
- func RunningChildrenProcesses() bool
- func SaveManagerInfo(dir string, info *ManagerInfo) error
- func SavePersistentArgs(root string, args []string) error
- func UpdateLink(target, link string) error
- func VanadiumEnvironment(env []string) []string
- type BlessingSystemAssociationStore
- type ManagerInfo
Constants ¶
const ( ShellPath = "/bin/bash" DateCommand = "/bin/date +%s%N" )
Variables ¶
var AutomaticTidyingInterval = time.Hour * 24
AutomaticTidyingInterval defaults to 1 day. Settable for tests.
var CleanupDir = BaseCleanupDir
CleanupDir is defined like this so we can override its implementation for tests. CleanupDir will use the helper to delete application state possibly owned by different accounts if helper is provided.
var Describe = func() (device.Description, error) { empty := device.Description{} deviceProfile, err := ComputeDeviceProfile() if err != nil { return empty, err } knownProfiles, err := profiles.GetKnownProfiles() if err != nil { return empty, err } result := matchProfiles(deviceProfile, knownProfiles) if len(result.Profiles) == 0 { result.Profiles["unknown"] = struct{}{} } return result, nil }
Describe returns a Description containing the profile that matches the current device. It's declared as a variable so we can override it for testing.
var IsSetuid = func(ctx *context.T, fileStat os.FileInfo) bool { ctx.VI(2).Infof("running the original isSetuid") return fileStat.Mode()&os.ModeSetuid == os.ModeSetuid }
IsSetuid is defined like this so we can override its implementation for tests.
var MockableNow = time.Now
Exposed for replacability in tests.
Functions ¶
func BaseCleanupDir ¶
func ComputeDeviceProfile ¶
func ComputeDeviceProfile() (*profile.Specification, error)
ComputeDeviceProfile generates a description of the runtime environment (supported file format, OS, architecture, libraries) of the host device.
TODO(jsimsa): Avoid computing the host device description from scratch if a recent cached copy exists.
func DeleteFileTree ¶
func GenerateScript ¶
func InitSuidHelper ¶
func InvokeCallback ¶
InvokeCallback provides the parent device manager with the given name (which is expected to be this device manager's object name).
func NewDispatcher ¶
func NewDispatcher(ctx *context.T, config *config.State, mtAddress string, testMode bool, restartHandler func(), permStore *pathperms.PathStore) (rpc.Dispatcher, func(), error)
NewDispatcher is the device manager dispatcher factory. It returns a new dispatcher as well as a shutdown function, to be called when the dispatcher is no longer needed.
func RunningChildrenProcesses ¶
func RunningChildrenProcesses() bool
RunningChildrenProcesses uses the reaper to verify that a test has successfully shut down all processes.
func SaveManagerInfo ¶
func SaveManagerInfo(dir string, info *ManagerInfo) error
func SavePersistentArgs ¶
func UpdateLink ¶
func VanadiumEnvironment ¶
VanadiumEnvironment returns only the environment variables that are specific to the Vanadium system.
Types ¶
type BlessingSystemAssociationStore ¶
type BlessingSystemAssociationStore interface { // SystemAccountForBlessings returns a system name from the blessing to // system name association store if one exists for any of the listed // blessings. SystemAccountForBlessings(blessings []string) (string, bool) // AllBlessingSystemAssociations returns all of the current Blessing to system // account associations. AllBlessingSystemAssociations() ([]device.Association, error) // AssociateSystemAccountForBlessings associates the provided systenName with each // provided blessing. AssociateSystemAccountForBlessings(blessings []string, systemName string) error // DisassociateSystemAccountForBlessings removes associations for the provided blessings. DisassociateSystemAccountForBlessings(blessings []string) error }
BlessingSystemAssociationStore manages a persisted association between Vanadium blessings and system account names.
func NewBlessingSystemAssociationStore ¶
func NewBlessingSystemAssociationStore(root string) (BlessingSystemAssociationStore, error)
type ManagerInfo ¶
type ManagerInfo struct {
Pid int
}
ManagerInfo holds state about a running device manager or a running restarter
func LoadManagerInfo ¶
func LoadManagerInfo(dir string) (*ManagerInfo, error)
Source Files ¶
- app_service.go
- app_starting_util.go
- app_state.go
- association_instance.go
- association_state.go
- callback.go
- config_service.go
- device_service.go
- dispatcher.go
- helper_manager.go
- instance_reaping.go
- perms_propagator.go
- principal_manager.go
- profile.go
- proxy_invoker.go
- restart_policy.go
- shell_linux.go
- stats.go
- tidyup.go
- util.go