10000 GitHub - suntoucha/pidfile: Simple implementation of PID file
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

suntoucha/pidfile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

pidfile

Tiny library which implements basic work with PID File.

import "github.com/awskii/pidfile"

As easy as:

package main

import "github.com/awskii/pidfile"

func main() {
    pf := pidfile.Init("name_of_pid_file")

    // Checking pid file. If there is no process with same PID,
    // err will be nil
    if err := pf.TryLock(); err != nil {
        fmt.Println(err)
        return
    }
    defer pf.Remove() // removing pid file after usage

    // some code here
}

About

Simple implementation of PID file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0