%define name queue %define version 0.10.10 %define num_release 1 %define release %mkrel %num_release Summary: A generic cluster process installation Name: %{name} Version: %{version} Release: %{release} Source0: %{name}-%{version}.tar.bz2 License: GPL Group: Applications/Engineering BuildRoot: %{_tmppath}/%{name}-buildroot BuildArch: noarch # group an user id are identical %define qid 5555 # group an user name are identical %define quser queue # queue password %define qpassword /TitHazmX3t.4PlbucKNc3g.i8/ %define head zfr01mos01.crm.mot.com %define home /home/queue/spool %define nfs /home/queue %define autofs %{_sysconfdir}/autofs %define perm_local %{_sysconfdir}/security/msec/perm.local %description Cluster-queue is a script for process migration. %prep %setup -q %install [ %{buildroot} == / ] || %__rm -rf %{buildroot} cd %{_builddir}/%{name}-%{version} %__mkdir_p -m 755 %{buildroot}%{_sysconfdir} %__mkdir_p -m 755 %{buildroot}%{_initrddir} %__mkdir_p -m 755 %{buildroot}%{autofs} %__mkdir_p -m 755 %{buildroot}%{_bindir} %__mkdir_p -m 755 %{buildroot}%{_mandir}/man1 %__mkdir_p -m 755 %{buildroot}%{_defaultdocdir}/%{name}-%{version} %__mkdir_p -m 711 %{buildroot}%{_var}/log/queue %__install -m 755 queue update-queue-password %{buildroot}%{_bindir} %__install -m 700 node %{buildroot}%{_initrddir} %__install -m 644 queuerc %{buildroot}%{_sysconfdir} %__install -m 644 auto.crm auto.home %{buildroot}%{autofs} %__install -m 644 queue.1 %{buildroot}/%{_mandir}/man1/queue.1 %__install -m 644 queue.sql BUGS INSTALL README \ %{buildroot}%{_defaultdocdir}/%{name}-%{version} %clean %__rm -rf %{buildroot} %files %defattr(-,root,root,-) %config %{_sysconfdir}/queuerc %doc %{_defaultdocdir}/%{name}-%{version} %doc %{_mandir}/man1/queue.1* %{_prefix}/bin/queue %post %__sed -i -e 's#^\#\(head=\).*$#\1%{head}#' \ -e 's#^\#\(home=\).*$#\1%{home}#' %{_sysconfdir}/queuerc %package head Summary: A generic Head Group: Networking/WWW Requires: %{name} = %{version}-%{release} %description head Cluster head installation %pre head [ "$(%__grep \^%{quser}: %{_sysconfdir}/group)" ] || \ groupadd %{quser} -g %{qid} [ "$(%__grep \^%{quser}: %{_sysconfdir}/passwd)" ] || \ useradd %{quser} -u %{qid} -g %{quser} -p %{qpassword} %files head %defattr(-,root,root,-) %{_prefix}/bin/update-queue-password %post head # Create %{home} directory [ -d %{home} ] || %__mkdir_p %{home} %__chown queue.queue %{nfs} %{home} %__chmod 750 %{nfs} %__chmod 770 %{home} # Change msec policy (need seq) perm=%{perm_local} ( %__cat $perm; l=""; for d in $(echo %{home} | %__sed "s;/; ;g"); do l="$l/$d"; if [ -z "$(%__grep \^$l $perm)" ]; then echo -n $l; for i in $(seq $(echo $l | wc -c) 48); do echo -n " "; done; echo "%{quser}.%{quser} 750"; fi done ) | sort >$perm.tmp %__mv -f $perm.tmp $perm [ "$(%__grep \^%{nfs} %{_sysconfdir}/exports)" ] || \ echo "%{nfs} 192.168.1.0/24(root_squash,async,secure,subtree_check,rw)" \ >> %{_sysconfdir}/exports %preun head [ $1 -eq 0 ] || exit 0 # Remove user and group [ "$(%__grep '^%{quser}:' %{_sysconfdir}/group)" ] && \ groupdel %{quser} [ "$(%__grep '^%{quser}:' %{_sysconfdir}/password)" ] && \ userdel %{quser} # Remove msec special perm for %{quser}\.%{quser} %__sed -i '/%{quser}\.%{quser}/ d' %{perm_local} # unexport %{nfs} remove from %{_sysconfdir}/exports %__sed -i '\#^%{nfs}# d' %{_sysconfdir}/exports exportfs %package node Summary: A generic queue services Group: Networking/WWW Requires: %{name} = %{version}-%{release} %description node Cluster services installation %preun node [ $1 -eq 0 ] || exit 0 # Uninstall service %_del_service_helper %{name} %{version} queue-node $1 node # Remove user and group [ "$(%__grep '^%{quser}:' %{_sysconfdir}/group)" ] && \ groupdel %{quser} [ "$(%__grep '^%{quser}:' %{_sysconfdir}/password)" ] && \ userdel %{quser} # Uninstall autofs %__sed -i -e '\#^%{autofs}/auto.crm# d' \ -e '\#^%{autofs}/auto.home# d' %{autofs}/auto.master %files node %defattr(-,root,root,-) %config %{autofs}/auto.crm %config %{autofs}/auto.home %config %{_initrddir}/node %dir %{_var}/log/queue %post node ## AutoFS Mount [ "$(%__grep '%{autofs}/auto.crm' %{autofs}/auto.master)" ] || \ echo "/crm %{autofs}/auto.crm --timeout=60" >> %{autofs}/auto.master [ "$(%__grep '%{autofs}/auto.home' %{autofs}/auto.master)" ] || \ echo "/home %{autofs}/auto.home --timeout=60" >> %{autofs}/auto.master %__service autofs restart ## Add service %__chown queue.root %{_var}/log/queue %_add_service_helper %{name} %{version} queue-node $1 node ## Create group and user [ "$(%__grep '^%{quser}:' %{_sysconfdir}/group)" ] || \ groupadd %{quser} -g %{qid} [ "$(%__grep '^%{quser}:' %{_sysconfdir}/passwd)" ] || \ useradd %{quser} -u %{qid} -g %{quser} -p %{qpassword} %changelog # Changelog for packages rebuilt on stable releases (leave it first): %{!?_with_unstable:* %(LC_ALL=C date +"%a %b %d %Y") %{packager} %{version}-%{release}} %{!?_with_unstable: - rebuild of %{version}-%{rel}%{distsuffix} for %{distversion}} * Thu Jul 3 2008 Laurent Mazet 0.10.10-1%{distsuffix} * protection mysql connection * Fri Mar 28 2008 Laurent Mazet 0.10.9-1%{distsuffix} * adapt to MS-Windows * improve db cleaning on big crash * fix a bug in getfirstline function * Tue Feb 19 2008 Laurent Mazet 0.10.8-1%{distsuffix} * fix help message * adapt to cygwin * Fri Feb 1 2008 Laurent Mazet 0.10.7-1%{distsuffix} * fix a bug in queue accounting * Fri Feb 1 2008 Laurent Mazet 0.10.6-1%{distsuffix} * fix an old bug in node service * Thu Jan 31 2008 Fabrice Barbarin 0.10.5-3%{distsuffix} * fix %_sysconfig} * Thu Jan 31 2008 Laurent Mazet 0.10.5-2%{distsuffix} * fix pre unstall for head package * Tue Jan 29 2008 Laurent Mazet 0.10.5-1%{distsuffix} * enhance queue accounting * rescheduled unfinished jobs when a queue is declared dead * Fri Jan 25 2008 Laurent Mazet 0.10.4-1%{distsuffix} * enhance queue accounting * declare in node a queue dead when its last log is older than * Fri Jan 25 2008 Laurent Mazet 0.10.3-1%{distsuffix} * update to upstream version * Wed Jan 23 2008 Laurent Mazet 0.10.2-3%{distsuffix} * clean and correct spec file * Wed Jan 23 2008 Laurent Mazet 0.10.2-2%{distsuffix} * clean spec file * Mon Jan 21 2008 Laurent Mazet 0.10.2-1%{distsuffix} * read configuration file in /etc and in home directory * remove all .sh from file names * Fri Jan 18 2008 Laurent Mazet 0.10.1-1%{distsuffix} * list dying job * Fri Jan 18 2008 Laurent Mazet 0.10.0-2%{distsuffix} * fix for group variable in spec file. * Thu Jan 17 2008 Laurent Mazet 0.10.0-1%{distsuffix} * New mainstream version - use external MySQL database to store job information - remove file queue.list and queue.msg and more than 300 lines of code - create a script to update database password - modify erase procedure (now use job id) - remove lock functionality - when lisiting all running and waiting jobs, directorys and scripts of other user are masked - update man page * Fri Oct 26 2007 Fabrice Barbarin 0.9.27-1crm * modify to support FQDN * Fri Oct 19 2007 Fabrice Barbarin 0.9.26-3crm * rebuild for MDV 2008.0 * Mon Aug 08 2005 Fabrice Barbarin 0.9.26-2crm * changing release version from queue.sh * Mon Aug 08 2005 Fabrice Barbarin 0.9.26-1crm * add long option names * -r compute statistics * Fri Aug 05 2005 Fabrice Barbarin 0.9.25-1crm * adding Man page * count the number of running queues * add new mecanism to insure removing lock files * Wed Mar 09 2005 Fabrice Barbarin 0.9.23-3crm * modifyng service stopping starting * Thu Mar 03 2005 Fabrice Barbarin 0.9.23-2crm * wait until network filesytem is up * Thu Mar 03 2005 Fabrice Barbarin 0.9.23-1crm * change node startup prioritis * Replace nfs by autofs * check if list exist to avoid an error message * Mon Feb 22 2005 Fabrice Barbarin 0.9.22-3crm * add head script package * add node script package * Mon Feb 21 2005 Fabrice Barbarin 0.9.22-2crm * add head script modification * Mon Feb 14 2005 Fabrice Barbarin 0.9.22-1crm * better kill support * Thu Feb 10 2005 Fabrice Barbarin 0.9.21-3crm - Remove queue user and group from post install * Mon Feb 7 2005 Fabrice Barbarin 0.9.21-2crm - Add queue user & group * Fri Dec 28 2004 Fabrice Barbarin 0.9.21-1crm - use lockfile from procmail which is NFS-resistant - correct list display - allows multiple scripts for deletion * Fri Nov 26 2004 Fabrice Barbarin 0.9.20-1crm - remove selected message checking delay - delay set to 180s - -x locks list file and message file - add head to var list for ssh connection * Mon Nov 08 2004 Fabrice Barbarin 0.9.19-1crm - Update lock system files * Fri Oct 29 2004 Fabrice Barbarin 0.9.17-1crm - Add -a allows multiple scripts * Tue Oct 26 2004 Fabrice Barbarin 0.9.16-1crm - Initial Packaging # end of file