func (a *journalArgs) copyForBoot(ctx context.Context, w io.Writer, previousBoot int) {
	if ctx.Err() != nil {
		return
	}

	args := a.Args()
	args = append(args, "--boot", fmt.Sprintf("%d", previousBoot))
	cmd := exec.Command("journalctl", args...)
	cmd.Stdout = w
	cmd.Stderr = w

	// force termination
	go func() {
		<-ctx.Done()
		if p := cmd.Process; p != nil {
			p.Kill()
		}
	}()

	if err := cmd.Run(); err != nil {
		if _, ok := err.(*exec.ExitError); ok {
			return
		}
		if previousBoot == 0 {
			fmt.Fprintf(w, "error: journal output not available\n")
		}
	}
}
// copyForBoot invokes the provided args for a named boot record. If previousBoot is != 0, then
// errors are silently ignored.
copyForBoot invokes the provided args for a named boot record. If previousBoot is != 0, then
errors are silently ignored.
// copyForBoot invokes the provided args for a named boot record . If previousBoot is ! = 0 then // errors are silently ignored .
func (a *journalArgs) copyForBoot(ctx context.Context, w io.Writer, previousBoot int) {
	if ctx.Err() != nil {
		return
	}
	args := a.Args()
	args = append(args, "--boot", fmt.Sprintf("%d", previousBoot))
	cmd := exec.Command("journalctl", args...)
	cmd.Stdout = w
	cmd.Stderr = w
	go func() {
		<-ctx.Done()
		if p := cmd.Process; p != nil {
			p.Kill()
		}
	}()
	if err := cmd.Run(); err != nil {
		if _, ok := err.(*exec.ExitError); ok {
			return
		}
		if previousBoot == 0 {
			fmt.Fprintf(w, "error: journal output not available\n")
		}
	}
}
func ( a * journalArgs ) copyForBoot ( ctx context . Context , w io . Writer , previousBoot int ) { if ctx . Err ( ) != nil { return } args := a . Args ( ) args = append ( args , " " , fmt . Sprintf ( " " , previousBoot ) ) cmd := exec . Command ( " " , args ... ) cmd . Stdout = w cmd . Stderr = w go func ( ) { <- ctx . Done ( ) if p := cmd . Process ; p != nil { p . Kill ( ) } } ( ) if err := cmd . Run ( ) ; err != nil { if _ , ok := err . ( * exec . ExitError ) ; ok { return } if previousBoot == 0 { fmt . Fprintf ( w , " \n " ) } } }
copyForBoot invokes the provided args for a named boot record.
copyForBoot invokes the provided args for a named boot record .
// force termination