Date: Fri, 27 Mar 2020 16:02:49 +0000 (UTC) From: Dirk Meyer <dinoex@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r529266 - in head/security: tinc tinc-devel tinc-devel/files tinc/files Message-ID: <202003271602.02RG2nm9026172@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dinoex Date: Fri Mar 27 16:02:48 2020 New Revision: 529266 URL: https://svnweb.freebsd.org/changeset/ports/529266 Log: - fix "service tincd status" for multiple instances PR: 245095 Submitted by: errit@weinberg2.de Modified: head/security/tinc-devel/Makefile head/security/tinc-devel/files/tincd.in head/security/tinc/Makefile head/security/tinc/files/tincd.in Modified: head/security/tinc-devel/Makefile ============================================================================== --- head/security/tinc-devel/Makefile Fri Mar 27 15:55:37 2020 (r529265) +++ head/security/tinc-devel/Makefile Fri Mar 27 16:02:48 2020 (r529266) @@ -2,7 +2,7 @@ PORTNAME= tinc PORTVERSION= 1.1pre17 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= security net-vpn MASTER_SITES= https://www.tinc-vpn.org/packages/ \ http://www.tinc-vpn.org/packages/ Modified: head/security/tinc-devel/files/tincd.in ============================================================================== --- head/security/tinc-devel/files/tincd.in Fri Mar 27 15:55:37 2020 (r529265) +++ head/security/tinc-devel/files/tincd.in Fri Mar 27 16:02:48 2020 (r529266) @@ -30,6 +30,7 @@ command="%%PREFIX%%/sbin/tinc" start_cmd="tincd_start" stop_cmd="tincd_stop" reload_cmd="tincd_reload" +status_cmd="tincd_status" extra_commands="reload" procname=${command:-tincd} ldconfig_command="/sbin/ldconfig" @@ -82,6 +83,29 @@ tincd_reload() do echo "Sending reload to tincd for: ${cfg}" $command -n $cfg reload + done + fi +} +tincd_status_network() { + if [ -n "$rc_pid" ]; then + echo "${name} for ${cfg} is running as pid $rc_pid." + else + echo "${name} for ${cfg} is not running." + return 1 + fi +} +tincd_status() +{ + if test -z "${tincd_cfg}" + then + cfg="." + rc_pid=$($command pid) + tincd_status_network + else + for cfg in $tincd_cfg + do + rc_pid=$($command -n $cfg pid) + tincd_status_network done fi } Modified: head/security/tinc/Makefile ============================================================================== --- head/security/tinc/Makefile Fri Mar 27 15:55:37 2020 (r529265) +++ head/security/tinc/Makefile Fri Mar 27 16:02:48 2020 (r529266) @@ -3,6 +3,7 @@ PORTNAME= tinc PORTVERSION= 1.0.36 +PORTREVISION= 1 CATEGORIES= security net-vpn MASTER_SITES= https://www.tinc-vpn.org/packages/ \ http://www.tinc-vpn.org/packages/ Modified: head/security/tinc/files/tincd.in ============================================================================== --- head/security/tinc/files/tincd.in Fri Mar 27 15:55:37 2020 (r529265) +++ head/security/tinc/files/tincd.in Fri Mar 27 16:02:48 2020 (r529266) @@ -30,6 +30,7 @@ command="%%PREFIX%%/sbin/tincd" start_cmd="tincd_start" stop_cmd="tincd_stop" reload_cmd="tincd_reload" +status_cmd="tincd_status" extra_commands="reload" procname=${command:-tincd} ldconfig_command="/sbin/ldconfig" @@ -82,6 +83,30 @@ tincd_reload() do echo "Sending HUP to tincd for: ${cfg}" $command -n $cfg --kill=HUP + done + fi +} +tincd_status_network() { + rc_pid=$(check_pidfile "$pidfile" "$_procname" "$command_interpreter") + if [ -n "$rc_pid" ]; then + echo "${name} for ${cfg} is running as pid $rc_pid." + else + echo "${name} for ${cfg} is not running." + return 1 + fi +} +tincd_status() +{ + if test -z "${tincd_cfg}" + then + cfg="." + pidfile="/var/run/tinc.pid" + tincd_status_network + else + for cfg in $tincd_cfg + do + pidfile="/var/run/tinc.${cfg}.pid" + tincd_status_network done fi }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202003271602.02RG2nm9026172>