net-mgmt/alertmanager: Fix logging

Redirect stdout and stderr of the Alertmanager to its log file with
the daemon(8) -o flag instead of shell redirections. The reason for
this change is that shell redirections simply do not work in this case.

While here, remove an unnecessary env(1) invocation.

Approved by:	portmgr blanket (runtime fix)
Fixes:		df292e75ac
MFH:		2022Q1
Sponsored by:	Ekco
Sponsored by:	Klara Inc

(cherry picked from commit 2ae66e8ad0)
This commit is contained in:
Mateusz Piotrowski 2022-03-03 13:55:12 +01:00
parent dc5ae37717
commit dd54a6ae97
2 changed files with 3 additions and 2 deletions

View file

@ -3,6 +3,7 @@
PORTNAME= alertmanager
PORTVERSION= 0.23.0
DISTVERSIONPREFIX= v
PORTREVISION= 1
CATEGORIES= net-mgmt
MAINTAINER= michal@hanu.la

View file

@ -43,10 +43,10 @@ command="/usr/sbin/daemon"
procname="%%PREFIX%%/bin/alertmanager"
sig_reload=HUP
extra_commands="reload"
command_args="-p ${pidfile} /usr/bin/env ${procname} \
command_args="-o ${alertmanager_log_file} -p ${pidfile} ${procname} \
--config.file=${alertmanager_config} \
--storage.path=${alertmanager_data_dir} \
${alertmanager_args} > ${alertmanager_log_file} 2>&1"
${alertmanager_args}"
start_precmd=alertmanager_startprecmd