- service: "stop" didn't work correctly

Close #1785

Squashed commit of the following:

commit 40eba3049ac339b4e2537b2fd598c2fb1c6e8cd0
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed Jun 10 19:43:14 2020 +0300

    - service: "stop" didn't work correctly
This commit is contained in:
Simon Zolin 2020-06-11 10:24:43 +03:00
parent a79dda5566
commit cf087fb8ff
1 changed files with 5 additions and 5 deletions

View File

@ -110,11 +110,6 @@ func Main(version string, channel string, armVer string) {
// therefore, we must do it manually instead of using a lib
args := loadOptions()
if args.serviceControlAction != "" {
handleServiceControlAction(args.serviceControlAction)
return
}
Context.appSignalChannel = make(chan os.Signal)
signal.Notify(Context.appSignalChannel, syscall.SIGINT, syscall.SIGTERM, syscall.SIGHUP, syscall.SIGQUIT)
go func() {
@ -134,6 +129,11 @@ func Main(version string, channel string, armVer string) {
}
}()
if args.serviceControlAction != "" {
handleServiceControlAction(args.serviceControlAction)
return
}
// run the protection
run(args)
}