service

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupportedSystem appears if try to use service on system which is not supported by this release
	ErrUnsupportedSystem = errors.New("unsupported system")

	// ErrRootPrivileges appears if run installation or deleting the service without root privileges
	ErrRootPrivileges = errors.New("you must have root user privileges. Possibly using 'sudo' command should help")

	// ErrExecNotFound provided executable file does not exists
	ErrExecNotFound = errors.New("executable file does not exists or not provided")

	// ErrServiceNotInstalled provided executable file does not exists
	ErrServiceNotInstalled = errors.New("Service is not installed")
)
View Source
var UsageDet = fmt.Sprintf(`Config file is present in %s. Log file is in /var/log/immudb`, linuxConfigPath)

UsageDet details on config and log file on specific os

View Source
var UsageExamples = fmt.Sprintf(`Install the immutable database
sudo ./immuadmin service immudb install
Install the REST proxy client with rest interface. We discourage to install immugw in the same machine of immudb in order to respect the security model of our technology.
This kind of istallation is suggested only for testing purpose
sudo ./immuadmin  service immugw install
It's possible to provide a specific executable
sudo ./immuadmin  service immudb install --local-file immudb.exe
Uninstall immudb after 20 second
sudo ./immuadmin  service immudb uninstall --time 20`)

UsageExamples usage examples for linux

Functions

func CheckPrivileges

func CheckPrivileges() (bool, error)

CheckPrivileges check if current user is root

func CopyExecInOsDefault

func CopyExecInOsDefault(execPath string) (newExecPath string, err error)

CopyExecInOsDefault copy the executable in default exec folder and returns the path. It accepts an executable absolute path

func EraseData

func EraseData(serviceName string, vip *viper.Viper) (err error)

EraseData erase all service data

func GetDefaultConfigPath

func GetDefaultConfigPath(serviceName string) (string, error)

GetDefaultConfigPath returns the default config path

func GetDefaultExecPath

func GetDefaultExecPath(localFile string) (string, error)

GetDefaultExecPath returns the default exec path. It accepts an executable or the absolute path of an executable and returns the default exec path using the exec name provided

func GetExecutable

func GetExecutable(input string, serviceName string) (exec string, err error)

GetExecutable checks for the service executable name provided. If it's valid returns the absolute file path If is not valid or not presents try to use an executable presents in current executable folder. If found it returns the absolute file path

func InstallSetup

func InstallSetup(serviceName string, vip *viper.Viper) (err error)

InstallSetup ...

func IsRunning

func IsRunning(status string) bool

IsRunning check if status derives from a running process

func NewDaemon

func NewDaemon(name, description, execStartPath string, dependencies ...string) (d daemon.Daemon, err error)

NewDaemon ...

func RemoveProgramFiles

func RemoveProgramFiles(serviceName string, vip *viper.Viper) (err error)

RemoveProgramFiles remove all program files

func UninstallSetup

func UninstallSetup(serviceName string, vip *viper.Viper) (err error)

UninstallSetup uninstall operations

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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