Projects
Kolab:3.4
bonnie
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 25
View file
bonnie.spec
Changed
@@ -1,67 +1,108 @@ -Name: bonnie -Version: 0.1.0 -Release: 1%{?dist} -Summary: Bonnie for Kolab Groupware +%if 0%{?opensuse_bs} +#!BuildIgnore: systemd +%endif -Group: Applications/System -License: GPLv3+ -URL: https://kolab.org -Source0: %{name}-%{version}.tar.gz +%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -BuildArch: noarch +%if 0%{?suse_version} || 0%{?fedora} > 17 || 0%{?rhel} > 6 +%global with_systemd 1 +%{!?_unitdir: %global _unitdir /usr/lib/systemd/system/} +%else +%global with_systemd 0 +%endif -#BuildRequires: -#Requires: +%global bonnie_user bonnie +%global bonnie_user_id 415 +%global bonnie_group bonnie +%global bonnie_group_id 415 + +Name: bonnie +Version: 0.1.1 +Release: 1%{?dist} +Summary: Bonnie for Kolab Groupware + +Group: Applications/System +License: GPLv3+ +URL: https://kolab.org +Source0: %{name}-%{version}.tar.gz + +BuildArch: noarch + +Requires(pre): /usr/sbin/useradd +Requires(pre): /usr/sbin/usermod +Requires(pre): /usr/sbin/groupadd + +%if 0%{?with_systemd} +%if 0%{?suse_version} +Requires(post): systemd +Requires(postun): systemd +Requires(preun): systemd +%else +%if 0%{?opensuse_bs} == 0 +Requires(post): systemd-units +Requires(postun): systemd-units +Requires(preun): coreutils +Requires(preun): systemd-units +%endif +%endif +%else +Requires(post): chkconfig +Requires(post): initscripts +Requires(postun): initscripts +Requires(preun): chkconfig +Requires(preun): initscripts +%endif %description Bonnie for Kolab Groupware %package broker -Summary: The Bonnie broker -Group: Applications/System -Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} -Requires: python-zmq +Summary: The Bonnie broker +Group: Applications/System +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: python-sqlalchemy +Requires: python-zmq %description broker Bonnie for Kolab Groupware %package collector -Summary: The Bonnie collector -Group: Applications/System -Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} -Requires: python-zmq +Summary: The Bonnie collector +Group: Applications/System +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: python-zmq %description collector Bonnie for Kolab Groupware %package dealer -Summary: The Bonnie dealer -Group: Applications/System -Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} -Requires: python-zmq +Summary: The Bonnie dealer +Group: Applications/System +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: python-zmq %description dealer Bonnie for Kolab Groupware %package worker -Summary: The Bonnie worker -Group: Applications/System -Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} -Requires: python-elasticsearch >= 1.0 -Requires: python-zmq +Summary: The Bonnie worker +Group: Applications/System +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: python-elasticsearch >= 1.0 +Requires: python-zmq %description worker Bonnie for Kolab Groupware %package wui -Summary: The Bonnie Web UI -Group: Applications/System -Requires: python-flask -Requires: python-flask-bootstrap -Requires: python-flask-httpauth -Requires: python-flask-login -Requires: python-flask-script -Requires: python-flask-sqlalchemy +Summary: The Bonnie Web UI +Group: Applications/System +Requires: python-flask +Requires: python-flask-bootstrap +Requires: python-flask-httpauth +Requires: python-flask-login +Requires: python-flask-script +Requires: python-flask-sqlalchemy %description wui Bonnie for Kolab Groupware @@ -74,24 +115,163 @@ %install mkdir -p \ %{buildroot}/%{_sysconfdir}/%{name} \ - %{buildroot}/%{_bindir} \ + %{buildroot}/%{_sbindir} \ %{buildroot}/%{python_sitelib} %{__install} -m640 -p conf/bonnie.conf %{buildroot}/%{_sysconfdir}/%{name} -%{__install} -m755 -p broker.py %{buildroot}/%{_bindir}/bonnie-broker -%{__install} -m755 -p collector.py %{buildroot}/%{_bindir}/bonnie-collector -%{__install} -m755 -p dealer.py %{buildroot}/%{_bindir}/bonnie-dealer -%{__install} -m755 -p worker.py %{buildroot}/%{_bindir}/bonnie-worker - -chmod 755 %{buildroot}/%{_bindir}/bonnie-* +%{__install} -m755 -p broker.py %{buildroot}/%{_sbindir}/bonnie-broker +%{__install} -m755 -p collector.py %{buildroot}/%{_sbindir}/bonnie-collector +%{__install} -m755 -p dealer.py %{buildroot}/%{_sbindir}/bonnie-dealer +%{__install} -m755 -p worker.py %{buildroot}/%{_sbindir}/bonnie-worker %{__cp} -a bonnie %{buildroot}/%{python_sitelib} +%if 0%{?with_systemd} +mkdir -p %{buildroot}/%{_unitdir} +%{__install} -p -m 644 contrib/bonnie-broker.systemd %{buildroot}/%{_unitdir}/bonnie-broker.service +%{__install} -p -m 644 contrib/bonnie-collector.systemd %{buildroot}/%{_unitdir}/bonnie-collector.service +%{__install} -p -m 644 contrib/bonnie-worker.systemd %{buildroot}/%{_unitdir}/bonnie-worker.service +mkdir -p %{buildroot}/%{_prefix}/lib/tmpfiles.d/ +%{__install} -p -m 644 contrib/bonnie.tmpfiles.d.conf %{buildroot}/%{_prefix}/lib/tmpfiles.d/bonnie.conf +mkdir -p %{buildroot}/run +%{__install} -d -m 755 %{buildroot}/run/bonnie +%else +mkdir -p %{buildroot}/%{_initddir} +%{__install} -p -m 755 contrib/bonnie-broker.sysvinit %{buildroot}/%{_initrddir}/bonnie-broker +%{__install} -p -m 755 contrib/bonnie-collector.sysvinit %{buildroot}/%{_initrddir}/bonnie-collector +%{__install} -p -m 755 contrib/bonnie-worker.sysvinit %{buildroot}/%{_initrddir}/bonnie-worker +%endif + +%if 0%{?suse_version} +mkdir -p %{buildroot}/%{_var}/adm/fillup-templates/ +%{__install} -p -m 644 contrib/bonnie-broker.sysconfig %{buildroot}/%{_var}/adm/fillup-templates/sysconfig.bonnie-broker +%{__install} -p -m 644 contrib/bonnie-collector.sysconfig %{buildroot}/%{_var}/adm/fillup-templates/sysconfig.bonnie-collector +%{__install} -p -m 644 contrib/bonnie-worker.sysconfig %{buildroot}/%{_var}/adm/fillup-templates/sysconfig.bonnie-worker +%else +mkdir -p %{buildroot}/%{_sysconfdir}/sysconfig +%{__install} -p -m 644 contrib/bonnie-worker.sysconfig %{buildroot}/%{_sysconfdir}/sysconfig/bonnie-broker +%{__install} -p -m 644 contrib/bonnie-worker.sysconfig %{buildroot}/%{_sysconfdir}/sysconfig/bonnie-collector +%{__install} -p -m 644 contrib/bonnie-worker.sysconfig %{buildroot}/%{_sysconfdir}/sysconfig/bonnie-worker +%endif + +%pre +# Add the kolab user and group accounts +getent group %{bonnie_group} &>/dev/null || groupadd -r %{bonnie_group} -g %{bonnie_group_id} &>/dev/null +getent passwd %{bonnie_user} &>/dev/null || \ + useradd -r -u %{bonnie_user_id} -g %{bonnie_group} -d %{_localstatedir}/lib/%{bonnie_user} -s /sbin/nologin \ + -c "Kolab System Account" %{bonnie_user} &>/dev/null || : + +# Allow the bonnie user access to mail +gpasswd -a bonnie mail + +# Make sure our user has the correct home directory +if [ $1 -gt 1 ] ; then + usermod -d %{_localstatedir}/lib/%{bonnie_user} %{bonnie_user} &>/dev/null || : +fi + +%pre -n bonnie-collector +# And allow cyrus access to bonnie.conf +gpasswd -a cyrus bonnie + +%pre -n bonnie-dealer +# And allow cyrus access to bonnie.conf +gpasswd -a cyrus bonnie + +%post -n bonnie-broker +%if 0%{?suse_version} +%fillup_and_insserv -in bonnie-broker +%endif + +if [ "$1" == "1" ]; then +%if 0%{?with_systemd} + /bin/systemctl daemon-reload >/dev/null 2>&1 || : +%else + /sbin/chkconfig --add bonnie-broker +%endif +else +%if 0%{?with_systemd} + /bin/systemctl condrestart bonnie-broker.service >/dev/null 2>&1 || : +%else + /sbin/service bonnie-broker condrestart +%endif +fi + +%preun -n bonnie-broker +if [ "$1" == "0" ]; then +%if 0%{?with_systemd} + /bin/systemctl --no-reload disable bonnie-broker.service >/dev/null 2>&1 || : + /bin/systemctl stop bonnie-broker.service >/dev/null 2>&1 || : +%else + /sbin/service bonnie-broker stop > /dev/null 2>&1 + /sbin/chkconfig --del bonnie-broker +%endif +fi + +%post -n bonnie-collector +%if 0%{?suse_version} +%fillup_and_insserv -in bonnie-collector +%endif + +if [ "$1" == "1" ]; then +%if 0%{?with_systemd} + /bin/systemctl daemon-reload >/dev/null 2>&1 || : +%else + /sbin/chkconfig --add bonnie-collector +%endif +else +%if 0%{?with_systemd} + /bin/systemctl condrestart bonnie-collector.service >/dev/null 2>&1 || : +%else + /sbin/service bonnie-collector condrestart +%endif +fi + +%preun -n bonnie-collector +if [ "$1" == "0" ]; then +%if 0%{?with_systemd} + /bin/systemctl --no-reload disable bonnie-collector.service >/dev/null 2>&1 || : + /bin/systemctl stop bonnie-collector.service >/dev/null 2>&1 || : +%else + /sbin/service bonnie-collector stop > /dev/null 2>&1 + /sbin/chkconfig --del bonnie-collector +%endif +fi + +%post -n bonnie-worker +%if 0%{?suse_version} +%fillup_and_insserv -in bonnie-worker +%endif + +if [ "$1" == "1" ]; then +%if 0%{?with_systemd} + /bin/systemctl daemon-reload >/dev/null 2>&1 || : +%else + /sbin/chkconfig --add bonnie-worker +%endif +else +%if 0%{?with_systemd} + /bin/systemctl condrestart bonnie-worker.service >/dev/null 2>&1 || : +%else + /sbin/service bonnie-worker condrestart +%endif +fi + +%preun -n bonnie-worker +if [ "$1" == "0" ]; then +%if 0%{?with_systemd} + /bin/systemctl --no-reload disable bonnie-worker.service >/dev/null 2>&1 || : + /bin/systemctl stop bonnie-worker.service >/dev/null 2>&1 || : +%else + /sbin/service bonnie-worker stop > /dev/null 2>&1 + /sbin/chkconfig --del bonnie-worker +%endif +fi + %files %defattr(-,root,root,-) %doc conf/bonnie.conf -%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf +%attr(0640,%{bonnie_user},%{bonnie_group}) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf %{python_sitelib}/bonnie/__init__.py* %{python_sitelib}/bonnie/conf.py* %{python_sitelib}/bonnie/daemon.py* @@ -102,23 +282,29 @@ %files broker %defattr(-,root,root,-) -%{_bindir}/bonnie-broker +%{_sbindir}/bonnie-broker %{python_sitelib}/bonnie/broker +%{_initrddir}/bonnie-broker +%config(noreplace) %{_sysconfdir}/sysconfig/bonnie-broker %files collector %defattr(-,root,root,-) -%{_bindir}/bonnie-collector +%{_sbindir}/bonnie-collector %{python_sitelib}/bonnie/collector +%{_initrddir}/bonnie-collector +%config(noreplace) %{_sysconfdir}/sysconfig/bonnie-collector %files dealer %defattr(-,root,root,-) -%{_bindir}/bonnie-dealer +%{_sbindir}/bonnie-dealer %{python_sitelib}/bonnie/dealer %files worker %defattr(-,root,root,-) -%{_bindir}/bonnie-worker +%{_sbindir}/bonnie-worker %{python_sitelib}/bonnie/worker +%{_initrddir}/bonnie-worker +%config(noreplace) %{_sysconfdir}/sysconfig/bonnie-worker %files wui %defattr(-,root,root,-)
View file
bonnie-0.1.1.tar.gz/contrib
Added
+(directory)
View file
bonnie-0.1.1.tar.gz/contrib/bonnie-broker.sysconfig
Added
@@ -0,0 +1,6 @@ +# Configuration file for the Bonnie Broker daemon service. +# +# See bonnie-broker --help for more flags. +# +FLAGS="--fork -l warning" +DAEMONOPTS="--user bonnie"
View file
bonnie-0.1.1.tar.gz/contrib/bonnie-broker.sysvinit
Added
@@ -0,0 +1,121 @@ +#! /bin/bash +# +# bonnie-broker Start/Stop the Bonnie Broker daemon +# +# chkconfig: - 65 10 +# description: The Bonnie Broker daemon is a message broker. +# processname: bonnie-broker + +### BEGIN INIT INFO +# Provides: bonnie-brokerd +# Default-Start: - +# Default-Stop: 0 1 2 6 +# Required-Start: $remote_fs $local_fs $network +# Required-Stop: $remote_fs $local_fs $network +# Short-Description: Start/Stop the Bonnie Broker daemon +# Description: The Bonnie Broker daemon is a message broker. +### END INIT INFO + +# Source function library. +if [ -f /etc/init.d/functions ]; then + . /etc/init.d/functions +fi + +# Source our configuration file for these variables. +FLAGS="--fork -l warning" +USER="bonnie" +GROUP="bonnie" + +if [ -f /etc/sysconfig/bonnie-broker ] ; then + . /etc/sysconfig/bonnie-broker +fi + +if [ -f /etc/default/bonnie-broker ]; then + . /etc/default/bonnie-broker +fi + +RETVAL=0 + +# Set up some common variables before we launch into what might be +# considered boilerplate by now. +prog=bonnie-broker +path=/usr/sbin/bonnie-broker +lockfile=/var/lock/subsys/$prog +pidfile=/var/run/bonnie/bonnie-broker.pid + +[ ! -d "$(dirname ${pidfile})" ] && mkdir -p $(dirname ${pidfile}) +chown ${USER}:${GROUP} $(dirname ${pidfile}) + +start() { + [ -x $path ] || exit 5 + echo -n $"Starting $prog: " + daemon $DAEMONOPTS $path -p $pidfile $FLAGS + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch $lockfile + return $RETVAL +} + +stop() { + echo -n $"Stopping $prog: " + killproc -p $pidfile $prog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f $lockfile + 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 -p $pidfile $prog +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + +case "$1" in + start) + rh_status_q && exit 0 + start + ;; + stop) + rh_status_q || exit 0 + stop + ;; + restart) + restart + ;; + reload) + rh_status_q || exit 7 + reload + ;; + 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 $?
View file
bonnie-0.1.1.tar.gz/contrib/bonnie-collector.sysconfig
Added
@@ -0,0 +1,6 @@ +# Configuration file for the Bonnie Broker daemon service. +# +# See bonnie-broker --help for more flags. +# +FLAGS="--fork -l warning" +DAEMONOPTS="--user bonnie"
View file
bonnie-0.1.1.tar.gz/contrib/bonnie-collector.sysvinit
Added
@@ -0,0 +1,121 @@ +#! /bin/bash +# +# bonnie-broker Start/Stop the Bonnie Broker daemon +# +# chkconfig: - 65 10 +# description: The Bonnie Broker daemon is a message broker. +# processname: bonnie-broker + +### BEGIN INIT INFO +# Provides: bonnie-brokerd +# Default-Start: - +# Default-Stop: 0 1 2 6 +# Required-Start: $remote_fs $local_fs $network +# Required-Stop: $remote_fs $local_fs $network +# Short-Description: Start/Stop the Bonnie Broker daemon +# Description: The Bonnie Broker daemon is a message broker. +### END INIT INFO + +# Source function library. +if [ -f /etc/init.d/functions ]; then + . /etc/init.d/functions +fi + +# Source our configuration file for these variables. +FLAGS="--fork -l warning" +USER="bonnie" +GROUP="bonnie" + +if [ -f /etc/sysconfig/bonnie-broker ] ; then + . /etc/sysconfig/bonnie-broker +fi + +if [ -f /etc/default/bonnie-broker ]; then + . /etc/default/bonnie-broker +fi + +RETVAL=0 + +# Set up some common variables before we launch into what might be +# considered boilerplate by now. +prog=bonnie-broker +path=/usr/sbin/bonnie-broker +lockfile=/var/lock/subsys/$prog +pidfile=/var/run/bonnie/bonnie-broker.pid + +[ ! -d "$(dirname ${pidfile})" ] && mkdir -p $(dirname ${pidfile}) +chown ${USER}:${GROUP} $(dirname ${pidfile}) + +start() { + [ -x $path ] || exit 5 + echo -n $"Starting $prog: " + daemon $DAEMONOPTS $path -p $pidfile $FLAGS + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch $lockfile + return $RETVAL +} + +stop() { + echo -n $"Stopping $prog: " + killproc -p $pidfile $prog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f $lockfile + 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 -p $pidfile $prog +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + +case "$1" in + start) + rh_status_q && exit 0 + start + ;; + stop) + rh_status_q || exit 0 + stop + ;; + restart) + restart + ;; + reload) + rh_status_q || exit 7 + reload + ;; + 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 $?
View file
bonnie-0.1.1.tar.gz/contrib/bonnie-worker.sysconfig
Added
@@ -0,0 +1,6 @@ +# Configuration file for the Bonnie Broker daemon service. +# +# See bonnie-broker --help for more flags. +# +FLAGS="--fork -l warning" +DAEMONOPTS="--user bonnie"
View file
bonnie-0.1.1.tar.gz/contrib/bonnie-worker.sysvinit
Added
@@ -0,0 +1,121 @@ +#! /bin/bash +# +# bonnie-worker Start/Stop the Bonnie Broker daemon +# +# chkconfig: - 65 10 +# description: The Bonnie Broker daemon is a message worker. +# processname: bonnie-worker + +### BEGIN INIT INFO +# Provides: bonnie-workerd +# Default-Start: - +# Default-Stop: 0 1 2 6 +# Required-Start: $remote_fs $local_fs $network +# Required-Stop: $remote_fs $local_fs $network +# Short-Description: Start/Stop the Bonnie Broker daemon +# Description: The Bonnie Broker daemon is a message worker. +### END INIT INFO + +# Source function library. +if [ -f /etc/init.d/functions ]; then + . /etc/init.d/functions +fi + +# Source our configuration file for these variables. +FLAGS="--fork -l warning" +USER="bonnie" +GROUP="bonnie" + +if [ -f /etc/sysconfig/bonnie-worker ] ; then + . /etc/sysconfig/bonnie-worker +fi + +if [ -f /etc/default/bonnie-worker ]; then + . /etc/default/bonnie-worker +fi + +RETVAL=0 + +# Set up some common variables before we launch into what might be +# considered boilerplate by now. +prog=bonnie-worker +path=/usr/sbin/bonnie-worker +lockfile=/var/lock/subsys/$prog +pidfile=/var/run/bonnie/bonnie-worker.pid + +[ ! -d "$(dirname ${pidfile})" ] && mkdir -p $(dirname ${pidfile}) +chown ${USER}:${GROUP} $(dirname ${pidfile}) + +start() { + [ -x $path ] || exit 5 + echo -n $"Starting $prog: " + daemon $DAEMONOPTS $path -p $pidfile $FLAGS + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch $lockfile + return $RETVAL +} + +stop() { + echo -n $"Stopping $prog: " + killproc -p $pidfile $prog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f $lockfile + 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 -p $pidfile $prog +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + +case "$1" in + start) + rh_status_q && exit 0 + start + ;; + stop) + rh_status_q || exit 0 + stop + ;; + restart) + restart + ;; + reload) + rh_status_q || exit 7 + reload + ;; + 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 $?
View file
bonnie-0.1.1.tar.gz/contrib/bonnie.tmpfiles.d.conf
Added
@@ -0,0 +1,2 @@ +d /var/run/bonnie 750 bonnie bonnie +
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.