rpms/fcron/devel daemon_fcron_watch_config, NONE, 1.1 fcron_watch_config, NONE, 1.1 fcron_watch_config.init, NONE, 1.1 fcron.spec, 1.14, 1.15 fcron-3.0.1-Makefile.in.fedora_install.patch, 1.1, NONE fcron-3.0.1-accept_readable_fcron.conf.patch, 1.1, NONE fcron-3.0.1-configure.fedora.patch, 1.1, NONE fcron-3.0.1-doc_Makefile.in.fedora_install.patch, 1.1, NONE fcron-3.0.3-Makefile.in.fedora_install.patch, 1.1, NONE fcrontab.c.seteuid, 1.1, NONE
Patrice Dumas
pertusus at fedoraproject.org
Sun Nov 30 17:20:07 UTC 2008
Author: pertusus
Update of /cvs/extras/rpms/fcron/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9264
Modified Files:
fcron.spec
Added Files:
daemon_fcron_watch_config fcron_watch_config
fcron_watch_config.init
Removed Files:
fcron-3.0.1-Makefile.in.fedora_install.patch
fcron-3.0.1-accept_readable_fcron.conf.patch
fcron-3.0.1-configure.fedora.patch
fcron-3.0.1-doc_Makefile.in.fedora_install.patch
fcron-3.0.3-Makefile.in.fedora_install.patch
fcrontab.c.seteuid
Log Message:
* Sun Nov 30 2008 Patrice Dumas <pertusus[AT]free[DOT]fr> 3.0.4-2
- use newer post scripts
- use .Package instead of .Dist
- remove unused patches
- correct paths in scripts
- ship check_system_crontabs
- LSB compliant initscript
- add scripts that watch config files as daemons and sync fcron files
- add a subpackage that can be used as a vixie cron replacement
--- NEW FILE daemon_fcron_watch_config ---
#! /bin/sh
pid_file=$1
[ "z$pid_file" = 'z' ] && pid_file=/var/run/fcron_watch_config.pid
setsid fcron_watch_config > /dev/null 2>&1 &
pid=$!
ps --ppid $pid -o pid,cmd | grep inotifywait | awk '{print $1}' > $pid_file
--- NEW FILE fcron_watch_config ---
#! /bin/sh
fcron_config_files="/etc/crontab /etc/fcrontab"
fcron_present_files=
res=
while true; do
fcron_present_files=
for file in $fcron_config_files; do
[ -f $file ] && fcron_present_files="$fcron_present_files $file"
done
inotifywait -q -q $fcron_present_files /etc/cron.d
res=$?
if [ z"$res" = 'z0' ]; then
check_system_crontabs
else
break
fi
done
# do something with res?
--- NEW FILE fcron_watch_config.init ---
#!/bin/sh
#
# fcron_watch_config
#
# chkconfig: - 41 61
# description: Vixie cron compatible configuration files script checker \
# for fcron
### BEGIN INIT INFO
# Provides: fcron_watch_config
# Required-Start: fcron
# Required-Stop: fcron
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop: 0 1 6
# Short-Description: Watch configuration file for Fcron
# Description: Watch configuration file for Fcron
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
exec="/usr/sbin/daemon_fcron_watch_config"
prog="fcron_watch_config"
lockfile=/var/lock/subsys/$prog
pidfile=/var/run/$prog.pid
start() {
[ -x $exec ] || exit 5
echo -n $"Starting $prog: "
daemon --pidfile=$pidfile $exec $pidfile
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 $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 $?
Index: fcron.spec
===================================================================
RCS file: /cvs/extras/rpms/fcron/devel/fcron.spec,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- fcron.spec 18 Sep 2008 11:53:33 -0000 1.14
+++ fcron.spec 30 Nov 2008 17:19:36 -0000 1.15
@@ -1,6 +1,6 @@
Name: fcron
Version: 3.0.4
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A task scheduler
Summary(fr): Un ordonnanceur de tâches
Summary(it): Uno schedulatore di processi
@@ -11,11 +11,12 @@
Source0: http://fcron.free.fr/archives/%{name}-%{version}.src.tar.gz
Source1: fcron.README
Source2: fcron.LISEZMOI
+Source3: fcron_watch_config
+Source4: fcron_watch_config.init
+Source5: daemon_fcron_watch_config
Patch0: fcron-3.0.4-dist_install.patch
-#Patch1: fcron-3.0.1-doc_Makefile.in.fedora_install.patch
-#Patch2: fcron-3.0.1-configure.fedora.patch
+Patch1: fcron-3.0.4-LSB.patch
Patch3: fcron-3.0.2-accept_readable_fcron.conf.patch
-#Patch4: fcrontab.c.seteuid
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: syslog
@@ -27,9 +28,9 @@
BuildRequires: /usr/sbin/sendmail
BuildRequires: vim-minimal
-Requires(pre): /usr/sbin/useradd
-Requires(post): /sbin/chkconfig, /sbin/service
-Requires(preun): /sbin/chkconfig, /sbin/service
+Requires(post): chkconfig
+Requires(preun): chkconfig, initscripts
+Requires(postun): initscripts
%description
Fcron is a scheduler. It aims at replacing Vixie Cron, so it implements most
@@ -43,7 +44,7 @@
WARNING: fcron isn't started automatically on boot after installation.
You can use system-config-services to enable automatic fcron startup
on boot, or use chkconfig as explained in the
-%{_docdir}/%{name}-%{version}/README.Fedora file.
+%{_docdir}/%{name}-%{version}/README.Package file.
%description -l fr
Fcron est un ordonnanceur. Il est destiné à remplacer Vixie Cron. Aussi, il
@@ -58,7 +59,7 @@
ATTENTION : fcron n'est pas activé automatiquement au démarrage après
l'installation. Pour y remédier, vous pouvez utiliser system-config-services
ou chkconfig comme expliqué dans le fichier
-%{_docdir}/%{name}-%{version}/LISEZMOI.Fedora.
+%{_docdir}/%{name}-%{version}/LISEZMOI.Package.
%description -l it
Fcron e' un schedulatore. Il suo obiettivo e' quello di sostituire Vixie Cron,
@@ -73,20 +74,36 @@
ATTENZIONE : fcron non viene fatto partire automaticamere al boot dopo
l'installazione. Puoi usare system-config-services per abilitare la partenza
automatica di fcron al boot, oppure puo iusare chkconfig come illustrato nel
-file %{_docdir}/%{name}-%{version}/README.Fedora file.
+file %{_docdir}/%{name}-%{version}/README.Package file.
+
+%package watch-config
+Summary: Set up fcron to watch config files like Vixie cron does
+Group: Applications/System
+Requires: %{name} = %{version}-%{release}
+Requires: inotify-tools, crontabs, /bin/ps
+
+Requires(post): chkconfig
+Requires(preun): chkconfig, initscripts
+Requires(postun): initscripts
+
+%description watch-config
+Starts a shell script that watch over configuration files like Vixie cron
+does, together with fcron fcrontab. Instead of checking every second,
+inotify is used to watch files and directories. The service should be
+restarted if an /etc/crontab or /etc/fcrontab file that did not exist before
+is created.
+
%prep
%setup -q
-%{__install} -pm 644 %{SOURCE1} README.Dist
-%{__install} -pm 644 %{SOURCE2} LISEZMOI.Dist
+%{__install} -pm 644 %{SOURCE1} README.Package
+%{__install} -pm 644 %{SOURCE2} LISEZMOI.Package
%patch0 -p1 -b .dist_install
-#%patch1 -p0
-#%patch2 -p0
+%patch1 -p1 -b .LSB
%patch3 -p0 -b .accept_readable_fcron
-#%patch4 -p0
for file in doc/en/txt/*.txt; do
iconv -f latin1 -t utf8 < $file > $file.new
@@ -107,18 +124,45 @@
make install-staged DESTDIR=%{buildroot}
%{__install} -d %{buildroot}%{_initrddir}
-%{__sed} -i -e "s|SBIN=@@DESTSBIN@|SBIN=%{_sbindir}|" script/sysVinit-launcher
-%{__sed} -e "s|2345|-|" script/sysVinit-launcher > %{buildroot}%{_initrddir}/fcron
+# don't start in the default case, and correct paths
+%{__sed} \
+ -e 's|2345|-|' \
+ -e 's|2 3 4 5||' \
+ -e 's|SBIN=@@DESTSBIN@|SBIN=%{_sbindir}|' \
+ -e 's|/var|%{_localstatedir}|' script/sysVinit-launcher > %{buildroot}%{_initrddir}/fcron
%{__chmod} 0755 %{buildroot}%{_initrddir}/fcron
-%{__install} -m755 debian/fcron-update-crontabs %{buildroot}%{_sbindir}/
-%{__install} -m644 debian/fcron-update-crontabs.1 %{buildroot}%{_mandir}/man1/
+%{__sed} \
+ -e 's|/usr/sbin|%{_sbindir}|' \
+ -e 's|/var|%{_localstatedir}|' %{SOURCE4} > %{buildroot}%{_initrddir}/fcron_watch_config
+
+%{__chmod} 0755 %{buildroot}%{_initrddir}/fcron*
+
+touch -c -r %{SOURCE4} %{buildroot}%{_initrddir}/fcron_watch_config
+touch -c -r script/sysVinit-launcher.LSB %{buildroot}%{_initrddir}/fcron
+#touch -c -r script/sysVinit-launcher %{buildroot}%{_initrddir}/fcron
+
+%{__sed} -e 's|/usr/bin|%{_bindir}|' \
+ -e 's|/var|%{_localstatedir}|' \
+ -e 's|/etc|%{_sysconfdir}|' script/check_system_crontabs > %{buildroot}%{_sbindir}/check_system_crontabs
+%{__sed} -e 's|/etc|%{_sysconfdir}|g' %{SOURCE3} > %{buildroot}%{_sbindir}/fcron_watch_config
-# nuke permissions (for strip)
+# fix permissions
%{__chmod} 755 %{buildroot}%{_bindir}/*
%{__chmod} 755 %{buildroot}%{_sbindir}/*
+%{__install} -m755 -p debian/fcron-update-crontabs %{buildroot}%{_sbindir}/
+%{__install} -m644 -p debian/fcron-update-crontabs.1 %{buildroot}%{_mandir}/man1/
+
+%{__install} -m755 -p %{SOURCE5} %{buildroot}%{_sbindir}/
+
+# reset script timestamp
+touch -c -r script/check_system_crontabs %{buildroot}%{_sbindir}/check_system_crontabs
+touch -c -r %{SOURCE3} %{buildroot}%{_sbindir}/fcron_watch_config
+
+mkdir -p %{buildroot}%{_sysconfdir}/cron.d
+
# remove a page that is hold in cron
%{__rm} %{buildroot}%{_mandir}/man3/bitstring.3*
%{__rm} %{buildroot}%{_mandir}/fr/man3/bitstring.3*
@@ -126,12 +170,14 @@
for i in %{buildroot}%{_mandir}/man*/*
do
iconv -f latin1 -t UTF8 < $i > tmp
+ touch -c -r $i tmp
%{__mv} tmp $i
done
for i in %{buildroot}%{_mandir}/fr/man*/*
do
iconv -f latin1 -t UTF8 < $i > tmp
+ touch -c -r $i tmp
%{__mv} tmp $i
done
@@ -141,20 +187,18 @@
%pre
-if [ "$1" = "1" ]
-then
- /usr/sbin/useradd -c "Fcron system user" -r fcron -d %{_localstatedir}/spool/fcron -s /bin/true &>/dev/null || :
-fi
+getent group fcron >/dev/null || groupadd -r fcron
+getent passwd fcron >/dev/null || \
+useradd -r -g fcron -d %{_localstatedir}/spool/fcron -s /sbin/nologin \
+ -c "Fcron system user" fcron
+exit 0
%post
-if [ "$1" = "1" ]
-then
- /sbin/chkconfig --add %{name}
-else
- if [ -f %{_localstatedir}/lock/subsys/%{name} ]
- then
- /sbin/service %{name} restart > /dev/null 2>&1
- fi
+/sbin/chkconfig --add %{name}
+
+%postun
+if [ "$1" -ge "1" ] ; then
+ /sbin/service %{name} condrestart >/dev/null 2>&1 || :
fi
%preun
@@ -164,13 +208,28 @@
/sbin/chkconfig --del %{name}
fi
+%post watch-config
+/sbin/chkconfig --add %{name}_watch_config
+
+%postun watch-config
+if [ "$1" -ge "1" ] ; then
+ /sbin/service %{name}_watch_config condrestart >/dev/null 2>&1 || :
+fi
+
+%preun watch-config
+if [ "$1" = "0" ]
+then
+ /sbin/service %{name}_watch_config stop >/dev/null 2>&1
+ /sbin/chkconfig --del %{name}_watch_config
+fi
+
%clean
%{__rm} -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc doc/en/HTML/ doc/fr/HTML-fr/ doc/en/txt/*
-%doc README.Dist LISEZMOI.Dist
+%doc README.Package LISEZMOI.Package
%{_initrddir}/fcron
%config(noreplace) %{_sysconfdir}/fcron.conf
%config(noreplace) %{_sysconfdir}/fcron.allow
@@ -188,10 +247,28 @@
%attr(06755,fcron,fcron) %{_bindir}/fcrontab
%{_sbindir}/fcron
%{_sbindir}/fcron-update-crontabs
+%{_sbindir}/check_system_crontabs
%dir %attr(770,fcron,fcron) %{_localstatedir}/spool/fcron
%ghost %{_localstatedir}/run/fcron.pid
+%files watch-config
+%defattr(-,root,root,-)
+%dir %{_sysconfdir}/cron.d
+%{_initrddir}/fcron_watch_config
+%{_sbindir}/fcron_watch_config
+%{_sbindir}/daemon_fcron_watch_config
+
%changelog
+* Sun Nov 30 2008 Patrice Dumas <pertusus[AT]free[DOT]fr> 3.0.4-2
+ - use newer post scripts
+ - use .Package instead of .Dist
+ - remove unused patches
+ - correct paths in scripts
+ - ship check_system_crontabs
+ - LSB compliant initscript
+ - add scripts that watch config files as daemons and sync fcron files
+ - add a subpackage that can be used as a vixie cron replacement
+
* Thu Sep 18 2008 Patrice Dumas <pertusus[AT]free[DOT]fr> 3.0.4-1
- update to 3.0.4
--- fcron-3.0.1-Makefile.in.fedora_install.patch DELETED ---
--- fcron-3.0.1-accept_readable_fcron.conf.patch DELETED ---
--- fcron-3.0.1-configure.fedora.patch DELETED ---
--- fcron-3.0.1-doc_Makefile.in.fedora_install.patch DELETED ---
--- fcron-3.0.3-Makefile.in.fedora_install.patch DELETED ---
--- fcrontab.c.seteuid DELETED ---
More information about the fedora-extras-commits
mailing list