From 0e47827d5f461ceb0e67540adba7bc2fe3a360da Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Tue, 29 Jul 2008 13:40:08 -0400 Subject: Ensure that a systemtap server is available if 'server' is specified in EXTRA_TOOL_OPTS for 'make check' and 'make installcheck' --- stap-server | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'stap-server') diff --git a/stap-server b/stap-server index 16ffe8ee..7df324b4 100755 --- a/stap-server +++ b/stap-server @@ -13,6 +13,9 @@ # contained in the unpacked tree to build the requested systemtap kernel module. # This module is then written to stdout. +# Catch ctrl-c and other termination signals +trap 'terminate' SIGTERM SIGINT + #----------------------------------------------------------------------------- # Helper functions. #----------------------------------------------------------------------------- @@ -312,6 +315,7 @@ function call_stap { else server_p_phase=$p_phase fi + eval stap $cmdline -k -p $server_p_phase \ >> $tmpdir_server/stdout \ 2>> $tmpdir_server/stderr @@ -328,19 +332,21 @@ function create_response { tmpdir_line=`cat stderr | grep "Keeping temp"` tmpdir_stap=`expr "$tmpdir_line" : '.*"\(.*\)".*'` - # Remove the message about keeping th Date: Wed, 30 Jul 2008 12:39:51 -0400 Subject: No need for random suffix file cmdline and sysinfo files in the client's request tree. --- stap-server | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'stap-server') diff --git a/stap-server b/stap-server index 7df324b4..e825c49a 100755 --- a/stap-server +++ b/stap-server @@ -146,20 +146,20 @@ function check_compatibility { # function: read_data_file PREFIX # -# Find a file whose name matches '$1.??????' whose first line +# Find a file whose name is '$1' and whose first line # contents are '$1: .*'. Read and echo the first line. function read_data_file { - for f in `ls $1.??????` - do - read < $f - line=$REPLY - data=`expr "$line" : "$1: \\\(.*\\\)"` - if test "X$data" != "X"; then - echo $data - return - fi - done - fatal "ERROR: Data file for $1 not found" + test -f $1 || \ + fatal "ERROR: Data file $1 not found" + + read < $1 + line=$REPLY + data=`expr "$line" : "$1: \\\(.*\\\)"` + if test "X$data" != "X"; then + echo $data + return + fi + fatal "ERROR: Data in file $1 is incorrect" } # function: parse_options [ STAP-OPTIONS ] -- cgit