summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-10-20 16:11:56 -0400
committerDave Brolley <brolley@redhat.com>2009-10-20 16:11:56 -0400
commit09070e8a586fa1d7592f9b35c9413c6cfdc8a477 (patch)
treeb80f0fea668021686014277fbd410921df50e9cb
parent52a5a179bf1b5d6d90af65bcdcd689b6bfecd7df (diff)
downloadsystemtap-steved-09070e8a586fa1d7592f9b35c9413c6cfdc8a477.tar.gz
systemtap-steved-09070e8a586fa1d7592f9b35c9413c6cfdc8a477.tar.xz
systemtap-steved-09070e8a586fa1d7592f9b35c9413c6cfdc8a477.zip
stap-server initscript is now part of the systemtap-server package.
-rw-r--r--initscript/stap-server.in26
-rw-r--r--systemtap.spec22
2 files changed, 30 insertions, 18 deletions
diff --git a/initscript/stap-server.in b/initscript/stap-server.in
index ccd52719..aad6b064 100644
--- a/initscript/stap-server.in
+++ b/initscript/stap-server.in
@@ -106,13 +106,15 @@ parse_args () { # arguments
CONFIG=$2
shift 1
;;
+ --)
+ ;;
*)
error=1
;;
esac
shift 1
done
- test error=1 && echo_usage
+ test error = 1 && echo_usage
}
CMD=$1
@@ -127,7 +129,9 @@ fi
parse_args $OPTS
# Include configs
-. "$CONFIG"
+if [ -f "$CONFIG" ]; then
+ . "$CONFIG"
+fi
for f in "$CONFIG_PATH"/*.conf; do
if [ -f "$f" ]; then
@@ -170,11 +174,12 @@ stop () {
}
status () {
+ local ret=0
+
# Print the status here
- do_failure $"$prog status not implemented"
+ echo $"$prog status not implemented"
- do_success $"$prog status"
- return 0
+ return $ret
}
# Cleanup caches
@@ -184,17 +189,16 @@ cleanup () {
# Clean up the server(s) here
do_failure $"$prog cleanup not implemented"
- do_success $"$prog cleanup"
+ do_success "done"
return 0
}
# Restart scripts
function restart () {
- # Restart the server(s) here
- do_failure $"$prog restart not implemented"
-
- do_success $"$prog restart"
- return 0
+ stop
+ echo
+ start
+ return $?
}
RETVAL=0
diff --git a/systemtap.spec b/systemtap.spec
index 53803193..d5a4cbf2 100644
--- a/systemtap.spec
+++ b/systemtap.spec
@@ -121,7 +121,7 @@ Summary: Instrumentation System Server
Group: Development/System
License: GPLv2+
URL: http://sourceware.org/systemtap/
-Requires: systemtap
+Requires: systemtap initscripts
Requires: avahi avahi-tools nss nss-tools mktemp
Requires: zip unzip
@@ -147,7 +147,7 @@ URL: http://sourceware.org/systemtap/
Requires: systemtap-runtime, initscripts
%description initscript
-Initscripts for Systemtap scripts and Systemtap compile server.
+Initscript for Systemtap scripts
%if %{with_grapher}
%package grapher
@@ -276,6 +276,7 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/systemtap/script.d
install -m 644 initscript/config $RPM_BUILD_ROOT%{_sysconfdir}/systemtap
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/cache/systemtap
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/systemtap
+
install -m 755 initscript/stap-server $RPM_BUILD_ROOT%{_sysconfdir}/init.d/
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/stap-server
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/stap-server/conf.d
@@ -288,14 +289,20 @@ getent group stapdev >/dev/null || groupadd -r stapdev
getent group stapusr >/dev/null || groupadd -r stapusr
exit 0
+%post server
+chkconfig --add stap-server
+exit 0
+
+%preun server
+chkconfig --del stap-server
+exit 0
+
%post initscript
chkconfig --add systemtap
-chkconfig --add stap-server
exit 0
%preun initscript
chkconfig --del systemtap
-chkconfig --del stap-server
exit 0
%post
@@ -378,6 +385,10 @@ exit 0
%{_bindir}/stap-server-connect
%{_bindir}/stap-sign-module
%{_mandir}/man8/stap-server.8*
+%{_sysconfdir}/init.d/stap-server
+%dir %{_sysconfdir}/stap-server
+%dir %{_sysconfdir}/stap-server/conf.d
+%doc initscript/README.initscript
%files sdt-devel
%defattr(-,root,root)
@@ -393,9 +404,6 @@ exit 0
%config(noreplace) %{_sysconfdir}/systemtap/config
%dir %{_localstatedir}/cache/systemtap
%dir %{_localstatedir}/run/systemtap
-%{_sysconfdir}/init.d/stap-server
-%dir %{_sysconfdir}/stap-server
-%dir %{_sysconfdir}/stap-server/conf.d
%doc initscript/README.initscript
%if %{with_grapher}