conf: support relative path of rulefile in systemd service. #52

This commit is contained in:
nadoo 2018-08-30 07:36:46 +08:00
parent 0170fd7c98
commit 140ed9d8eb

View File

@ -75,6 +75,9 @@ func confInit() {
// rulefiles
for _, ruleFile := range conf.RuleFile {
if !path.IsAbs(ruleFile) {
ruleFile = path.Join(flag.ConfDir(), ruleFile)
}
rule, err := rule.NewConfFromFile(ruleFile)
if err != nil {
log.Fatal(err)