<commit_before>package ulogd

import (
	"io"
	"os"
	"os/exec"

	"github.com/weaveworks/weave/common"
)

func waitForExit(cmd *exec.Cmd) {
	if err := cmd.Wait(); err != nil {
		common.Log.Fatalf("ulogd terminated: %v", err)
	}
	common.Log.Fatal("ulogd terminated normally")
}

func Start() error {
	cmd := exec.Command("/usr/sbin/ulogd", "-v")
	stdout, err := cmd.StderrPipe()
	if err != nil {
		return err
	}
	if err := cmd.Start(); err != nil {
		return err
	}
	go io.Copy(os.Stdout, stdout)
	go waitForExit(cmd)
	return nil
}<commit_msg>SIGKILL ulogd on weave-npc exit<commit_after>package ulogd

import (
	"io"
	"os"
	"os/exec"
	"syscall"

	"github.com/weaveworks/weave/common"
)

func waitForExit(cmd *exec.Cmd) {
	if err := cmd.Wait(); err != nil {
		common.Log.Fatalf("ulogd terminated: %v", err)
	}
	common.Log.Fatal("ulogd terminated normally")
}

func Start() error {
	cmd := exec.Command("/usr/sbin/ulogd", "-v")
	cmd.SysProcAttr = &syscall.SysProcAttr{
		Pdeathsig: syscall.SIGKILL,
	}
	stdout, err := cmd.StderrPipe()
	if err != nil {
		return err
	}
	if err := cmd.Start(); err != nil {
		return err
	}
	go io.Copy(os.Stdout, stdout)
	go waitForExit(cmd)
	return nil
}
{'fraction_non_alphanumeric': 0.1693480101608806, 'fraction_numerical': 0.0, 'mean_word_length': 3.746987951807229, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1259227', 'n_tokens_mistral': 508, 'n_tokens_neox': 486, 'n_words': 109}