From 41e360b48ca77c5e1d6be60e7389fa749051c0b4 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 29 Oct 2014 18:34:48 +0100 Subject: need pid of login process MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/logging | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/logging') diff --git a/src/logging b/src/logging index 73b2764..ce879b5 100755 --- a/src/logging +++ b/src/logging @@ -18,11 +18,12 @@ # along with this program. If not, see . -# Login username, client hostname if non-local, ttyname and cerberus-hook +# Login username, client hostname if non-local, ttyname, cerberus-hook and PID username= hostname= ttyname="$(tty | cut -d / -f 1,2 --complement)" hook="${1}" +pid=$PPID # Remove the hookname from $@ shift 1 @@ -100,11 +101,12 @@ fi action=--action="${action}" username=--username="${username}" ttyname=--ttyname="${ttyname}" +pid=--pid="${pid}" # Call the logging programs if [ "${hostname}" = "" ]; then - "log-${hook}" "${action}" "${username}" "${ttyname}" + "log-${hook}" "${action}" "${username}" "${ttyname}" "${pid}" else - "log-${hook}" "${action}" "${username}" "${ttyname}" --hostname="${hostname}" + "log-${hook}" "${action}" "${username}" "${ttyname}" "${pid}" --hostname="${hostname}" fi -- cgit v1.2.3-70-g09d2