1 Summary: A periodical command scheduler which aims at replacing Vixie Cron
2 Summary(pl): Serwer okresowego uruchamiania poleceñ zastêpuj±cy Vixie Crona
8 Source0: http://fcron.free.fr/archives/%{name}-%{version}.src.tar.gz
9 # Source0-md5: bf39dcef6d0c452f167f5a31a1231e4e
11 Source2: cron.logrotate
12 Source3: cron.sysconfig
13 Source4: %{name}.crontab
17 URL: http://fcron.free.fr/
18 BuildRequires: libselinux-devel
19 BuildRequires: pam-devel
20 BuildRequires: rpmbuild(macros) >= 1.159
22 Requires(pre): /usr/bin/getgid
23 Requires(pre): /usr/sbin/groupadd
24 Requires(post,preun): /sbin/chkconfig
25 Requires(post): fileutils
26 Requires(postun): /usr/sbin/groupdel
27 Requires: /bin/run-parts
28 Requires: psmisc >= 20.1
29 Provides: crontabs >= 1.7
31 Provides: group(crontab)
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 Fcron is a periodical command scheduler which aims at replacing Vixie
40 Cron, so it implements most of its functionalities. But fcron does not
41 assume that your system is running neither all the time nor regularly:
42 you can, for instance, tell fcron to execute tasks every x hours y
43 minutes of system up time or to do a job only once in a specified
44 interval of time. You can also set a nice value to a job, run it
45 depending on the system load average and much more !
48 Fcron jest serwerem okresowego uruchamiania poleceñ maj±cym za cel
49 zast±pienie Vixie Crona, posiadaj±cym zaimplementowane wiêkszo¶æ
50 spo¶ród jego funkcji. Jednak¿e fcron nie zak³ada, ¿e system dzia³a
51 ca³y czas, ani ¿e jest uruchamiany regularnie: mo¿na, na przyk³ad,
52 kazaæ fcronowi uruchamiaæ zadanie co ka¿de x godzin y minut od
53 uruchomienia systemu lub wykonywaæ zadanie dok³adnie raz w podanym
54 okresie czasu. Umo¿liwia równie¿ ustawianie warto¶ci nice dla zadania,
55 uruchamianie go w zale¿no¶ci od obci±¿enia systemu i du¿o wiêcej.
62 --with-sysfcrontab=systab \
63 --with-spooldir=%{_var}/spool/cron \
64 --with-run-non-privileged=no \
65 --with-boot-install=no \
67 --with-username=crontab \
68 --with-groupname=crontab \
71 --with-boot-install=no
75 echo "#!/bin/sh" > script/user-group
78 rm -rf $RPM_BUILD_ROOT
79 install -d $RPM_BUILD_ROOT{/var/{log,spool/cron},%{_mandir}} \
80 $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \
81 $RPM_BUILD_ROOT%{_sysconfdir}/{cron,cron.{d,hourly,daily,weekly,monthly},pam.d}
84 DESTDIR=$RPM_BUILD_ROOT \
85 DESTSBIN=$RPM_BUILD_ROOT%{_sbindir} \
86 DESTBIN=$RPM_BUILD_ROOT%{_bindir} \
87 DESTMAN=$RPM_BUILD_ROOT%{_mandir} \
93 #fix premission for rpmbuild
94 chmod +rw $RPM_BUILD_ROOT/usr/*bin/*
96 ln -sf %{_bindir}/fcrontab $RPM_BUILD_ROOT%{_bindir}/crontab
97 mv -f $RPM_BUILD_ROOT%{_sbindir}/fcron $RPM_BUILD_ROOT%{_sbindir}/crond
99 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond
100 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/cron
101 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/cron
102 install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/crontab
103 install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/fcron
104 install %{SOURCE6} $RPM_BUILD_ROOT/etc/fcron.conf
105 install %{SOURCE7} $RPM_BUILD_ROOT/etc/pam.d/fcrontab
107 touch $RPM_BUILD_ROOT/var/log/cron
109 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.allow << EOF
110 # cron.allow This file describes the names of the users which are
111 # allowed to use the local cron daemon
115 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.deny << EOF2
116 # cron.deny This file describes the names of the users which are
117 # NOT allowed to use the local cron daemon
121 rm -rf $RPM_BUILD_ROOT
124 if [ -n "`/usr/bin/getgid crontab`" ]; then
125 if [ "`/usr/bin/getgid crontab`" != "117" ]; then
126 echo "Error: group crontab doesn't have gid=117. Correct this before installing cron." 1>&2
130 echo "Adding group crontab GID=117."
131 /usr/sbin/groupadd -g 117 -r -f crontab
134 if [ -n "`/bin/id -u crontab 2>/dev/null`" ]; then
135 if [ "`/bin/id -u crontab`" != "134" ]; then
136 echo "Error: user crontab doesn't have uid=134. Correct this before installing %{name}." 1>&2
140 /usr/sbin/useradd -u 134 -r -d /var/spool/cron -s /bin/false -c "crontab User" -g crontab crontab 1>&2
144 if [ "$1" = "1" ]; then
145 if [ -d /var/spool/cron ]; then
146 FIND=`find /var/spool/cron -type f`
147 for FILE in $FIND; do
148 mv -f $FILE $FILE.orig
149 USER=`basename $FILE`
150 chown crontab:crontab $FILE.orig
152 (test ! -z "$USER" && fcrontab -u $USER -z) > /dev/null 2>&1
154 if [ -f /var/spool/cron/root.orig ]; then
155 chmod 600 /var/spool/cron/root.orig
156 chown root:root /var/spool/cron/root.orig
161 if [ "$1" = "2" ]; then
162 FIND=`find /var/spool/cron -name \*.orig`
163 for FILE in $FIND; do
164 BASENAME=`basename $FILE`
165 USER=`echo "$BASENAME"| sed 's/.orig//'`
166 [ ! -z "$USER" ] && fcrontab -u $USER -z > /dev/null 2>&1
170 /sbin/chkconfig --add crond
171 if [ -f /var/lock/subsys/crond ]; then
172 /etc/rc.d/init.d/crond restart >&2
174 echo "Run \"/etc/rc.d/init.d/crond start\" to start cron daemon."
179 chgrp crontab /var/log/cron
180 chmod 660 /var/log/cron
183 if [ "$1" = "0" ]; then
184 if [ -f /var/lock/subsys/crond ]; then
185 /etc/rc.d/init.d/crond stop >&2
187 /sbin/chkconfig --del crond
189 rm -f /var/spool/cron/systab*
191 FIND=`find /var/spool/cron -name \*.orig`
192 for FILE in $FIND; do
193 BASENAME=`basename $FILE`
194 USER="`echo "$BASENAME"| sed 's/.orig//'`"
195 mv -f $FILE /var/spool/cron/$USER >/dev/null 2>&1
196 chown $USER:crontab /var/spool/cron/$USER >/dev/null 2>&1
197 chmod 600 /var/spool/cron/$USER >/dev/null 2>&1
199 rm -f /var/spool/cron/rm\.*
200 rm -f /var/spool/cron/fcrontab.sig
201 rm -f /var/spool/cron/new\.*
205 if [ "$1" = "0" ]; then
210 %triggerpostun -- vixie-cron <= 3.0.1-85
211 for i in `/bin/ls /var/spool/cron 2>/dev/null`
213 chown ${i} /var/spool/cron/${i} 2>/dev/null || :
215 /bin/chmod 660 /var/log/cron
216 /bin/chgrp crontab /var/log/cron
217 /bin/chmod 640 /etc/cron/cron.*
218 /bin/chgrp crontab /etc/cron/cron.*
220 %triggerpostun -- vixie-cron <= 3.0.1-73
221 if [ -f /etc/cron.d/cron.allow.rpmsave ]; then
222 mv -f /etc/cron.d/cron.allow.rpmsave /etc/cron/cron.allow
224 if [ -f /etc/cron.d/cron.allow ]; then
225 mv -f /etc/cron.d/cron.allow /etc/cron/cron.allow
227 if [ -f /etc/cron.d/cron.deny.rpmsave ]; then
228 mv -f /etc/cron.d/cron.deny.rpmsave /etc/cron/cron.deny
230 if [ -f /etc/cron.d/cron.deny ]; then
231 mv -f /etc/cron.d/cron.deny /etc/cron/cron.deny
234 %triggerpostun -- vixie-cron <= 3.0.1-70
235 if [ -f /etc/cron.allow ]; then
236 mv -f /etc/cron.allow /etc/cron/cron.allow
238 if [ -f /etc/cron.deny ]; then
239 mv -f /etc/cron.deny /etc/cron/cron.deny
242 %triggerpostun -- hc-cron
243 /sbin/chkconfig --del crond
244 /sbin/chkconfig --add crond
246 %triggerpostun -- hc-cron <= 0.14-12
247 for i in `/bin/ls /var/spool/cron 2>/dev/null`
249 chown ${i} /var/spool/cron/${i} 2>/dev/null || :
251 /bin/chmod 660 /var/log/cron
252 /bin/chgrp crontab /var/log/cron
253 /bin/chmod 640 /etc/cron/cron.*
254 /bin/chgrp crontab /etc/cron/cron.*
257 %defattr(644,root,root,755)
258 %doc doc/HTML doc/olddoc/{FAQ,CHANGES,README,THANKS,TODO}
259 %attr(0750,root,crontab) %dir %{_sysconfdir}/cron*
260 %attr(0640,root,crontab) %config(noreplace) /etc/cron.d/crontab
261 %attr(0640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.allow
262 %attr(0640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.deny
263 %attr(0640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cron
264 %attr(0644,root,crontab) %config(noreplace) %verify(not md5 size mtime) /etc/pam.d/fcron
265 %attr(0644,root,crontab) %config(noreplace) %verify(not md5 size mtime) /etc/pam.d/fcrontab
266 %attr(0754,root,root) /etc/rc.d/init.d/crond
267 %config(noreplace) %verify(not md5 size mtime) %attr(640,root,root) /etc/logrotate.d/cron
268 %attr(0640,root,crontab) %config(noreplace) /etc/fcron.conf
269 %attr(0755,root,root) %{_sbindir}/crond
270 %attr(6111,crontab,crontab) %{_bindir}/fcrontab
271 %attr(6111,crontab,crontab) %{_bindir}/crontab
272 %attr(4711,root,root) %{_bindir}/fcronsighup
273 %attr(6111,crontab,crontab) %{_bindir}/fcrondyn
274 %{_mandir}/man1/fcrondyn.1.*
275 %{_mandir}/man1/fcrontab.1.*
276 %{_mandir}/man5/fcron.conf.5*
277 %{_mandir}/man5/fcrontab.5*
278 %{_mandir}/man8/fcron.8*
279 %attr(1730,root,crontab) /var/spool/cron
280 %attr(0660,root,crontab) %ghost /var/log/cron