Adding 'systemctl daemon-reload' command after service is installed.

This commit is contained in:
Michael Fernandes 2022-09-06 10:39:01 -03:00 committed by GitHub
parent c47324b07b
commit 8654e63ba8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,12 +59,21 @@ func installService(cmd *cobra.Command, args []string) {
return
}
command := exec.Command("systemctl", "enable", "--now", serviceFile)
cmd_err := command.Start()
enable_command := exec.Command("systemctl", "enable", "--now", serviceFile)
cmd_enable_err := enable_command.Start()
if cmd_err != nil {
if cmd_enable_err != nil {
log.WithField("error", wf_err).Fatal("error while enabling service")
return
}
daemon_reload_command := exec.Command("systemctl", "daemon-reload")
cmd_reload_err := daemon_reload_command.Start()
if cmd_reload_err != nil {
log.WithField("error", wf_err).Fatal("error while reloading daemon")
return
}
fmt.Println("service created success!")
}