From edecda6cff1304fca4c47034b7064dcd51bcc33d Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Mon, 21 Dec 2009 11:26:05 -0500 Subject: [PATCH] PR 10247, 10276, 10905: Move remaining client/server tools to libexec. --- Makefile.am | 21 +++++----- Makefile.in | 77 +++++++++++++++++++------------------ stap-authorize-server-cert | 2 +- stap-authorize-signing-cert | 2 +- stap-client | 20 +++++----- stap-find-or-start-server | 4 +- stap-server | 2 +- stap-server-connect.c | 2 +- stap-serverd | 10 ++--- stap-start-server | 6 +-- systemtap.spec | 29 +++++++------- testsuite/lib/systemtap.exp | 5 ++- 12 files changed, 92 insertions(+), 88 deletions(-) diff --git a/Makefile.am b/Makefile.am index e590f65f9..0f21e2485 100644 --- a/Makefile.am +++ b/Makefile.am @@ -24,6 +24,7 @@ man/stapprobes.tcp.3stap man/stapprobes.udp.3stap bin_PROGRAMS = staprun bin_SCRIPTS = stap-report +pkglibexec_PROGRAMS = stapio pkglibexec_SCRIPTS = stap-env oldinclude_HEADERS = includes/sys/sdt.h @@ -34,15 +35,16 @@ bin_SCRIPTS += dtrace if HAVE_NSS man_MANS += stap-authorize-signing-cert.8 -bin_PROGRAMS += stap-sign-module -bin_SCRIPTS += stap-gen-cert stap-authorize-cert stap-authorize-signing-cert +bin_SCRIPTS += stap-authorize-signing-cert +pkglibexec_PROGRAMS += stap-sign-module +pkglibexec_SCRIPTS += stap-gen-cert stap-authorize-cert if BUILD_SERVER man_MANS += stap-client.8 stap-server.8 stap-authorize-server-cert.8 -bin_PROGRAMS += stap-client-connect stap-server-connect -bin_SCRIPTS += stap-client stap-serverd stap-server stap-find-servers \ - stap-start-server stap-find-or-start-server stap-stop-server \ - stap-authorize-server-cert +pkglibexec_PROGRAMS += stap-client-connect stap-server-connect +bin_SCRIPTS += stap-client stap-authorize-server-cert +pkglibexec_SCRIPTS += stap-serverd stap-server stap-find-servers \ + stap-start-server stap-find-or-start-server stap-stop-server endif endif @@ -119,7 +121,7 @@ install-scripts: install-binSCRIPTS install-pkglibexecSCRIPTS sed -i -e "s,\$${PKGLIBEXECDIR},$(pkglibexecdir)/," $(DESTDIR)$(bindir)/$$f; \ done for f in $(pkglibexec_SCRIPTS); do \ - sed -i -e "/INSTALL-HOOK/d;s,exec_prefix=.*,exec_prefix=$(exec_prefix)/bin/,;s,sysconfdir=.*,sysconfdir=$(sysconfdir),;s,pkglibexecdir=.*,pkglibexecdir=$(pkglibexecdir)," $(DESTDIR)$(pkglibexecdir)/$$f; \ + sed -i -e "/INSTALL-HOOK/d;s,exec_prefix=.*,exec_prefix=$(exec_prefix)/bin/,;s,sysconfdir=.*,sysconfdir=$(sysconfdir),;s,pkglibexecdir=.*,pkglibexecdir=$(pkglibexecdir),;s,\$${PKGLIBEXECDIR},$(pkglibexecdir)/," $(DESTDIR)$(pkglibexecdir)/$$f; \ done endif endif @@ -182,7 +184,6 @@ install-exec-hook: # make install, and have "sudo stap ...." or "sudo staprun ...." work later. -pkglibexec_PROGRAMS = stapio CLEANFILES += $(pkglibexec_PROGRAMS) $(pkglibexec_SCRIPTS) if BUILD_TRANSLATOR @@ -308,7 +309,7 @@ DIST_SUBDIRS = testsuite $(SUBDIRS) check-local: SRCDIR=`cd $(srcdir); pwd`; \ PWD=`pwd`; \ - $(MAKE) -C testsuite check SYSTEMTAP_RUNTIME=$$SRCDIR/runtime SYSTEMTAP_TAPSET=$$SRCDIR/tapset LD_LIBRARY_PATH=$$PWD/lib-elfutils:$$PWD/lib-elfutils/systemtap SYSTEMTAP_PATH=$$PWD SYSTEMTAP_INCLUDES=$$PWD/includes RUNTESTFLAGS="$(RUNTESTFLAGS)"; + $(MAKE) -C testsuite check SYSTEMTAP_RUNTIME=$$SRCDIR/runtime SYSTEMTAP_TAPSET=$$SRCDIR/tapset LD_LIBRARY_PATH=$$PWD/lib-elfutils:$$PWD/lib-elfutils/systemtap SYSTEMTAP_PATH=$$PWD SYSTEMTAP_INCLUDES=$$PWD/includes RUNTESTFLAGS="$(RUNTESTFLAGS)" PKGLIBDIR="$(pkglibexecdir)"; installcheck: if test \! -e $(DESTDIR)$(bindir)/stap; then \ @@ -319,7 +320,7 @@ installcheck: echo "$(DESTDIR)$(bindir)/stap is not recent, run make install"; \ exit -1; \ fi; - $(MAKE) -C testsuite installcheck RUNTESTFLAGS="$(RUNTESTFLAGS)" + $(MAKE) -C testsuite installcheck RUNTESTFLAGS="$(RUNTESTFLAGS)" PKGLIBDIR="$(pkglibexecdir)" # Any extra flags, such as: diff --git a/Makefile.in b/Makefile.in index 8c6c26a17..24d7cc2b8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -34,34 +34,34 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -bin_PROGRAMS = staprun$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) \ - $(am__EXEEXT_3) +bin_PROGRAMS = staprun$(EXEEXT) $(am__EXEEXT_1) +pkglibexec_PROGRAMS = stapio$(EXEEXT) $(am__EXEEXT_2) $(am__EXEEXT_3) @BUILD_TRANSLATOR_TRUE@am__append_1 = stap @BUILD_TRANSLATOR_TRUE@am__append_2 = stap.1 @BUILD_TRANSLATOR_TRUE@am__append_3 = dtrace @BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__append_4 = stap-authorize-signing-cert.8 -@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__append_5 = stap-sign-module -@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__append_6 = stap-gen-cert stap-authorize-cert stap-authorize-signing-cert -@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__append_7 = stap-client.8 stap-server.8 stap-authorize-server-cert.8 -@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__append_8 = stap-client-connect stap-server-connect -@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__append_9 = stap-client stap-serverd stap-server stap-find-servers \ -@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@ stap-start-server stap-find-or-start-server stap-stop-server \ -@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@ stap-authorize-server-cert +@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__append_5 = stap-authorize-signing-cert +@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__append_6 = stap-sign-module +@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__append_7 = stap-gen-cert stap-authorize-cert +@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__append_8 = stap-client.8 stap-server.8 stap-authorize-server-cert.8 +@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__append_9 = stap-client-connect stap-server-connect +@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__append_10 = stap-client stap-authorize-server-cert +@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__append_11 = stap-serverd stap-server stap-find-servers \ +@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@ stap-start-server stap-find-or-start-server stap-stop-server @BUILD_TRANSLATOR_FALSE@stap_DEPENDENCIES = -@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__append_10 = install-scripts -@BUILD_ELFUTILS_TRUE@@BUILD_TRANSLATOR_TRUE@am__append_11 = -Iinclude-elfutils -@BUILD_ELFUTILS_TRUE@@BUILD_TRANSLATOR_TRUE@am__append_12 = -Llib-elfutils -Wl,-rpath-link,lib-elfutils \ +@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__append_12 = install-scripts +@BUILD_ELFUTILS_TRUE@@BUILD_TRANSLATOR_TRUE@am__append_13 = -Iinclude-elfutils +@BUILD_ELFUTILS_TRUE@@BUILD_TRANSLATOR_TRUE@am__append_14 = -Llib-elfutils -Wl,-rpath-link,lib-elfutils \ @BUILD_ELFUTILS_TRUE@@BUILD_TRANSLATOR_TRUE@ -Wl,--enable-new-dtags,-rpath,$(pkglibdir) -@BUILD_ELFUTILS_TRUE@@BUILD_TRANSLATOR_TRUE@am__append_13 = stamp-elfutils -@BUILD_ELFUTILS_TRUE@@BUILD_TRANSLATOR_TRUE@am__append_14 = stamp-elfutils -@BUILD_ELFUTILS_TRUE@@BUILD_TRANSLATOR_TRUE@am__append_15 = lib-elfutils/libdw.so -@BUILD_ELFUTILS_TRUE@@BUILD_TRANSLATOR_TRUE@am__append_16 = install-elfutils -@HAVE_NSS_TRUE@am__append_17 = runtime/staprun/modverify.c nsscommon.c -@HAVE_NSS_TRUE@am__append_18 = $(nss_CFLAGS) $(nspr_CFLAGS) -@HAVE_NSS_TRUE@am__append_19 = -lnss3 -lnspr4 -pkglibexec_PROGRAMS = stapio$(EXEEXT) +@BUILD_ELFUTILS_TRUE@@BUILD_TRANSLATOR_TRUE@am__append_15 = stamp-elfutils +@BUILD_ELFUTILS_TRUE@@BUILD_TRANSLATOR_TRUE@am__append_16 = stamp-elfutils +@BUILD_ELFUTILS_TRUE@@BUILD_TRANSLATOR_TRUE@am__append_17 = lib-elfutils/libdw.so +@BUILD_ELFUTILS_TRUE@@BUILD_TRANSLATOR_TRUE@am__append_18 = install-elfutils +@HAVE_NSS_TRUE@am__append_19 = runtime/staprun/modverify.c nsscommon.c +@HAVE_NSS_TRUE@am__append_20 = $(nss_CFLAGS) $(nspr_CFLAGS) +@HAVE_NSS_TRUE@am__append_21 = -lnss3 -lnspr4 @BUILD_TRANSLATOR_TRUE@noinst_PROGRAMS = loc2c-test$(EXEEXT) subdir = . DIST_COMMON = INSTALL NEWS README AUTHORS $(srcdir)/Makefile.in \ @@ -112,14 +112,14 @@ CONFIG_CLEAN_FILES = stap.1 stapprobes.3stap stapfuncs.3stap \ man/stapprobes.snmp.3stap initscript/systemtap \ initscript/stap-server run-stap run-staprun dtrace @BUILD_TRANSLATOR_TRUE@am__EXEEXT_1 = stap$(EXEEXT) -@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__EXEEXT_2 = stap-sign-module$(EXEEXT) -@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__EXEEXT_3 = stap-client-connect$(EXEEXT) \ -@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@ stap-server-connect$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkglibexecdir)" \ "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkglibexecdir)" \ "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" \ "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(oldincludedir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__EXEEXT_2 = stap-sign-module$(EXEEXT) +@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__EXEEXT_3 = stap-client-connect$(EXEEXT) \ +@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@ stap-server-connect$(EXEEXT) pkglibexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) $(pkglibexec_PROGRAMS) @BUILD_TRANSLATOR_TRUE@am_loc2c_test_OBJECTS = \ @@ -369,10 +369,10 @@ man_MANS = stapprobes.3stap stapfuncs.3stap stapvars.3stap \ man/stapprobes.scsi.3stap man/stapprobes.signal.3stap \ man/stapprobes.socket.3stap man/stapprobes.tcp.3stap \ man/stapprobes.udp.3stap $(am__append_2) $(am__append_4) \ - $(am__append_7) -bin_SCRIPTS = stap-report $(am__append_3) $(am__append_6) \ - $(am__append_9) -pkglibexec_SCRIPTS = stap-env + $(am__append_8) +bin_SCRIPTS = stap-report $(am__append_3) $(am__append_5) \ + $(am__append_10) +pkglibexec_SCRIPTS = stap-env $(am__append_7) $(am__append_11) oldinclude_HEADERS = includes/sys/sdt.h @BUILD_TRANSLATOR_TRUE@stap_SOURCES = main.cxx \ @BUILD_TRANSLATOR_TRUE@ parse.cxx staptree.cxx elaborate.cxx translate.cxx \ @@ -384,7 +384,7 @@ oldinclude_HEADERS = includes/sys/sdt.h @BUILD_TRANSLATOR_TRUE@ setupdwfl.cxx @BUILD_TRANSLATOR_TRUE@stap_LDADD = @stap_LIBS@ @sqlite3_LIBS@ @rpm_LIBS@ -@BUILD_TRANSLATOR_TRUE@stap_DEPENDENCIES = $(am__append_15) +@BUILD_TRANSLATOR_TRUE@stap_DEPENDENCIES = $(am__append_17) # Arrange for git_version.h to be regenerated at every "make". # Code fragment is based upon RadeonHD.am. @@ -394,28 +394,31 @@ oldinclude_HEADERS = includes/sys/sdt.h # of foo-bar.c if it is newer than the foo-bar.o file. Using noinst_foo_SOURCES # instead of foo_SOURCES prevents shipping git_version.h in dist tarballs, # which may cause false GIT_FOO readings. -BUILT_SOURCES = git_version.stamp $(am__append_13) -CLEANFILES = git_version.h $(am__append_14) $(pkglibexec_PROGRAMS) \ +BUILT_SOURCES = git_version.stamp $(am__append_15) + +# Why the "id -u" condition? This way, an unprivileged user can run +# make install, and have "sudo stap ...." or "sudo staprun ...." work later. +CLEANFILES = git_version.h $(am__append_16) $(pkglibexec_PROGRAMS) \ $(pkglibexec_SCRIPTS) GIT_VERSION_CMD = $(SHELL) $(top_srcdir)/git_version.sh -PHONIES = $(am__append_10) $(am__append_16) dist-gzip +PHONIES = $(am__append_12) $(am__append_18) dist-gzip @BUILD_TRANSLATOR_TRUE@stap_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ -D_FILE_OFFSET_BITS=64 @BUILD_TRANSLATOR_TRUE@stap_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ -@BUILD_TRANSLATOR_TRUE@stap_CPPFLAGS = $(AM_CPPFLAGS) $(am__append_11) +@BUILD_TRANSLATOR_TRUE@stap_CPPFLAGS = $(AM_CPPFLAGS) $(am__append_13) @BUILD_TRANSLATOR_TRUE@stap_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ \ -@BUILD_TRANSLATOR_TRUE@ $(am__append_12) +@BUILD_TRANSLATOR_TRUE@ $(am__append_14) @BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@stap_client_connect_LDFLAGS = $(AM_LDFLAGS) @BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@stap_server_connect_LDFLAGS = $(AM_LDFLAGS) @BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@stap_sign_module_LDFLAGS = $(AM_LDFLAGS) staprun_SOURCES = runtime/staprun/staprun.c \ runtime/staprun/staprun_funcs.c runtime/staprun/ctl.c \ - runtime/staprun/common.c $(am__append_17) + runtime/staprun/common.c $(am__append_19) staprun_CPPFLAGS = $(AM_CPPFLAGS) staprun_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ -DSINGLE_THREADED \ -fno-strict-aliasing -fno-builtin-strftime \ - -D_FILE_OFFSET_BITS=64 $(am__append_18) + -D_FILE_OFFSET_BITS=64 $(am__append_20) staprun_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ -staprun_LDADD = $(am__append_19) +staprun_LDADD = $(am__append_21) stapio_SOURCES = runtime/staprun/stapio.c \ runtime/staprun/mainloop.c runtime/staprun/common.c \ runtime/staprun/ctl.c \ @@ -1836,7 +1839,7 @@ cscope: @BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@ sed -i -e "s,\$${PKGLIBEXECDIR},$(pkglibexecdir)/," $(DESTDIR)$(bindir)/$$f; \ @BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@ done @BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@ for f in $(pkglibexec_SCRIPTS); do \ -@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@ sed -i -e "/INSTALL-HOOK/d;s,exec_prefix=.*,exec_prefix=$(exec_prefix)/bin/,;s,sysconfdir=.*,sysconfdir=$(sysconfdir),;s,pkglibexecdir=.*,pkglibexecdir=$(pkglibexecdir)," $(DESTDIR)$(pkglibexecdir)/$$f; \ +@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@ sed -i -e "/INSTALL-HOOK/d;s,exec_prefix=.*,exec_prefix=$(exec_prefix)/bin/,;s,sysconfdir=.*,sysconfdir=$(sysconfdir),;s,pkglibexecdir=.*,pkglibexecdir=$(pkglibexecdir),;s,\$${PKGLIBEXECDIR},$(pkglibexecdir)/," $(DESTDIR)$(pkglibexecdir)/$$f; \ @BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@ done @BUILD_ELFUTILS_TRUE@@BUILD_TRANSLATOR_TRUE@stamp-elfutils: config.status @BUILD_ELFUTILS_TRUE@@BUILD_TRANSLATOR_TRUE@ $(MAKE) $(AM_MAKEFLAGS) -C build-elfutils all bin_PROGRAMS= diff --git a/stap-authorize-server-cert b/stap-authorize-server-cert index 19444b0fd..33607b56d 100755 --- a/stap-authorize-server-cert +++ b/stap-authorize-server-cert @@ -27,4 +27,4 @@ if test "X$certdb" = "X"; then certdb=$stap_ssl_db/client fi -${stap_exec_prefix}stap-authorize-cert $certfile $certdb +${stap_pkglibexecdir}stap-authorize-cert $certfile $certdb diff --git a/stap-authorize-signing-cert b/stap-authorize-signing-cert index 643a07bbe..b6e5a98f5 100755 --- a/stap-authorize-signing-cert +++ b/stap-authorize-signing-cert @@ -27,4 +27,4 @@ if test "X$certdb" = "X"; then certdb=$stap_signing_db fi -${stap_exec_prefix}stap-authorize-cert $certfile $certdb +${stap_pkglibexecdir}stap-authorize-cert $certfile $certdb diff --git a/stap-client b/stap-client index e8ee89237..fa11fef03 100755 --- a/stap-client +++ b/stap-client @@ -634,22 +634,22 @@ function find_and_connect_to_server { fi fi - if test `${stap_exec_prefix}stap-find-servers $find_all | grep $address | wc -l` = "0"; then + if test `${stap_pkglibexecdir}stap-find-servers $find_all | grep $address | wc -l` = "0"; then warning "No server is available on $server" 2>> $tmpdir_client/connect continue fi - ssl_db=`${stap_exec_prefix}stap-find-servers $find_all | grep $address | choose_server` + ssl_db=`${stap_pkglibexecdir}stap-find-servers $find_all | grep $address | choose_server` test "X$ssl_db" != "X" && return done else # No servers specified. Find available servers and choose one of them. # Remember which ssl certificate database was used to authenticate the chosen # server. - ssl_db=`${stap_exec_prefix}stap-find-servers $find_all | choose_server` + ssl_db=`${stap_pkglibexecdir}stap-find-servers $find_all | choose_server` test "X$ssl_db" != "X" && return - num_servers=`${stap_exec_prefix}stap-find-servers $find_all | wc -l` + num_servers=`${stap_pkglibexecdir}stap-find-servers $find_all | wc -l` fi if test $num_servers = 0; then @@ -723,8 +723,8 @@ function send_receive { do # Send the request and receive the response using stap-client-connect echo "Attempting connection with $server:$port using certificate database in '$db'" >> $tmpdir_client/connect - ${stap_exec_prefix}stap-client-connect -i $zip_client -o $zip_server -d $db -p $port -h $server >> $tmpdir_client/connect 2>&1 & - wait '%${stap_exec_prefix}stap-client-connect' + ${stap_pkglibexecdir}stap-client-connect -i $zip_client -o $zip_server -d $db -p $port -h $server >> $tmpdir_client/connect 2>&1 & + wait '%${stap_pkglibexecdir}stap-client-connect' test $? = 0 && echo $db && return sleep 1 done @@ -734,8 +734,8 @@ function send_receive { do # Send the request and receive the response using stap-client-connect echo "Attempting connection with $server:$port using certificate database in '$db'" >> $tmpdir_client/connect - ${stap_exec_prefix}stap-client-connect -i $zip_client -o $zip_server -d $db -p $port -h $server >> $tmpdir_client/connect 2>&1 & - wait '%${stap_exec_prefix}stap-client-connect' + ${stap_pkglibexecdir}stap-client-connect -i $zip_client -o $zip_server -d $db -p $port -h $server >> $tmpdir_client/connect 2>&1 & + wait '%${stap_pkglibexecdir}stap-client-connect' test $? = 0 && echo $db && return sleep 1 done @@ -1066,7 +1066,7 @@ function terminate { kill -s SIGTERM '%?staprun' 2>/dev/null # Kill any stap-client-connect job - kill -s SIGTERM '%${stap_exec_prefix}stap-client-connect' 2>/dev/null + kill -s SIGTERM '%${stap_pkglibexecdir}stap-client-connect' 2>/dev/null exit 1 } @@ -1077,7 +1077,7 @@ function terminate { function interrupt { # Kill any stap-client-connect job # SIGINT won't do it. - kill -s SIGTERM '%${stap_exec_prefix}stap-client-connect' 2>/dev/null + kill -s SIGTERM '%${stap_pkglibexecdir}stap-client-connect' 2>/dev/null # If staprun was not running, then exit. cleanup diff --git a/stap-find-or-start-server b/stap-find-or-start-server index 658ee2b12..a9a4cde03 100755 --- a/stap-find-or-start-server +++ b/stap-find-or-start-server @@ -21,10 +21,10 @@ . ${PKGLIBEXECDIR}stap-env # Is there a server available? -${stap_exec_prefix}stap-find-servers >/dev/null 2>&1 && echo 0 && exit 0 +${stap_pkglibexecdir}stap-find-servers >/dev/null 2>&1 && echo 0 && exit 0 # No server available, try to start one. -pid=`${stap_exec_prefix}stap-start-server "$@"` +pid=`${stap_pkglibexecdir}stap-start-server "$@"` if test $? = 0; then echo $pid exit 0 diff --git a/stap-server b/stap-server index e755f72df..d17318954 100755 --- a/stap-server +++ b/stap-server @@ -432,7 +432,7 @@ function create_response { if test $unprivileged = 1 -a $p_phase -ge 4 -a $stap_rc = 0; then modname=$tmpdir_stap/`grep -m1 '^.*\.ko$' stdout` if test "X$modname" != "X"; then - ${stap_exec_prefix}stap-sign-module $modname $ssl_db + ${stap_pkglibexecdir}stap-sign-module $modname $ssl_db fi fi fi diff --git a/stap-server-connect.c b/stap-server-connect.c index f70810a44..e063fd915 100644 --- a/stap-server-connect.c +++ b/stap-server-connect.c @@ -468,7 +468,7 @@ handle_connection(PRFileDesc *tcpSocket) #endif /* Call the stap-server script. */ - stap_server_prefix = getenv("SYSTEMTAP_SERVER_SCRIPTS") ?: BINDIR; + stap_server_prefix = getenv("SYSTEMTAP_SERVER_SCRIPTS") ?: PKGLIBDIR; cmdline = PORT_Alloc(strlen (stap_server_prefix) + sizeof ("/stap-server") + 1 + sizeof (requestFileName) + 1 + sizeof (responseDirName) + 1 + diff --git a/stap-serverd b/stap-serverd index 48f0072dd..f3df884d2 100755 --- a/stap-serverd +++ b/stap-serverd @@ -61,7 +61,7 @@ function initialization { # If no certificate/key database has been specified, then find/create # a local one. if ! test -f $ssl_db/$stap_certfile; then - ${stap_exec_prefix}stap-gen-cert $ssl_db >> $logfile 2>&1 || exit 1 + ${stap_pkglibexecdir}stap-gen-cert $ssl_db >> $logfile 2>&1 || exit 1 # Now add the server's certificate to the client's database, # making it a trusted peer. Do this only if the client has been installed. if test -f `which ${stap_exec_prefix}stap-client 2>/dev/null` -a \ @@ -341,11 +341,11 @@ function advertise_presence { function listen { # The stap-server-connect program will listen forever # accepting requests. - ${stap_exec_prefix}stap-server-connect \ + ${stap_pkglibexecdir}stap-server-connect \ -p $port -n $nss_cert -d $ssl_db -w $nss_pw \ -s "$stap_options" \ >> $logfile 2>&1 & - wait '%${stap_exec_prefix}stap-server-connect' >> $logfile 2>&1 + wait '%${stap_pkglibexecdir}stap-server-connect' >> $logfile 2>&1 } # function: warning [ MESSAGE ] @@ -377,8 +377,8 @@ function terminate { wait '%avahi-publish-service' >> $logfile 2>&1 # Kill any running 'stap-server-connect' job. - kill -s SIGTERM '%${stap_exec_prefix}stap-server-connect' >> $logfile 2>&1 - wait '%${stap_exec_prefix}stap-server-connect' >> $logfile 2>&1 + kill -s SIGTERM '%${stap_pkglibexecdir}stap-server-connect' >> $logfile 2>&1 + wait '%${stap_pkglibexecdir}stap-server-connect' >> $logfile 2>&1 exit } diff --git a/stap-start-server b/stap-start-server index 56893dc28..1225902d6 100755 --- a/stap-start-server +++ b/stap-start-server @@ -18,7 +18,7 @@ startup_timeout=20 # start the server -${stap_exec_prefix}stap-serverd "$@" /dev/null 2>&1 & +${stap_pkglibexecdir}stap-serverd "$@" /dev/null 2>&1 & server_pid=$! # Make sure the server is started @@ -57,7 +57,7 @@ done echo -n "Unable to start a systemtap server: " >&2 if test $server_started = 0; then - echo "${stap_exec_prefix}stap-serverd did not start" >&2 + echo "${stap_pkglibexecdir}stap-serverd did not start" >&2 elif test $avahi_advertising = 0; then echo "avahi is not advertising the server" >&2 elif test $server_listening = 0; then @@ -65,6 +65,6 @@ elif test $server_listening = 0; then fi # If the server partially started, then kill it. -test $server_started = 1 && ${stap_exec_prefix}stap-stop-server $server_pid +test $server_started = 1 && ${stap_pkglibexecdir}stap-stop-server $server_pid exit 1 # server did not start diff --git a/systemtap.spec b/systemtap.spec index b33626f5e..c9a8fbfbd 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -316,7 +316,7 @@ test -e /usr/share/systemtap/runtime/uprobes || mkdir -p /usr/share/systemtap/ru chgrp stap-server /usr/share/systemtap/runtime/uprobes chmod 775 /usr/share/systemtap/runtime/uprobes # As stap-server, generate the certificate used for signing and for ssl. -runuser -s /bin/sh - stap-server -c %{_bindir}/stap-gen-cert >/dev/null +runuser -s /bin/sh - stap-server -c %{_libexecdir}/%{name%}/stap-gen-cert >/dev/null # Authorize the certificate as a trusted ssl peer and as a trusted signer # local host. %{_bindir}/stap-authorize-server-cert %{_localstatedir}/lib/stap-server/.systemtap/ssl/server/stap.cert @@ -406,10 +406,10 @@ exit 0 %defattr(-,root,root) %attr(4111,root,root) %{_bindir}/staprun %{_bindir}/stap-report -%{_bindir}/stap-authorize-cert %{_bindir}/stap-authorize-signing-cert %{_libexecdir}/%{name} %{_libexecdir}/%{name}/stap-env +%{_libexecdir}/%{name}/stap-authorize-cert %{_mandir}/man8/staprun.8* %{_mandir}/man8/stap-authorize-signing-cert.8* @@ -422,29 +422,26 @@ exit 0 %files client %defattr(-,root,root) %{_bindir}/stap-client -%{_bindir}/stap-find-servers %{_bindir}/stap-authorize-server-cert -%{_bindir}/stap-client-connect +%{_libexecdir}/%{name}/stap-find-servers +%{_libexecdir}/%{name}/stap-client-connect %{_mandir}/man8/stap-client.8* %{_mandir}/man8/stap-authorize-server-cert.8* %files server %defattr(-,root,root) -%{_bindir}/stap-server -%{_bindir}/stap-serverd -%{_bindir}/stap-start-server -%{_bindir}/stap-find-servers -%{_bindir}/stap-find-or-start-server -%{_bindir}/stap-stop-server -%{_bindir}/stap-gen-cert -%{_bindir}/stap-authorize-cert %{_bindir}/stap-authorize-server-cert -%{_bindir}/stap-authorize-signing-cert -%{_bindir}/stap-server-connect -%{_bindir}/stap-sign-module +%{_libexecdir}/%{name}/stap-server +%{_libexecdir}/%{name}/stap-serverd +%{_libexecdir}/%{name}/stap-start-server +%{_libexecdir}/%{name}/stap-find-servers +%{_libexecdir}/%{name}/stap-find-or-start-server +%{_libexecdir}/%{name}/stap-stop-server +%{_libexecdir}/%{name}/stap-gen-cert +%{_libexecdir}/%{name}/stap-server-connect +%{_libexecdir}/%{name}/stap-sign-module %{_mandir}/man8/stap-server.8* %{_mandir}/man8/stap-authorize-server-cert.8* -%{_mandir}/man8/stap-authorize-signing-cert.8* %{_sysconfdir}/rc.d/init.d/stap-server %dir %{_sysconfdir}/stap-server %dir %{_sysconfdir}/stap-server/conf.d diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index 2c46e30fe..34ac3b044 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -134,10 +134,13 @@ proc setup_server {} { # Server management scripts and data are installed if this is an # install test, otherwise there is some setup to do. + # Make sure the server management scripts and tools are on the $PATH. if {! [installtest_p]} then { - # Make sure the server management scripts and tools are on the $PATH. set env(PATH) "$srcdir/..:[exec pwd]/..:$env(PATH)" set env(SYSTEMTAP_SERVER_SCRIPTS) "$srcdir/.." + } else { + set env(PATH) "$env(PKGLIBDIR):$env(PATH)" + set env(SYSTEMTAP_SERVER_SCRIPTS) env(PKGLIBDIR) } # Try to find or start the server. -- 2.43.5