Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37759584
en ru br
ALT Linux repositórios
S:0.5.12-alt4

Group :: Sistema/Base
RPM: incron

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Patch: incron-0.5.12-alt.patch
Download


 .gear/incron.spec       | 105 ++++++++++++++++++++++++++++++++++++++++++++++++
 .gear/incrond.init      |  76 +++++++++++++++++++++++++++++++++++
 .gear/incrond.service   |  10 +++++
 .gear/incrontab.control |  13 ++++++
 .gear/rules             |   6 +++
 .gear/tags/list         |   1 +
 icd-main.cpp            |   1 +
 usertable.cpp           |   2 +
 8 files changed, 214 insertions(+)
diff --git a/.gear/incron.spec b/.gear/incron.spec
new file mode 100644
index 0000000..d0aeaea
--- /dev/null
+++ b/.gear/incron.spec
@@ -0,0 +1,105 @@
+Summary: Inotify cron system
+Name: incron
+Version: 0.5.12
+Release: alt4
+
+Group: System/Base
+License: GPLv2
+Url: http://inotify.aiken.cz
+Source0: http://inotify.aiken.cz/download/incron/%name-%version.tar
+Source1: incrond.init
+Source2: incrontab.control
+Source3: incrond.service
+Patch0: %name-%version-alt.patch
+
+# Automatically added by buildreq on Sun May 24 2009
+BuildRequires: gcc-c++
+
+%description
+This program is an "inotify cron" system.
+It consists of a daemon and a table manipulator.
+You can use it a similar way as the regular cron.
+The difference is that the inotify cron handles
+filesystem events rather than time periods.
+
+%prep
+%setup -q
+%patch0 -p1
+
+%build
+%make CXXFLAGS="%optflags -std=c++14"
+
+%install
+#install files manually since source Makefile tries to do it as root
+install -D -p incrond %buildroot%_sbindir/incrond
+install -D -p -m 4755 incrontab %buildroot%_bindir/incrontab
+install -d %buildroot%_var/spool/%name
+install -d %buildroot%_sysconfdir/%name.d
+install -D -p %SOURCE1 %buildroot%_initdir/incrond
+install -D -p %SOURCE2 %buildroot%_controldir/incrontab
+install -D -p -m 0644 incron.conf.example %buildroot%_sysconfdir/%name.conf
+install -D -m644 %SOURCE3 %buildroot%_unitdir/incrond.service
+
+# install manpages
+make install-man MANPATH="%buildroot%_mandir" INSTALL="install -D -p"
+
+%pre
+/usr/sbin/groupadd -r -f incrontab &>/dev/null
+%pre_control incrontab
+
+%post
+%post_control incrontab
+%post_service incrond
+
+%preun
+%preun_service incrond
+
+%files
+%doc COPYING CHANGELOG README TODO LICENSE-GPL
+%attr(700,root,root) %_bindir/incrontab
+%_sbindir/incrond
+%_initdir/incrond
+%config(noreplace) %_sysconfdir/%name.conf
+%_controldir/incrontab
+%_mandir/man1/incrontab.1.*
+%_mandir/man5/incrontab.5.*
+%_mandir/man5/incron.conf.5.*
+%_mandir/man8/incrond.8.*
+%attr(3730,root,incrontab) %dir %_var/spool/%name
+%attr(700,root,root) %dir %_sysconfdir/%name.d
+%_unitdir/incrond.service
+
+%changelog
+* Tue Nov 22 2022 Anton Farygin <rider@altlinux.ru> 0.5.12-alt4
+- added patch from upstream against zombie processes (closes: #43764)
+
+* Sun Oct 03 2021 Anton Farygin <rider@altlinux.ru> 0.5.12-alt3
+- fixed FTBFS: force C++14
+
+* Wed Jan 16 2019 Anton Farygin <rider@altlinux.ru> 0.5.12-alt2
+- removed ubt
+
+* Wed May 16 2018 Anton Farygin <rider@altlinux.ru> 0.5.12-alt1
+- added %%ubt
+
+* Thu Jul 21 2016 Anton Farygin <rider@altlinux.ru> 0.5.12-alt1
+- new version
+
+* Fri Aug 15 2014 Denis Smirnov <mithraen@altlinux.ru> 0.5.10-alt2
+- add systemd unit
+
+* Wed Oct 09 2013 Anton Farygin <rider@altlinux.ru> 0.5.10-alt1
+- new version
+
+* Wed Dec 05 2012 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.5.9-alt1.1
+- Fixed build with glibc 2.16
+
+* Thu Sep 10 2009 Anton Farygin <rider@altlinux.ru> 0.5.9-alt1
+- new version
+
+* Mon May 25 2009 Anton Farygin <rider@altlinux.ru> 0.5.8-alt2
+- use group incrontab instead of crontab
+
+* Sun May 24 2009 Anton Farygin <rider@altlinux.ru> 0.5.8-alt1
+- first build for Sisyphus, based on RH spec
+
diff --git a/.gear/incrond.init b/.gear/incrond.init
new file mode 100644
index 0000000..4b81b52
--- /dev/null
+++ b/.gear/incrond.init
@@ -0,0 +1,76 @@
+#!/bin/bash
+#
+# incrond       This shell script enables the incrond daemon
+#
+# Author:       Ruben Kerkhof <ruben@rubenkerkhof.com>
+#
+# chkconfig:    - 97 03
+#
+# description:  This is a daemon which works like cron, but handles filesystem events
+#		instead of time periods.
+#               and can send notifications via mail, dbus or syslog.
+# processname:  incrond
+# pidfile:	/var/run/incrond.pid
+
+# source function library
+
+. /etc/init.d/functions
+
+PIDFILE=/var/run/incrond.pid
+LOCKFILE=/var/lock/subsys/incrond
+RETVAL=0
+
+start() {
+	start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- incrond
+	RETVAL=$?
+	return $RETVAL
+}
+
+stop()
+{
+	stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root incrond
+	RETVAL=$?
+	return $RETVAL
+}
+
+restart()
+{
+	stop
+	start
+}
+
+case "$1" in
+  start)
+	start
+	;;
+  stop) 
+	stop
+	;;
+  restart) 
+	restart
+	;;
+  condstop)
+	if [ -e "$LOCKFILE" ]; then
+		stop
+	fi
+	;;
+  condrestart)
+	if [ -e "$LOCKFILE" ]; then
+		restart
+	fi
+	;;
+  condreload)
+	if [ -e "$LOCKFILE" ]; then
+		restart
+	fi
+	;;
+  status)
+	status --pidfile "$PIDFILE" --expect-user root incrond
+	RETVAL=$?
+	;;
+  *)
+	echo $"Usage: $0 {start|stop|status|restart|reload|condrestart|condreload}"
+	exit 1
+esac
+
+exit $RETVAL
diff --git a/.gear/incrond.service b/.gear/incrond.service
new file mode 100644
index 0000000..b8cfa56
--- /dev/null
+++ b/.gear/incrond.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=works like cron, but handles filesystem events
+After=local-fs.target
+
+[Service]
+ExecStart=/usr/sbin/incrond -n
+ExecStop=/usr/sbin/incrond -k
+
+[Install]
+WantedBy=multi-user.target
diff --git a/.gear/incrontab.control b/.gear/incrontab.control
new file mode 100644
index 0000000..d4e6b30
--- /dev/null
+++ b/.gear/incrontab.control
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+. /etc/control.d/functions
+
+BINARY=/usr/bin/incrontab
+
+new_fmode public 2711 root incrontab
+new_fmode restricted 700 root root
+
+new_help public "Any user can execute $BINARY"
+new_help restricted "Only root can execute $BINARY"
+
+control_fmode "$BINARY" "$*" || exit 1
diff --git a/.gear/rules b/.gear/rules
new file mode 100644
index 0000000..5a29f0c
--- /dev/null
+++ b/.gear/rules
@@ -0,0 +1,6 @@
+tar: incron-@version@:.
+diff: incron-@version@:. . name=@name@-@version@-alt.patch
+copy: .gear/*.init
+copy: .gear/incrontab.control
+copy: .gear/*.service
+spec: .gear/incron.spec
diff --git a/.gear/tags/list b/.gear/tags/list
new file mode 100644
index 0000000..14c4c71
--- /dev/null
+++ b/.gear/tags/list
@@ -0,0 +1 @@
+02c88fb221987bb906f375b9cf31c614af76e829 incron-0.5.12
diff --git a/icd-main.cpp b/icd-main.cpp
index 687530a..2fc343b 100644
--- a/icd-main.cpp
+++ b/icd-main.cpp
@@ -104,6 +104,7 @@ void on_signal(int signo)
       g_fFinish = true;
       break;
     case SIGCHLD:
+      do {} while (waitpid((pid_t)-1, 0, WNOHANG) > 0); /* Prevent zombies */
       // first empty pipe (to prevent internal buffer overflow)
       do {} while (read(g_cldPipe[0], g_cldPipeBuf, CHILD_PIPE_BUF_LEN) > 0);
       
diff --git a/usertable.cpp b/usertable.cpp
index 3f1ef4a..111a6e6 100644
--- a/usertable.cpp
+++ b/usertable.cpp
@@ -500,6 +500,8 @@ void UserTable::OnEvent(InotifyEvent& rEvt)
 
     s_procMap.insert(PROC_MAP::value_type(pid, pd));
 #endif
+    int status;
+    waitpid(pid, &status, 0);
   }
   else {
 #ifdef LOOPER
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009