<commit_before>package main

import (
	"os"
	"os/signal"
	"syscall"
)

type DaemonCommand struct{}

func (c *DaemonCommand) Execute(args []string) error {
	EnsureSudo()

	shutdown := make(chan os.Signal, 1)
	signal.Notify(shutdown, os.Interrupt, syscall.SIGTERM, os.Kill)
	go func() {
		<-shutdown
		ShutdownVM()
	}()

	config, err := ReadConfig()
	if err != nil {
		return err
	}

	done := StartVM(config)
	ip, err := GetIP(config.Uuid)
	if err != nil {
		return err
	}

	err = AddHost(config.Hostname, ip)
	if err != nil {
		return err
	}

	err = AddSSHConfig(config.Hostname, ip)
	if err != nil {
		return err
	}

	if config.Route {
		err := AddRoute(config)
		if err != nil {
			return err
		}
	}

	return Proxy(ip, done)
}

func init() {
	var daemonCommand DaemonCommand
	cmd.AddCommand("daemon", "internal use", "this command runs the daemon and is intended for internal use only", &daemonCommand)
}
<commit_msg>be consistent, remove the socket file on shutdown<commit_after>package main

import (
	"os"
	"os/signal"
	"syscall"
)

type DaemonCommand struct{}

func (c *DaemonCommand) Execute(args []string) error {
	EnsureSudo()

	shutdown := make(chan os.Signal, 1)
	signal.Notify(shutdown, syscall.SIGINT, syscall.SIGTERM, syscall.SIGKILL)
	go func() {
		<-shutdown
		ShutdownVM()
		os.RemoveAll("/var/run/docker.sock")
	}()

	config, err := ReadConfig()
	if err != nil {
		return err
	}

	done := StartVM(config)
	ip, err := GetIP(config.Uuid)
	if err != nil {
		return err
	}

	err = AddHost(config.Hostname, ip)
	if err != nil {
		return err
	}

	err = AddSSHConfig(config.Hostname, ip)
	if err != nil {
		return err
	}

	if config.Route {
		err := AddRoute(config)
		if err != nil {
			return err
		}
	}

	return Proxy(ip, done)
}

func init() {
	var daemonCommand DaemonCommand
	cmd.AddCommand("daemon", "internal use", "this command runs the daemon and is intended for internal use only", &daemonCommand)
}

{'fraction_non_alphanumeric': 0.13222280062467465, 'fraction_numerical': 0.001041124414367517, 'mean_word_length': 3.6878048780487807, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6215043', 'n_tokens_mistral': 764, 'n_tokens_neox': 709, 'n_words': 198}