diff --git a/comms/conserver/Makefile b/comms/conserver/Makefile index 2324a52ea5f..265a395e285 100644 --- a/comms/conserver/Makefile +++ b/comms/conserver/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.63 2018/09/04 12:46:09 espie Exp $ +# $OpenBSD: Makefile,v 1.64 2019/01/25 11:35:54 sthen Exp $ COMMENT= manage remote serial consoles via TCP/IP V= 8.2.2 -REVISION= 1 +REVISION= 2 DISTNAME= conserver-$V CATEGORIES= comms diff --git a/comms/conserver/pkg/conserver.rc b/comms/conserver/pkg/conserver.rc index d20f029f083..a4352b3f9dc 100755 --- a/comms/conserver/pkg/conserver.rc +++ b/comms/conserver/pkg/conserver.rc @@ -1,6 +1,6 @@ #!/bin/ksh # -# $OpenBSD: conserver.rc,v 1.10 2018/06/01 17:06:21 sthen Exp $ +# $OpenBSD: conserver.rc,v 1.11 2019/01/25 11:35:54 sthen Exp $ daemon="${TRUEPREFIX}/sbin/conserver -d" daemon_flags="-n" @@ -16,4 +16,22 @@ rc_pre() { -m 644 /dev/null /var/log/conserver } +rc_reload() { + if pgrep -T "${daemon_rtable}" -q -xf 'conserver: master.*'; then + pkill -HUP -T "${daemon_rtable}" -xf 'conserver: master.*' + else + pkill -HUP -T "${daemon_rtable}" -xf \ + "(${daemon}${daemon_flags:+ ${daemon_flags}}|conserver: .*)" + fi +} + +rc_stop() { + if pgrep -T "${daemon_rtable}" -q -xf 'conserver: master.*'; then + pkill -T "${daemon_rtable}" -xf 'conserver: master.*' + else + pkill -T "${daemon_rtable}" -xf \ + "(${daemon}${daemon_flags:+ ${daemon_flags}}|conserver: .*)" + fi +} + rc_cmd $1