diff --git a/monitor/.gitignore b/monitor/.gitignore index bcc4bd10..97ba05cf 100644 --- a/monitor/.gitignore +++ b/monitor/.gitignore @@ -37,4 +37,6 @@ Makefile.in /Makefile /src/Makefile /src/tacc_stats -/src/.deps \ No newline at end of file +/src/.deps + +*tar.gz \ No newline at end of file diff --git a/monitor/configure.ac b/monitor/configure.ac index 5a87dd12..c9c48152 100644 --- a/monitor/configure.ac +++ b/monitor/configure.ac @@ -1,8 +1,30 @@ -AC_INIT([tacc_stats], [2.3.4], [rtevans@tacc.utexas.edu]) +AC_INIT([tacc_stats], [2.3.5], [rtevans@tacc.utexas.edu]) AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability]) AC_PROG_CC AM_PROG_CC_C_O +AC_ARG_ENABLE([rabbitmq], +[ --enable-rabbitmq Build the rabbitmq version (default is true)], +[case "${enableval}" in + yes) AC_SEARCH_LIBS([amqp_new_connection], [rabbitmq], [have_rabbitmq=yes], + [AC_MSG_ERROR([Unable to find librabbitmq.so!])]) + if test "x${have_rabbitmq}" = xyes; then + AC_CHECK_HEADERS([amqp.h], [rabbitmq=true], + [AC_MSG_ERROR([Unable to find amqp.h!])]) + fi + ;; + no) rabbitmq=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-rabbitmq]) ;; +esac], +[AC_SEARCH_LIBS([amqp_new_connection], [rabbitmq], [have_rabbitmq=yes], + [AC_MSG_ERROR([Unable to find librabbitmq.so!])]) + if test "x${have_rabbitmq}" = xyes; then + AC_CHECK_HEADERS([amqp.h], [rabbitmq=true], + [AC_MSG_ERROR([Unable to find amqp.h!])]) + fi +]) +AM_CONDITIONAL([RABBITMQ], [test x$rabbitmq = xtrue]) + AC_ARG_ENABLE([hardware], [ --enable-hardware Enable processor hardware counter support (default is true)], [case "${enableval}" in @@ -14,7 +36,7 @@ esac], AM_CONDITIONAL([HARDWARE], [test x$hardware = xtrue]) AC_ARG_ENABLE([infiniband], -[ --enable-infiniband Enable Infiniband support (must be set to true or false)], +[ --enable-infiniband Enable Infiniband support (default is true)], [case "${enableval}" in yes) AC_SEARCH_LIBS([mad_rpc_open_port], [ibmad], [have_ib=yes], [AC_MSG_ERROR([Unable to find libibmad.so!])]) @@ -106,30 +128,24 @@ esac], [debug=false]) AM_CONDITIONAL([DEBUG], [test x$debug = xtrue]) -AC_ARG_ENABLE([rabbitmq], -[ --enable-rabbitmq Build the rabbitmq/daemon version (default is false)], -[case "${enableval}" in - yes) rabbitmq=true - AC_SEARCH_LIBS([amqp_new_connection], [rabbitmq], [have_rabbitmq=yes], [have_rabbitmq=no]) - if test "x${have_rabbitmq}" = xno; then - AC_MSG_ERROR([Unable to find rabbitmq library on this system. Stopping...]) - fi - if test "x${have_rabbitmq}" = xyes; then - AC_CHECK_HEADERS([amqp.h], [], [have_rabbitmq=no]) - fi - if test "x${have_rabbitmq}" = xno; then - AC_MSG_ERROR([Unable to find rabbitmq headers on this system. Stopping...]) - fi - ;; - no) rabbitmq=false ;; - *) AC_MSG_ERROR([bad value ${enableval} for --enable-rabbitmq]) ;; -esac], -[rabbitmq=false]) -AM_CONDITIONAL([RABBITMQ], [test x$rabbitmq = xtrue]) - AC_SEARCH_LIBS([ev_run], [ev], [libev=yes], [AC_MSG_ERROR([Failed to find lib libev.so])]) AC_CHECK_HEADERS([ev.h], [ev=true], [AC_MSG_ERROR([Failed to find header ev.h])]) +PKG_PROG_PKG_CONFIG +AC_ARG_WITH([systemduserunitdir], + [AS_HELP_STRING([--with-systemduserunitdir=DIR], [Directory for systemd user service files])],, + [with_systemduserunitdir=auto]) +AS_IF([test "x$with_systemduserunitdir" = "xyes" -o "x$with_systemduserunitdir" = "xauto"], [ + def_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir systemd) + AS_IF([test "x$def_systemduserunitdir" = "x"], + [AS_IF([test "x$with_systemduserunitdir" = "xyes"], + [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])]) + with_systemduserunitdir=no], + [with_systemduserunitdir="$def_systemduserunitdir"])]) +AS_IF([test "x$with_systemduserunitdir" != "xno"], + [AC_SUBST([systemduserunitdir], [$with_systemduserunitdir])]) +AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemduserunitdir" != "xno"]) + AC_CONFIG_FILES([Makefile src/Makefile]) AC_OUTPUT diff --git a/monitor/make-rpm.ls4 b/monitor/make-rpm.ls4 deleted file mode 100755 index 09e9ace2..00000000 --- a/monitor/make-rpm.ls4 +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -set -eu - -version=1.0.3 -tmp=$(mktemp -d $HOME/make-rpm.XXXXXXXX) -topdir=$tmp/redhat - -mkdir -p $topdir/{BUILD,RPMS/{noarch,x86_64},SRPMS,SOURCES,SPECS} -cp $HOME/tacc_stats/tacc_stats.spec $topdir/SPECS/ - -ln -s $HOME/tacc_stats $tmp/tacc_stats-$version - -tar -czf $topdir/SOURCES/tacc_stats-$version.tar.gz -C $tmp tacc_stats-$version/. - -rpmbuild -bb \ - --define "_tmppath $tmp" \ - --define "_topdir $topdir" \ - --define 'config config.ls4' \ - $topdir/SPECS/tacc_stats.spec diff --git a/monitor/src/Makefile.am b/monitor/src/Makefile.am index 373ae843..969d891c 100644 --- a/monitor/src/Makefile.am +++ b/monitor/src/Makefile.am @@ -1,5 +1,14 @@ ACLOCAL_AMFLAGS = -I m4 +AM_DISTCHECK_CONFIGURE_FLAGS = \ + --with-systemduserunitdir=$$dc_install_base/$(systemduserunitdir) + +if HAVE_SYSTEMD +systemduserunit_DATA = \ + taccstats.service \ + taccstats.conf +endif + bin_PROGRAMS = tacc_statsd STATS_DIR_PATH = /var/log/tacc_stats @@ -162,24 +171,4 @@ stats.o: stats.x stats.x: Makefile echo '$(patsubst %.c, X(%),$(sort $(TYPES)))' > $@ -if RABBITMQ -initddir = $(sysconfdir)/rc.d/init.d -initd_SCRIPTS = taccstats -sysconf_DATA = tacc_stats.conf -sysconf_DATA += taccstats.service -BUILT_SOURCES += taccstats -nodist_tacc_statsd_SOURCES += \ - taccstats -CLEANFILES += $(initd_SCRIPTS) $(sysconfdir_DATA) - -do_subst = sed -e 's,@STATS_LOCK_PATH@,$(STATS_LOCK_PATH),g' \ - -e 's,@SYSCONFDIR@,$(sysconfdir),g' \ - -e 's,@PREFIX@,$(bindir),g' -taccstats: taccstats.in Makefile - $(do_subst) < taccstats.in > taccstats - chmod +x taccstats -else -bin_SCRIPTS = archive -endif - -EXTRA_DIST = taccstats.in tacc_stats.conf archive taccstats.service +EXTRA_DIST = taccstats.conf taccstats.service diff --git a/monitor/src/__init__.py b/monitor/src/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/monitor/src/archive b/monitor/src/archive deleted file mode 100644 index d309a1be..00000000 --- a/monitor/src/archive +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# archive: compress the previous day's tacc_stats data -# and archive for analysis. - -PATH=/bin:/usr/bin -umask 0022 - -prog=$(basename $0) -STATS_DIR=/var/log/tacc_stats -ARCHIVE_DIR=$1 -HOST_DIR=$ARCHIVE_DIR/$(hostname --fqdn) - -if [ -z "$STATS_DIR" -o -z "$ARCHIVE_DIR" ]; then - echo "Usage: ${prog} STATS_DIR ARCHIVE_DIR" >&2 - exit 1 -fi - -if ! [ -d $STATS_DIR ]; then - exit 1 -fi - -if ! [ -d $HOST_DIR ] && ! mkdir $HOST_DIR; then - exit 1 -fi - -now=$(date +%s) -for file in $STATS_DIR/*; do - if ! [ -f $file ]; then - continue - fi - base=$(basename $file) - if ! [[ $base =~ ^[[:digit:]]+$ ]]; then - continue - fi - # Skip if file is less than 1 day old. - if ((now - base < 86400)); then - continue - fi - if gzip -c $file > $HOST_DIR/$base.gz; then - rm $file - fi -done diff --git a/monitor/src/archive.sh.in b/monitor/src/archive.sh.in deleted file mode 100644 index 9eede086..00000000 --- a/monitor/src/archive.sh.in +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# archive: compress the previous day's tacc_stats data -# and archive for analysis. - -PATH=/bin:/usr/bin -umask 0022 -source _BINDIR/tacc_stats.conf -prog=$(basename $0) -STATS_DIR=$1 -HOST_DIR=$ARCHIVE_DIR/$(hostname --fqdn) - -if [ -z "$STATS_DIR" -o -z "$ARCHIVE_DIR" ]; then - echo "Usage: ${prog} STATS_DIR ARCHIVE_DIR" >&2 - exit 1 -fi - -if ! [ -d $STATS_DIR ]; then - exit 1 -fi - -if ! [ -d $HOST_DIR ] && ! mkdir $HOST_DIR; then - exit 1 -fi - -now=$(date +%s) -for file in $STATS_DIR/*; do - if ! [ -f $file ]; then - continue - fi - base=$(basename $file) - if ! [[ $base =~ ^[[:digit:]]+$ ]]; then - continue - fi - # Skip if file is less than 1 day old. - if ((now - base < 86400)); then - continue - fi - if gzip -c $file > $HOST_DIR/$base.gz; then - rm $file - fi -done diff --git a/monitor/src/listend.in b/monitor/src/listend.in deleted file mode 100755 index fee7b4ce..00000000 --- a/monitor/src/listend.in +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# -# chkconfig: 12345 99 01 -# description: Starts, stops, restarts and reloads tacc_stats listen daemon - -# Source function library -#. /etc/init.d/functions - -PATH=/bin:/sbin:/usr/bin -PID_FILE=listend_lock -SERVER=server -ARCHIVE=archive_dir - -status() { - pid_status -} - -pid_status() { - if pidof listend > /dev/null; then - if [ "$1" != "quiet" ] ; then - echo "listend is running" - fi - RETVAL=1 - else - if [ "$1" != "quiet" ] ; then - echo "listend is not running" - fi - RETVAL=0 - fi -} - -start() { - pid_status quiet - if [ $RETVAL = 0 ] ; then - echo "starting listend" - amqp_listend -s ${SERVER} -a ${ARCHIVE} - fi -} - -stop() { - pid_status quiet - if [ $RETVAL = 1 ] ; then - echo "stopping listend" - cat ${PID_FILE} | kill -9 `awk '{print $1}'` - rm -f ${PID_FILE} - else - echo "no instance of listend running" - fi -} - -restart() { - stop - start -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status - ;; - restart) - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart}" -esac - -exit $? diff --git a/monitor/src/monitor.c b/monitor/src/monitor.c index 2972d893..81804dbb 100644 --- a/monitor/src/monitor.c +++ b/monitor/src/monitor.c @@ -99,11 +99,12 @@ static void send_stats_buffer(struct stats_buffer *sf) { // collect every enabled type i = 0; while ((type = stats_type_for_each(&i)) != NULL) { + /* if (stats_type_init(type) < 0) { type->st_enabled = 0; continue; } - + */ if (type->st_enabled) (*type->st_collect)(type); } @@ -113,14 +114,18 @@ static void send_stats_buffer(struct stats_buffer *sf) { ERROR("Buffer write and send failed failed : %m\n"); // Cleanup + /* i = 0; while ((type = stats_type_for_each(&i)) != NULL) stats_type_destroy(type); + */ } /* Send header with data based on rotate timer interval */ static void rotate_timer_cb(struct ev_loop *loop, ev_timer *w, int revents) { + pscanf(JOBID_FILE_PATH, "%79s", jobid); + struct stats_buffer sf; if (stats_buffer_open(&sf, server, port, queue) < 0) TRACE("Failed opening data buffer : %m\n"); @@ -142,12 +147,19 @@ static void rotate_timer_cb(struct ev_loop *loop, ev_timer *w, int revents) stats_wr_hdr(&sf); send_stats_buffer(&sf); stats_buffer_close(&sf); + + // Cleanup + i = 0; + while ((type = stats_type_for_each(&i)) != NULL) + stats_type_destroy(type); } /* Send data based on ev timer interval */ static void sample_timer_cb(struct ev_loop *loop, ev_timer *w, int revents) { + pscanf(JOBID_FILE_PATH, "%79s", jobid); + struct stats_buffer sf; if (stats_buffer_open(&sf, server, port, queue) < 0) TRACE("Failed opening data buffer : %m\n"); @@ -204,11 +216,25 @@ static void fd_cb(EV_P_ ev_io *w, int revents) strcpy(jobid, new_jobid); + // Cleanup + i = 0; + while ((type = stats_type_for_each(&i)) != NULL) + stats_type_destroy(type); } /* Signal Callbacks for SIGINT (terminate) and SIGHUP (reload conf file) */ static void signal_cb_int(EV_P_ ev_signal *sig, int revents) { + + size_t i; + struct stats_type *type; + + // Cleanup + /* + i = 0; + while ((type = stats_type_for_each(&i)) != NULL) + stats_type_destroy(type); + */ fprintf(log_stream, "Stopping tacc_statsd\n"); if (pid_fd != -1) { lockf(pid_fd, F_ULOCK, 0); @@ -236,11 +262,11 @@ static void usage(void) "\n" "Mandatory arguments to long options are mandatory for short options too.\n" " -h, --help display this help and exit\n" - " -s [SERVER] or --server [SERVER] Server to send data.\n" " -c [CONFIGFILE] or --configfile [CONFIGFILE] Configuration file to use.\n" - " -q [QUEUE] or --queue [QUEUE] Queue to route data to on RMQ server. \n" - " -p [PORT] or --port [PORT] Port to use (5672 is the default).\n" - " -f [FREQUENCY] or --frequency [FREQUENCY] Frequency to sample (600 seconds is the default).\n" + " -s [SERVER] or --server [SERVER] Server to send data.\n" + " -q [QUEUE] or --queue [QUEUE] Queue to route data to on RMQ server. \n" + " -p [PORT] or --port [PORT] Port to use (5672 is the default).\n" + " -f [FREQUENCY] or --frequency [FREQUENCY] Frequency to sample (600 seconds is the default).\n" , program_invocation_short_name); } @@ -264,7 +290,7 @@ int main(int argc, char *argv[]) }; int c; - while ((c = getopt_long(argc, argv, "hdc:", opts, 0)) != -1) { + while ((c = getopt_long(argc, argv, "hdc:s:q:f:p:", opts, 0)) != -1) { switch (c) { case 'd': daemonmode = 1; @@ -345,13 +371,6 @@ int main(int argc, char *argv[]) ev_run(EV_DEFAULT, 0); - out: - - /* Close log file, when it is used. */ - if (log_stream != stderr) { - fclose(log_stream); - } - /* Write system log and close it. */ fprintf(log_stream, "Stopped %s\n", app_name); diff --git a/monitor/src/tacc_statsd.conf b/monitor/src/tacc_statsd.conf deleted file mode 100644 index eb895842..00000000 --- a/monitor/src/tacc_statsd.conf +++ /dev/null @@ -1,4 +0,0 @@ -server stats.frontera.tacc.utexas.edu -queue frontera -port 5672 -frequency 300 \ No newline at end of file diff --git a/monitor/src/taccstats b/monitor/src/taccstats deleted file mode 100755 index 47e87e1b..00000000 --- a/monitor/src/taccstats +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh -# -# chkconfig: 12345 99 01 -# description: Starts, stops, restarts and reloads tacc_stats monitor daemon - - -PATH=/usr/local/bin:/bin:/sbin:/usr/bin -CONF=/usr/local/etc/tacc_stats.conf -PID_FILE=/var/lock/tacc_stats - -if [ -f $CONF ]; then - . $CONF -else - echo -n $"No $CONF found" - failure - exit -fi - -status() { - pid_status -} - -pid_status() { - if pidof tacc_stats > /dev/null; then - if [ "$1" != "quiet" ] ; then - echo "tacc_stats process is running" - fi - RETVAL=1 - else - if [ "$1" != "quiet" ] ; then - echo "no tacc_stats process running" - fi - RETVAL=0 - fi -} - -start() { - pid_status quiet - if [ $RETVAL = 0 ] ; then - echo "start tacc_stats" - tacc_stats -s ${SERVER} -q ${QUEUE} -p ${PORT} -f ${FREQ} - fi -} - -stop() { - pid_status quiet - if [ $RETVAL = 1 ] ; then - echo "stop tacc_stats" - cat ${PID_FILE} | kill -9 `awk '{print $1}'` - rm -f ${PID_FILE} - logger "Stop tacc_stats" - sleep 0.5 - else - echo "no tacc_stats process running" - fi -} - -restart() { - stop - start -} - -rotate() { - pid_status quiet - if [ $RETVAL = 1 ] ; then - echo "rotating tacc_stats" - cat ${PID_FILE} | kill `awk '{print $1}'` - else - echo "no tacc_stats process running" - fi -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status - ;; - restart) - restart - ;; - rotate) - rotate - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|rotate}" -esac - -exit $? diff --git a/monitor/src/tacc_stats.conf b/monitor/src/taccstats.conf similarity index 80% rename from monitor/src/tacc_stats.conf rename to monitor/src/taccstats.conf index 8ad4d604..5daf9044 100644 --- a/monitor/src/tacc_stats.conf +++ b/monitor/src/taccstats.conf @@ -1,4 +1,4 @@ server localhost queue default port 5672 -freq 600 +freq 300 diff --git a/monitor/src/taccstats.in b/monitor/src/taccstats.in deleted file mode 100755 index 584149fc..00000000 --- a/monitor/src/taccstats.in +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh -# -# chkconfig: 12345 99 01 -# description: Starts, stops, restarts and reloads tacc_stats monitor daemon - - -PATH=@PREFIX@:/bin:/sbin:/usr/bin -CONF=@SYSCONFDIR@/tacc_stats.conf -PID_FILE=@STATS_LOCK_PATH@ - -if [ -f $CONF ]; then - . $CONF -else - echo -n $"No $CONF found" - failure - exit -fi - -status() { - pid_status -} - -pid_status() { - if pidof tacc_stats > /dev/null; then - if [ "$1" != "quiet" ] ; then - echo "tacc_stats process is running" - fi - RETVAL=1 - else - if [ "$1" != "quiet" ] ; then - echo "no tacc_stats process running" - fi - RETVAL=0 - fi -} - -start() { - pid_status quiet - if [ $RETVAL = 0 ] ; then - echo "start tacc_stats" - tacc_stats -s ${SERVER} -q ${QUEUE} -p ${PORT} -f ${FREQ} - fi -} - -stop() { - pid_status quiet - if [ $RETVAL = 1 ] ; then - echo "stop tacc_stats" - cat ${PID_FILE} | kill -9 `awk '{print $1}'` - rm -f ${PID_FILE} - logger "Stop tacc_stats" - sleep 0.5 - else - echo "no tacc_stats process running" - fi -} - -restart() { - stop - start -} - -rotate() { - pid_status quiet - if [ $RETVAL = 1 ] ; then - echo "rotating tacc_stats" - cat ${PID_FILE} | kill `awk '{print $1}'` - else - echo "no tacc_stats process running" - fi -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status - ;; - restart) - restart - ;; - rotate) - rotate - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|rotate}" -esac - -exit $? diff --git a/monitor/tacc_stats-2.3.4.tar.gz b/monitor/tacc_stats-2.3.4.tar.gz deleted file mode 100644 index cd592536..00000000 Binary files a/monitor/tacc_stats-2.3.4.tar.gz and /dev/null differ diff --git a/monitor/tacc_statsd.spec b/monitor/tacc_statsd.spec deleted file mode 100644 index 9697b117..00000000 --- a/monitor/tacc_statsd.spec +++ /dev/null @@ -1,62 +0,0 @@ -Summary: Job-level Tracking and Analysis System -Name: tacc_statsd -Version: 2.3.4 -Release: 5%{?dist} -License: GPL -Vendor: Texas Advanced Computing Center -Group: System Environment/Base -Packager: TACC - rtevans@tacc.utexas.edu -Source: tacc_stats-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root - -%include rpm-dir.inc -%define debug_package %{nil} -%{!?server: %{error: define server!} exit 1 } -%{!?queue: %{error: define queue name!} exit 1} - -%define _bindir /opt/%{name} -%define _sysconfdir /etc/systemd/system - -%description -This package provides the tacc_statsd daemon, along with a systemv -unit file. - -%prep -%setup -n tacc_stats-%{version} - -%build -./configure --bindir=%{_bindir} --sysconfdir=%{_sysconfdir} --enable-rabbitmq -make clean -make - -%install -rm -rf %{buildroot} -cd src -install -m 0755 -d %{buildroot}/%{_bindir} -install -m 0755 -d %{buildroot}/%{_sysconfdir} -install -m 6755 tacc_stats %{buildroot}/%{_bindir}/tacc_stats -install -m 0664 taccstats.service %{buildroot}/%{_sysconfdir}/taccstats.service - -%post -sed -i 's/localhost/%{server}/' %{_sysconfdir}/taccstats.service -sed -i 's/default/%{queue}/' %{_sysconfdir}/taccstats.service -sed -i 's/tacc_statsd/%{name}/' %{_sysconfdir}/taccstats.service - -systemctl daemon-reload -systemctl enable taccstats -#systemctl restart taccstats - -%preun -if [ $1 == 0 ]; then -systemctl stop taccstats -systemctl disable taccstats -fi - -%clean -rm -rf %{buildroot} - -%files -%defattr(-,root,root,-) -%dir %{_bindir}/ -%attr(6755,root,root) %{_bindir}/tacc_stats -%attr(0644,root,root) %{_sysconfdir}/taccstats.service diff --git a/monitor/taccstats.spec b/monitor/taccstats.spec new file mode 100644 index 00000000..4134cc4e --- /dev/null +++ b/monitor/taccstats.spec @@ -0,0 +1,49 @@ +Summary: Job-level Monitoring Client +Name: tacc_stats +Version: 2.3.5 +Release: 1%{?dist} +License: GPL +Vendor: Texas Advanced Computing Center +Group: System Environment/Base +Packager: TACC - rtevans@tacc.utexas.edu +Source: tacc_stats-%{version}.tar.gz +BuildRequires: systemd libev + +%{?systemd_requires} + +%description +This package provides the tacc_statsd daemon, \ +along with a systemd script to provide control. + +%prep +%setup + +%build +./configure +make +sed -i 's/CONFIGFILE/\%{_sysconfdir}\/taccstats\/taccstats.conf/' src/taccstats.service +sed -i 's/localhost/stats.frontera.tacc.utexas.edu/' src/taccstats.conf +sed -i 's/default/frontera/' src/taccstats.conf + +%install +mkdir -p %{buildroot}/%{_sbindir}/ +mkdir -p %{buildroot}/%{_sysconfdir}/taccstats/ +mkdir -p %{buildroot}/%{_unitdir}/ +install -m 744 src/tacc_statsd %{buildroot}/%{_sbindir}/tacc_statsd +install -m 644 src/taccstats.conf %{buildroot}/%{_sysconfdir}/taccstats/taccstats.conf +install -m 644 src/taccstats.service %{buildroot}/%{_unitdir}/taccstats.service + +%files +%{_sbindir}/tacc_statsd +%{_sysconfdir}/taccstats/taccstats.conf +%{_unitdir}/taccstats.service +%dir %{_sysconfdir}/taccstats + +%post +%systemd_post taccstats.service + +%preun +%systemd_preun taccstats.service + +%postun +%systemd_postun_with_restart taccstats.service