groups

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package groups checks the group memberships that let a user open USB serial ports and sound cards, and reports whether each reaches the places that matter: the account, the current login, and the background user manager that actually runs hamstack's services.

Index

Constants

View Source
const AudioGroupName = "audio"

AudioGroupName is the group that owns sound devices. A logged-in desktop session gets access through logind regardless; services running with nobody logged in need real membership.

Variables

This section is empty.

Functions

func ManagerGIDs

func ManagerGIDs() ([]int, error)

ManagerGIDs returns the supplementary groups of the user's systemd service manager.

func ParseStatusGroups

func ParseStatusGroups(status string) []int

ParseStatusGroups reads the "Groups:" line of /proc/<pid>/status.

func SerialGroupName

func SerialGroupName(fam distro.Family, sample string) string

SerialGroupName is the group that owns USB serial ports: uucp on Arch, dialout on Debian and Fedora. If sample (an existing serial device) is given, its real owner wins.

Types

type Info

type Info struct {
	Name         string
	Exists       bool
	GID          int
	Member       bool // listed for the account (/etc/group): effective at the next login
	Session      bool // this process has it: the current login already includes it
	Manager      bool // the user's service manager has it (what hamstack's services run under)
	ManagerKnown bool // false when the manager could not be inspected
}

Info is one group's state for the current user.

func Lookup

func Lookup(name string) Info

Lookup reports the state of a group for the current user.

func (Info) Advice

func (i Info) Advice() (problem, fix string)

Advice says what is wrong with a group's state and how to fix it; "" means all is well.

Jump to

Keyboard shortcuts

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