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: 73042f2666dff27444789d542bbcd607
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-spooldir=%{_var}/spool/cron \
63 --with-run-non-privileged=no \
64 --with-boot-install=no \
66 --with-username=crontab \
67 --with-groupname=crontab \
70 --with-boot-install=no
74 echo "#!/bin/sh" > script/user-group
77 rm -rf $RPM_BUILD_ROOT
78 install -d $RPM_BUILD_ROOT{/var/{log,spool/cron},%{_mandir}} \
79 $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \
80 $RPM_BUILD_ROOT%{_sysconfdir}/{cron,cron.{d,hourly,daily,weekly,monthly},pam.d}
83 DESTDIR=$RPM_BUILD_ROOT \
84 DESTSBIN=$RPM_BUILD_ROOT%{_sbindir} \
85 DESTBIN=$RPM_BUILD_ROOT%{_bindir} \
86 DESTMAN=$RPM_BUILD_ROOT%{_mandir} \
92 #fix premission for rpmbuild
93 chmod +rw $RPM_BUILD_ROOT/usr/*bin/*
95 ln -sf %{_bindir}/fcrontab $RPM_BUILD_ROOT%{_bindir}/crontab
96 mv -f $RPM_BUILD_ROOT%{_sbindir}/fcron $RPM_BUILD_ROOT%{_sbindir}/crond
98 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/crond
99 install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/cron
100 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/cron
101 install %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.d/crontab
102 install %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/fcron
103 install %{SOURCE6} $RPM_BUILD_ROOT/etc/fcron.conf
104 install %{SOURCE7} $RPM_BUILD_ROOT/etc/pam.d/fcrontab
106 touch $RPM_BUILD_ROOT/var/log/cron
108 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.allow << EOF
109 # cron.allow This file describes the names of the users which are
110 # allowed to use the local cron daemon
114 cat > $RPM_BUILD_ROOT%{_sysconfdir}/cron/cron.deny << EOF2
115 # cron.deny This file describes the names of the users which are
116 # NOT allowed to use the local cron daemon
120 rm -rf $RPM_BUILD_ROOT
123 if [ -n "`/usr/bin/getgid crontab`" ]; then
124 if [ "`/usr/bin/getgid crontab`" != "117" ]; then
125 echo "Error: group crontab doesn't have gid=117. Correct this before installing cron." 1>&2
129 echo "Adding group crontab GID=117."
130 /usr/sbin/groupadd -g 117 -r -f crontab
133 if [ -n "`/bin/id -u crontab 2>/dev/null`" ]; then
134 if [ "`/bin/id -u crontab`" != "134" ]; then
135 echo "Error: user crontab doesn't have uid=134. Correct this before installing %{name}." 1>&2
139 /usr/sbin/useradd -u 134 -r -d /var/spool/cron -s /bin/false -c "crontab User" -g crontab crontab 1>&2
143 if [ "$1" = "1" ]; then
144 if [ -d /var/spool/cron ]; then
145 FIND=`find /var/spool/cron -type f`
146 for FILE in $FIND; do
147 mv -f $FILE $FILE.orig
148 USER=`basename $FILE`
149 chown crontab:crontab $FILE.orig
151 (test ! -z "$USER" && fcrontab -u $USER -z) > /dev/null 2>&1
153 if [ -f /var/spool/cron/root.orig ]; then
154 chmod 600 /var/spool/cron/root.orig
155 chown root:root /var/spool/cron/root.orig
160 if [ "$1" = "2" ]; then
161 FIND=`find /var/spool/cron -name \*.orig`
162 for FILE in $FIND; do
163 BASENAME=`basename $FILE`
164 USER=`echo "$BASENAME"| sed 's/.orig//'`
165 [ ! -z "$USER" ] && fcrontab -u $USER -z > /dev/null 2>&1
169 /sbin/chkconfig --add crond
170 if [ -f /var/lock/subsys/crond ]; then
171 /etc/rc.d/init.d/crond restart >&2
173 echo "Run \"/etc/rc.d/init.d/crond start\" to start cron daemon."
178 chgrp crontab /var/log/cron
179 chmod 660 /var/log/cron
182 if [ "$1" = "0" ]; then
183 if [ -f /var/lock/subsys/crond ]; then
184 /etc/rc.d/init.d/crond stop >&2
186 /sbin/chkconfig --del crond
188 rm -f /var/spool/cron/systab*
190 FIND=`find /var/spool/cron -name \*.orig`
191 for FILE in $FIND; do
192 BASENAME=`basename $FILE`
193 USER="`echo "$BASENAME"| sed 's/.orig//'`"
194 mv -f $FILE /var/spool/cron/$USER >/dev/null 2>&1
195 chown $USER:crontab /var/spool/cron/$USER >/dev/null 2>&1
196 chmod 600 /var/spool/cron/$USER >/dev/null 2>&1
198 rm -f /var/spool/cron/rm\.*
199 rm -f /var/spool/cron/fcrontab.sig
200 rm -f /var/spool/cron/new\.*
204 if [ "$1" = "0" ]; then
209 %triggerpostun -- vixie-cron <= 3.0.1-85
210 for i in `/bin/ls /var/spool/cron 2>/dev/null`
212 chown ${i} /var/spool/cron/${i} 2>/dev/null || :
214 /bin/chmod 660 /var/log/cron
215 /bin/chgrp crontab /var/log/cron
216 /bin/chmod 640 /etc/cron/cron.*
217 /bin/chgrp crontab /etc/cron/cron.*
219 %triggerpostun -- vixie-cron <= 3.0.1-73
220 if [ -f /etc/cron.d/cron.allow.rpmsave ]; then
221 mv -f /etc/cron.d/cron.allow.rpmsave /etc/cron/cron.allow
223 if [ -f /etc/cron.d/cron.allow ]; then
224 mv -f /etc/cron.d/cron.allow /etc/cron/cron.allow
226 if [ -f /etc/cron.d/cron.deny.rpmsave ]; then
227 mv -f /etc/cron.d/cron.deny.rpmsave /etc/cron/cron.deny
229 if [ -f /etc/cron.d/cron.deny ]; then
230 mv -f /etc/cron.d/cron.deny /etc/cron/cron.deny
233 %triggerpostun -- vixie-cron <= 3.0.1-70
234 if [ -f /etc/cron.allow ]; then
235 mv -f /etc/cron.allow /etc/cron/cron.allow
237 if [ -f /etc/cron.deny ]; then
238 mv -f /etc/cron.deny /etc/cron/cron.deny
241 %triggerpostun -- hc-cron
242 /sbin/chkconfig --del crond
243 /sbin/chkconfig --add crond
245 %triggerpostun -- hc-cron <= 0.14-12
246 for i in `/bin/ls /var/spool/cron 2>/dev/null`
248 chown ${i} /var/spool/cron/${i} 2>/dev/null || :
250 /bin/chmod 660 /var/log/cron
251 /bin/chgrp crontab /var/log/cron
252 /bin/chmod 640 /etc/cron/cron.*
253 /bin/chgrp crontab /etc/cron/cron.*
256 %defattr(644,root,root,755)
257 %doc doc/HTML doc/olddoc/{FAQ,CHANGES,README,THANKS,TODO}
258 %attr(0750,root,crontab) %dir %{_sysconfdir}/cron*
259 %attr(0640,root,crontab) %config(noreplace) /etc/cron.d/crontab
260 %attr(0640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.allow
261 %attr(0640,root,crontab) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/cron/cron.deny
262 %attr(0640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cron
263 %attr(0644,root,crontab) %config(noreplace) %verify(not md5 size mtime) /etc/pam.d/fcron
264 %attr(0644,root,crontab) %config(noreplace) %verify(not md5 size mtime) /etc/pam.d/fcrontab
265 %attr(0754,root,root) /etc/rc.d/init.d/crond
266 %config(noreplace) %verify(not md5 size mtime) %attr(640,root,root) /etc/logrotate.d/cron
267 %attr(0640,root,crontab) %config(noreplace) /etc/fcron.conf
268 %attr(0755,root,root) %{_sbindir}/crond
269 %attr(6111,crontab,crontab) %{_bindir}/fcrontab
270 %attr(6111,crontab,crontab) %{_bindir}/crontab
271 %attr(4711,root,root) %{_bindir}/fcronsighup
272 %attr(6111,crontab,crontab) %{_bindir}/fcrondyn
273 %{_mandir}/man1/fcrondyn.1.*
274 %{_mandir}/man1/fcrontab.1.*
275 %{_mandir}/man5/fcron.conf.5*
276 %{_mandir}/man5/fcrontab.5*
277 %{_mandir}/man8/fcron.8*
278 %attr(1730,root,crontab) /var/spool/cron
279 %attr(0660,root,crontab) %ghost /var/log/cron