diff options
| author | Mattias Andrée <maandree@operamail.com> | 2014-10-29 18:34:48 +0100 |
|---|---|---|
| committer | Mattias Andrée <maandree@operamail.com> | 2014-10-29 18:34:48 +0100 |
| commit | 41e360b48ca77c5e1d6be60e7389fa749051c0b4 (patch) | |
| tree | f927534da990ef5e47c97fbb8983a60166e78bc5 | |
| parent | m (diff) | |
| download | cerberus-logging-41e360b48ca77c5e1d6be60e7389fa749051c0b4.tar.gz cerberus-logging-41e360b48ca77c5e1d6be60e7389fa749051c0b4.tar.bz2 cerberus-logging-41e360b48ca77c5e1d6be60e7389fa749051c0b4.tar.xz | |
need pid of login process
Signed-off-by: Mattias Andrée <maandree@operamail.com>
| -rwxr-xr-x | src/logging | 8 |
1 files changed, 5 insertions, 3 deletions
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 <http://www.gnu.org/licenses/>. -# 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 |
