From 3f4bc2d376ca18747dfa9bf796499fb53df75358 Mon Sep 17 00:00:00 2001 From: Marcin Haba Date: Fri, 20 Mar 2015 21:03:32 +0100 Subject: [PATCH] baculum: Tweak example rpm spec and startup files --- gui/baculum/examples/rpm/baculum.spec | 23 +++++++++++++++++------ gui/baculum/examples/rpm/baculum.startup | 21 ++++++++++++++++++--- 2 files changed, 35 insertions(+), 9 deletions(-) mode change 100644 => 100755 gui/baculum/examples/rpm/baculum.startup diff --git a/gui/baculum/examples/rpm/baculum.spec b/gui/baculum/examples/rpm/baculum.spec index 17138e2512..220a2bdf67 100644 --- a/gui/baculum/examples/rpm/baculum.spec +++ b/gui/baculum/examples/rpm/baculum.spec @@ -1,6 +1,6 @@ Summary: Baculum WebGUI tool for Bacula Community program Name: baculum -Version: 7.0.20150315git +Version: 7.0.20150317git Release: 1%{?dist} License: AGPLv3 Group: Applications/Internet @@ -8,7 +8,8 @@ Source: %{name}-%{version}.tar.gz URL: http://bacula.org Requires: lighttpd Requires: lighttpd-fastcgi -Requires: php +Requires: bacula-console +Requires: php >= 5.3.4 Requires: php-bcmath Requires: php-common Requires: php-mbstring @@ -16,8 +17,9 @@ Requires: php-mysqlnd Requires: php-pdo Requires: php-pgsql Requires: php-xml -Requires(post): chkconfig -Requires(preun):chkconfig +Requires(post): /sbin/chkconfig +Requires(preun):/sbin/service, /sbin/chkconfig +BuildArch: noarch %description The Baculum program allows the user to administrate and manage Bacula work. @@ -35,24 +37,33 @@ console that communicates with Bacula bconsole program. %attr(-,lighttpd,lighttpd) /usr/share/baculum/htdocs %attr(-,lighttpd,lighttpd) /etc/baculum %attr(755,root,root) /etc/rc.d/init.d/baculum +%config /etc/sysconfig/baculum + +%doc AUTHORS INSTALL README LICENSE %install mkdir -p %{buildroot}/usr/share/baculum/htdocs mkdir -p %{buildroot}/etc/baculum +mkdir -p %{buildroot}/etc/sysconfig mkdir -p %{buildroot}/etc/rc.d/init.d -cp -ra . %{buildroot}/usr/share/baculum/htdocs +cp -ra assets framework protected themes index.php AUTHORS INSTALL LICENSE README index.php %{buildroot}/usr/share/baculum/htdocs install -m 640 examples/rpm/baculum.lighttpd.conf %{buildroot}/etc/baculum/ install -m 600 examples/rpm/baculum.users %{buildroot}/etc/baculum/ install -m 755 examples/rpm/baculum.startup %{buildroot}/etc/rc.d/init.d/baculum +install -m 644 examples/rpm/baculum.sysconfig %{buildroot}/etc/sysconfig/baculum %post -ln -s /etc/baculum/baculum.users /usr/share/baculum/htdocs/protected/Data/baculum.users /sbin/chkconfig --add /etc/rc.d/init.d/baculum +[ -e /usr/share/baculum/htdocs/protected/Data/baculum.users ] || ln -s /etc/baculum/baculum.users /usr/share/baculum/htdocs/protected/Data/baculum.users %preun if [ $1 -eq 0 ] ; then /sbin/service baculum stop /sbin/chkconfig --del baculum fi + +%changelog + * Wed Mar 18 2015 Marcin Haba - 7.0.20150317git + - Spec create \ No newline at end of file diff --git a/gui/baculum/examples/rpm/baculum.startup b/gui/baculum/examples/rpm/baculum.startup old mode 100644 new mode 100755 index abbd3fc656..a2bb4a941e --- a/gui/baculum/examples/rpm/baculum.startup +++ b/gui/baculum/examples/rpm/baculum.startup @@ -1,4 +1,10 @@ #!/bin/sh +# +# chkconfig: 2345 91 9 +# description: This script uses Lighttpd web server for \ +# working Baculum WebGUI tool. +# + ### BEGIN INIT INFO # Provides: baculum # Required-Start: $local_fs $remote_fs $network $syslog $named @@ -7,7 +13,6 @@ # Default-Stop: 0 1 6 # Short-Description: Start/stop Baculum # Description: Start the Baculum WebGUI Bacula Community tool. -# This script uses Lighttpd web server for working Baculum WebGUI tool. ### END INIT INFO DESC="Baculum WebGUI Bacula Community tool" @@ -15,7 +20,8 @@ NAME=baculum SCRIPTNAME=/etc/init.d/$NAME DAEMON=/usr/sbin/lighttpd DAEMON_OPTS="-f /etc/baculum/baculum.lighttpd.conf" -PIDFILE="/var/run/$NAME.pid" +PIDFILE=/var/run/$NAME.pid +LOCKFILE=/var/lock/subsys/$NAME test -x $DAEMON || exit 0 @@ -35,6 +41,10 @@ log_end_msg() logger ${RES:=FAIL} } +rh_status() { + status $prog +} + if test -f /lib/lsb/init-functions; then . /lib/lsb/init-functions fi @@ -50,6 +60,7 @@ case "$1" in log_end_msg 1 else log_end_msg 0 + touch $LOCKFILE fi ;; stop) @@ -57,18 +68,22 @@ case "$1" in if kill -TERM `<$PIDFILE` then rm -f $PIDFILE + rm -f $LOCKFILE log_end_msg 0 else log_end_msg 1 fi ;; + status) + rh_status + ;; restart) check_syntax $0 stop $0 start ;; *) - echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2 + echo "Usage: $SCRIPTNAME {start|stop|restart|status}" >&2 exit 1 ;; esac -- 2.39.5