pid

package module
v0.0.0-...-629745e Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2014 License: GPL-2.0 Imports: 3 Imported by: 1

README

gopid

Go locked PID file library

Documentation

http://godoc.org/github.com/apokalyptik/gopid

Documentation

Overview

Package pid provides an easy, reusable, library for locking and creating a pidfile common to *nix style servives.

import "github.com/apokalyptik/gopid"
var pidFile = "/var/run/my.pid"
_, err := pid.Do(pidFile)
if err != nil {
	log.Fatalf("error creating pidfile: %s", err.Error())
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(filename string, permissions ...uint32) (*os.File, error)

Do does what you want: it creates (or opens) a pidfile, exclusively locks it and writes the current executing programs PID to it. It returns the file descriptor and an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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