Documentation ¶
Index ¶
- Constants
- func CheckUser(cfg config.Cfg) bool
- func CleanTmpDir() bool
- func DirectoryExists(dir string) (bool, os.FileInfo)
- func ExecCommand(fullCommand string, arg ...string) ([]byte, int, error)
- func FileExists(fn string) (bool, os.FileInfo)
- func MkDir(name string, cfg config.Cfg) bool
- func PackageAction(cmdstr string, name string) (bool, error)
- func PackageInfo(cmdstr string, name string) ([]string, error)
- func RandomDuration(max time.Duration) time.Duration
- func ReadFile(fn string) ([]byte, error)
- func ServiceStart(service string, cmd string) (bool, error)
- func Touch(fn string) error
- func WriteFile(fn string, data []byte, perm os.FileMode) (int, error)
- func WriteFileWithOwner(fn string, data []byte, uid int, gid int, perm os.FileMode) (int, error)
- type FileLock
- type ServiceStatus
Constants ¶
View Source
const OneWeek = 604800
Variables ¶
This section is empty.
Functions ¶
func CleanTmpDir ¶
func CleanTmpDir() bool
func PackageInfo ¶
runs the rpm command. if the return code from rpm == 0, then a valid package list is returned.
if the return code is 1, the the 'name' queried for is not part of a
package or is not installed.
otherwise, if the return code is not 0 or 1 and error is set, a general rpm command execution error is assumed and the error is returned.
func ServiceStart ¶
start or restart the service 'service'. cmd is 'start | restart'
Types ¶
type FileLock ¶
type FileLock struct {
// contains filtered or unexported fields
}
func (*FileLock) UnlockAndExit ¶
Releases a file lock and exits with the given status code.
type ServiceStatus ¶
type ServiceStatus int
const ( SvcNotRunning ServiceStatus = 0 SvcRunning ServiceStatus = 1 SvcUnknown ServiceStatus = 2 )
func GetServiceStatus ¶
func GetServiceStatus(name string) (ServiceStatus, int, error)
func (ServiceStatus) String ¶
func (s ServiceStatus) String() string
Click to show internal directories.
Click to hide internal directories.