aboutsummaryrefslogtreecommitdiff
path: root/sendusr1.go
blob: 5de8a6fa855f332858340cec5f1ea9e89ee0492b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package main

import (
	"fmt"
	"os"
	"syscall"
)

// Send signal USR1 to "pid" (usually our parent process). This notifies it
// that the mounting has completed sucessfully.
func sendUsr1(pid int) {
	p, err := os.FindProcess(pid)
	if err != nil {
		fmt.Printf("sendUsr1: FindProcess: %v\n", err)
		return
	}
	err = p.Signal(syscall.SIGUSR1)
	if err != nil {
		fmt.Printf("sendUsr1: Signal: %v\n", err)
	}
}