[LogService/f16] initial import
Haïkel Guémar
hguemar at fedoraproject.org
Wed Feb 15 16:49:46 UTC 2012
commit e1dd9247a073169b84b6030ce35947c6f382c51a
Author: Haïkel Guémar <hguemar at fedoraproject.org>
Date: Wed Feb 15 14:06:14 2012 +0100
initial import
.gitignore | 1 +
LogCentral.config | 7 ++
LogCentral.init | 101 +++++++++++++++++++++++++++++++++
LogCentral.service | 13 ++++
LogService.spec | 157 ++++++++++++++++++++++++++++++++++++++++++++++++++++
sources | 1 +
6 files changed, 280 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..79073da 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/LogService-2.8.0.tar.gz
diff --git a/LogCentral.config b/LogCentral.config
new file mode 100644
index 0000000..19cf8b3
--- /dev/null
+++ b/LogCentral.config
@@ -0,0 +1,7 @@
+# an empty configuration file for LogService
+[General]
+
+[DynamicTagList]
+[StaticTagList]
+[UniqueTagList]
+[VolatileTagList]
diff --git a/LogCentral.init b/LogCentral.init
new file mode 100644
index 0000000..4664f45
--- /dev/null
+++ b/LogCentral.init
@@ -0,0 +1,101 @@
+#!/bin/sh
+#
+# LogCentral distributed logging server
+#
+# chkconfig: - 20 80
+# description: LogCentral distributed logging server
+
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+exec="/usr/bin/LogCentral"
+prog="LogCentral"
+user="LogCentral"
+config="/etc/sysconfig/LogCentral"
+pidfile="/var/run/LogCentral.pid"
+lockfile=/var/lock/subsys/$prog
+
+cmd="$exec"
+params="-config $config"
+
+[ -f $config ]
+
+
+start() {
+ [ -f $config ] || exit 6
+ echo -n $"Starting $prog: "
+ # we need to rename the running process so we can easily shutdown it
+ daemon --user $user "exec -a $prog $cmd $params &>/dev/null &"
+ retval=$?
+ LogCentral_pid=$(pidofproc LogCentral)
+ [ -n "$LogCentral_pid" ] && echo $LogCentral_pid > $pidfile
+ echo
+ [ $retval -eq 0 ] && touch $lockfile
+ return $retval
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ killproc $prog
+ retval=$?
+ echo
+ [ $retval -eq 0 ] && rm -f $lockfile && rm -f $pidfile
+ return $retval
+}
+
+restart() {
+ stop
+ start
+}
+
+reload() {
+ restart
+}
+
+force_reload() {
+ restart
+}
+
+rh_status() {
+ # run checks to determine if the service is running or use generic status
+ status $prog
+}
+
+rh_status_q() {
+ rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+ start)
+ rh_status_q && exit 0
+ $1
+ ;;
+ stop)
+ rh_status_q || exit 0
+ $1
+ ;;
+ restart)
+ $1
+ ;;
+ reload)
+ rh_status_q || exit 7
+ $1
+ ;;
+ force-reload)
+ force_reload
+ ;;
+ status)
+ rh_status
+ ;;
+ condrestart|try-restart)
+ rh_status_q || exit 0
+ restart
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+ exit 2
+esac
+exit $?
+
diff --git a/LogCentral.service b/LogCentral.service
new file mode 100644
index 0000000..2e99f8a
--- /dev/null
+++ b/LogCentral.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=LogCentral Log Server for distributed applications
+After=syslog.target
+Requires=omniNames.service
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/LogCentral -config /etc/sysconfig/LogCentral
+User=LogCentral
+Group=LogCentral
+
+[Install]
+WantedBy=multi-user.target
\ No newline at end of file
diff --git a/LogService.spec b/LogService.spec
new file mode 100644
index 0000000..99d1a8d
--- /dev/null
+++ b/LogService.spec
@@ -0,0 +1,157 @@
+%if 0%{?fedora} > 14 || 0%{?rhel} > 6
+%global with_systemd 1
+%endif
+
+%global upstream_name LogCentral
+
+Name: LogService
+Version: 2.8.0
+Release: 1%{?dist}
+Summary: DIET middleware logging service
+
+Group: System Environment/Daemons
+License: CeCILL
+URL: http://graal.ens-lyon.fr/DIET/logservice.html
+Source0: %{name}-%{version}.tar.gz
+Source1: %{upstream_name}.init
+Source2: %{upstream_name}.config
+Source3: %{upstream_name}.service
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildRequires: cmake >= 2.6.3
+BuildRequires: chrpath
+BuildRequires: omniORB-devel >= 4.1.2
+BuildRequires: doxygen
+BuildRequires: python-docutils
+%if 0%{?with_systemd}
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+%else
+Requires(post): chkconfig
+Requires(preun): chkconfig
+Requires(pre): shadow-utils
+# This is for /sbin/service
+Requires(postun): initscripts
+%endif
+
+%description
+DIET grid middleware logging service
+
+%package devel
+Summary: Development files for %{name}
+Group: System Environment/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+This package contains development files for %{name}.
+
+%prep
+%setup -q
+
+%build
+%cmake -DLOGSERVICE_BUILD_DOXYGEN:BOOL=ON .
+make %{?_smp_mflags}
+
+
+%install
+rm -rf %{buildroot}
+make install DESTDIR=%{buildroot}
+%if 0%{?with_systemd}
+mkdir -p %{buildroot}/lib/systemd/system/
+install -m 0644 %{SOURCE3} %{buildroot}/lib/systemd/system/
+%else
+# install service init script
+install -D -m0755 %{SOURCE1} %{buildroot}%{_initddir}/%{upstream_name}
+%endif
+# install service configuration file
+install -D -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{upstream_name}
+chrpath --delete %{buildroot}%{_bindir}/*
+chrpath --delete %{buildroot}%{_libdir}/*
+
+%clean
+rm -rf %{buildroot}
+
+%pre
+getent group %{upstream_name} >/dev/null || groupadd -r %{upstream_name}
+getent passwd %{upstream_name} >/dev/null || \
+useradd -r -g %{upstream_name} -d %{_sharedstatedir}/%{upstream_name} -s /sbin/nologin \
+ -c "LogCentral Log Server for distributed applications" %{upstream_name}
+exit 0
+
+
+%if 0%{?with_systemd}
+%post
+if [ $1 -eq 1 ]; then
+ # Package install, not upgrade
+ /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
+/sbin/ldconfig
+
+%preun
+if [ $1 -eq 0 ] ; then
+ # Package removal, not upgrade
+ /bin/systemctl disable %{upstream_name}.service > /dev/null 2>&1 || :
+ /bin/systemctl stop %{upstream_name}.service > /dev/null 2>&1 || :
+fi
+
+%postun
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+ # Package upgrade, not uninstall
+ /bin/systemctl try-restart %{upstream_name}.service >/dev/null 2>&1 || :
+fi
+/sbin/ldconfig
+%else
+%post
+/sbin/chkconfig --add %{upstream_name}
+/sbin/ldconfig
+
+%preun
+if [ $1 = 0 ] ; then
+ /sbin/service stop >/dev/null 2>&1
+ /sbin/chkconfig --del %{upstream_name}
+fi
+
+%postun
+if [ "$1" -ge "1" ] ; then
+ /sbin/service %{nameserver} condrestart >/dev/null 2>&1 || :
+fi
+/sbin/ldconfig
+%endif
+
+%files
+%defattr(-,root,root,-)
+%doc README LICENCE_eng LICENCE_fr
+%if 0%{?with_systemd}
+/lib/systemd/system/%{upstream_name}.service
+%else
+%{_initddir}/%{upstream_name}
+%endif
+%config(noreplace) %{_sysconfdir}/sysconfig/%{upstream_name}
+%{_bindir}/logForwarder
+%{_bindir}/LogCentral
+%{_bindir}/testComponent
+%{_bindir}/DIETtestTool
+%{_libdir}/libLogForwarderUtils.so.%{version}
+%{_libdir}/libLogServiceToolBase.so.%{version}
+%{_libdir}/libLogServiceComponentBase.so.%{version}
+%{_mandir}/man1/*
+
+%files devel
+%defattr(-,root,root,-)
+%doc
+%{_includedir}/*.hh
+%{_libdir}/libLogForwarderUtils.so
+%{_libdir}/libLogServiceToolBase.so
+%{_libdir}/libLogServiceComponentBase.so
+%{_docdir}/%{name}/html/*
+%{_mandir}/man3/*
+
+%changelog
+* Mon Oct 31 2011 Haïkel Guémar <hguemar at fedoraproject.org> - 2.8.0-1
+- upstream 2.8.0
+
+* Wed May 11 2011 Haïkel Guémar <hguemar at fedoraproject.org> - 2.7.0-1
+- first packaging
+
diff --git a/sources b/sources
index e69de29..d81f644 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+ee881dcd6d59b0a3411abfc19ed2f1e1 LogService-2.8.0.tar.gz
More information about the scm-commits
mailing list