libgosu

package module
v0.0.0-...-b5beef7 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: GPL-3.0 Imports: 7 Imported by: 1

README

DEPRECATED

This project is obsolete and no longer maintained.

libgosu

Same functional logic as https://github.com/tianon/gosu but restructured to make it easier to utilize the functionality in other go projects

While the gosu cli utility can be built from this project, it is recommended to always use the cli utility from https://github.com/tianon/gosu

Example Lib Usage

package myapp

import (
	"fmt"

	"github.com/emacski/libgosu"
)

err := libgosu.Exec("nobody", []string{"redis-server", "--maxmemory", "2mb", "6379"})
if err != nil {
	fmt.Errorf("error: %v", err)
}

Documentation

Index

Constants

View Source
const Version = "1.10"

Variables

This section is empty.

Functions

func Exec

func Exec(userspec string, cmdwargs []string) error

Exec attempts to apply the userspec to the current thread before calling syscall.Exec which itself invokes the execve(2) system call. Param `userspec` should be in the form: "<user or uid>" or "<user or uid>:<group or guid>"

NOTE: On a successful call to syscall.Exec this function will never return. See http://man7.org/linux/man-pages/man2/execve.2.html:

"execve() does not return on success, and the text, initialized data,

uninitialized data (bss), and stack of the calling process are
overwritten according to the contents of the newly loaded program."

func SetupUser

func SetupUser(u string) error

SetupUser changes the groups, gid, and uid for the user inside the container

Types

This section is empty.

Directories

Path Synopsis
gosu cli utility
gosu cli utility

Jump to

Keyboard shortcuts

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