rpms/acpid/F-8 acpid-1.0.6-log.patch, NONE, 1.1 acpid-1.0.6-fd.patch, 1.1, 1.2 acpid.init, 1.5, 1.6 acpid.spec, 1.25, 1.26 acpid.logrotate, 1.1, NONE

Zdenek Prikryl (zprikryl) fedora-extras-commits at redhat.com
Fri Nov 23 14:11:56 UTC 2007


Author: zprikryl

Update of /cvs/extras/rpms/acpid/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22538

Modified Files:
	acpid-1.0.6-fd.patch acpid.init acpid.spec 
Added Files:
	acpid-1.0.6-log.patch 
Removed Files:
	acpid.logrotate 
Log Message:
Removed old logrotate file
Fixed socket leak (#394431)
Fixed dumping useless info to log (#389581)


acpid-1.0.6-log.patch:

--- NEW FILE acpid-1.0.6-log.patch ---
--- acpid-1.0.6/acpid.c.log	2007-10-11 17:56:11.000000000 +0200
+++ acpid-1.0.6/acpid.c	2007-10-12 10:50:36.000000000 +0200
@@ -158,7 +158,7 @@ main(int argc, char **argv)
 	if (open_log() < 0) {
 		exit(EXIT_FAILURE);
 	}
-	acpid_log(LOG_INFO, "starting up\n");
+	acpid_log(LOG_NOTICE, "starting up\n");
 
 	/* trap key signals */
 	signal(SIGHUP, reload_conf);
@@ -205,11 +205,15 @@ main(int argc, char **argv)
 			/* read and handle an event */
 			event = read_line(event_fd);
 			if (event) {
-				acpid_log(LOG_INFO,
-				    "received event \"%s\"\n", event);
+				if(acpid_debug) {
+					acpid_log(LOG_INFO,
+				    	"received event \"%s\"\n", event);
+				}
 				acpid_handle_event(event);
-				acpid_log(LOG_INFO,
-				    "completed event \"%s\"\n", event);
+				if (acpid_debug) {
+					acpid_log(LOG_INFO,
+				    	"completed event \"%s\"\n", event);
+				}
 			} else if (errno == EPIPE) {
 				acpid_log(LOG_WARNING,
 				    "events file connection closed\n");
--- acpid-1.0.6/event.c.log	2007-10-11 17:56:11.000000000 +0200
+++ acpid-1.0.6/event.c	2007-10-12 10:50:48.000000000 +0200
@@ -154,8 +154,10 @@ acpid_read_conf(const char *confdir)
 	closedir(dir);
 	unlock_rules();
 
-	acpid_log(LOG_INFO, "%d rule%s loaded\n",
-	    nrules, (nrules == 1)?"":"s");
+	if (acpid_debug) {
+		acpid_log(LOG_INFO, "%d rule%s loaded\n",
+	    	nrules, (nrules == 1)?"":"s");
+	}
 
 	return 0;
 }
@@ -341,9 +343,11 @@ acpid_add_client(int clifd, const char *
 		nrules++;
 	}
 
-	acpid_log(LOG_INFO, "%d client rule%s loaded\n",
-	    nrules, (nrules == 1)?"":"s");
-
+	if (acpid_debug) {
+		acpid_log(LOG_INFO, "%d client rule%s loaded\n",
+	    	nrules, (nrules == 1)?"":"s");
+	}
+	
 	return 0;
 }
 
@@ -565,8 +569,9 @@ do_cmd_rule(struct rule *rule, const cha
 	case 0: /* child */
 		/* parse the commandline, doing any substitutions needed */
 		action = parse_cmd(rule->action.cmd, event);
-		acpid_log(LOG_INFO, "executing action \"%s\"\n", action);
-
+		if (acpid_debug) {
+			acpid_log(LOG_INFO, "executing action \"%s\"\n", action);
+		}
 		/* reset signals */
 		signal(SIGHUP, SIG_DFL);
 		signal(SIGTERM, SIG_DFL);
@@ -588,14 +593,20 @@ do_cmd_rule(struct rule *rule, const cha
 	if (acpid_debug)
 		fprintf(stdout, "END HANDLER MESSAGES\n");
 	if (WIFEXITED(status)) {
-		acpid_log(LOG_INFO, "action exited with status %d\n",
-		    WEXITSTATUS(status));
+		if (acpid_debug) {
+			acpid_log(LOG_INFO, "action exited with status %d\n",
+		    	WEXITSTATUS(status));
+		}
 	} else if (WIFSIGNALED(status)) {
-		acpid_log(LOG_INFO, "action exited on signal %d\n",
-		    WTERMSIG(status));
+		if (acpid_debug) {
+			acpid_log(LOG_INFO, "action exited on signal %d\n",
+		    	WTERMSIG(status));
+		}
 	} else {
-		acpid_log(LOG_INFO, "action exited with status %d\n",
-		    status);
+		if (acpid_debug) {
+			acpid_log(LOG_INFO, "action exited with status %d\n",
+		    	status);
+		}
 	}
 
 	return 0;
@@ -607,7 +618,9 @@ do_client_rule(struct rule *rule, const 
 	int r;
 	int client = rule->action.fd;
 
-	acpid_log(LOG_INFO, "notifying client %s\n", rule->origin);
+	if (acpid_debug) {
+		acpid_log(LOG_INFO, "notifying client %s\n", rule->origin);
+	}
 
 	r = safe_write(client, event, strlen(event));
 	if (r < 0 && errno == EPIPE) {

acpid-1.0.6-fd.patch:

Index: acpid-1.0.6-fd.patch
===================================================================
RCS file: /cvs/extras/rpms/acpid/F-8/acpid-1.0.6-fd.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- acpid-1.0.6-fd.patch	26 Sep 2007 13:49:40 -0000	1.1
+++ acpid-1.0.6-fd.patch	23 Nov 2007 14:11:52 -0000	1.2
@@ -1,6 +1,14 @@
---- acpid-1.0.6.orig/acpid.c	2007-09-24 18:49:02.000000000 -0400
-+++ acpid-1.0.6/acpid.c	2007-09-24 18:52:44.000000000 -0400
-@@ -397,7 +397,7 @@ open_log(void)
+--- acpid-1.0.6/acpid.c.fd	2007-11-23 14:12:36.000000000 +0100
++++ acpid-1.0.6/acpid.c	2007-11-23 14:13:03.000000000 +0100
+@@ -246,6 +246,7 @@ main(int argc, char **argv)
+ 				    strerror(errno));
+ 				continue;
+ 			}
++			fcntl(cli_fd, F_SETFD, FD_CLOEXEC);
+ 			snprintf(buf, sizeof(buf)-1, "%d[%d:%d]",
+ 				creds.pid, creds.uid, creds.gid);
+ 			acpid_add_client(cli_fd, buf);
+@@ -397,7 +398,7 @@ open_log(void)
  	int log_opts;
  
  	/* open /dev/null */
@@ -9,9 +17,8 @@
  	if (nullfd < 0) {
  		fprintf(stderr, "%s: can't open %s: %s\n", progname, 
  			"/dev/null", strerror(errno));
-diff -urp acpid-1.0.6.orig/event.c acpid-1.0.6/event.c
---- acpid-1.0.6.orig/event.c	2007-09-24 18:49:02.000000000 -0400
-+++ acpid-1.0.6/event.c	2007-09-24 18:55:10.000000000 -0400
+--- acpid-1.0.6/event.c.fd	2007-05-25 06:26:09.000000000 +0200
++++ acpid-1.0.6/event.c	2007-11-23 14:12:36.000000000 +0100
 @@ -318,6 +318,7 @@ parse_file(const char *file)
  			    file);
  		}
@@ -29,4 +36,3 @@
  		if (*p == '%') {
  			p++;
  			if (*p == 'e') {
-


Index: acpid.init
===================================================================
RCS file: /cvs/extras/rpms/acpid/F-8/acpid.init,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- acpid.init	23 Oct 2007 16:03:28 -0000	1.5
+++ acpid.init	23 Nov 2007 14:11:52 -0000	1.6
@@ -21,15 +21,6 @@
 # Source function library.
 . /etc/rc.d/init.d/functions
 
-# Check that we're a priviledged user
-[ `id -u` = 0 ] || exit 1
-
-# Check if acpid is executable
-test -x /usr/sbin/acpid || exit 1
-
-# Check for kernel support
-[ -f /proc/acpi/event ] || exit 1
-
 RETVAL=0
 
 #
@@ -37,10 +28,19 @@
 #
 
 start() {
+	# Check that we're a privileged user
+	[ `id -u` = 0 ] || exit 4
+	
+	# Check if acpid is executable
+	test -x /usr/sbin/acpid || exit 5
+	
+	# Check for kernel support
+	[ -f /proc/acpi/event ] || exit 1
+
 	# Check if it is already running
 	if [ ! -f /var/lock/subsys/acpid ]; then
 		echo -n $"Starting acpi daemon: "	
-	    daemon /usr/sbin/acpid $@
+	    daemon /usr/sbin/acpid
 	    RETVAL=$?
 	    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/acpid
 	    echo
@@ -60,7 +60,7 @@
 
 restart() {
 	stop
-	start $@
+	start
 }	
 
 reload() {
@@ -72,7 +72,7 @@
 
 case "$1" in
 start)
-	start $2
+	start
 	;;
 stop)
 	stop
@@ -85,11 +85,11 @@
 	RETVAL=3
 	;;
 restart)
-	restart $2
+	restart
 	;;
 condrestart)
 	if [ -f /var/lock/subsys/acpid ]; then
-	    restart $2
+	    restart
 	fi
 	;;
 status)


Index: acpid.spec
===================================================================
RCS file: /cvs/extras/rpms/acpid/F-8/acpid.spec,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- acpid.spec	23 Oct 2007 16:05:19 -0000	1.25
+++ acpid.spec	23 Nov 2007 14:11:52 -0000	1.26
@@ -1,17 +1,17 @@
 Summary: ACPI Event Daemon
 Name: acpid
 Version: 1.0.6
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: GPL
 Group: System Environment/Daemons
 Source: http://prdownloads.sourceforge.net/acpid/acpid-%{version}.tar.gz
-Source1: acpid.logrotate
-Source2: acpid.init
-Source3: acpid.video.conf
-Source4: acpid.power.conf
+Source1: acpid.init
+Source2: acpid.video.conf
+Source3: acpid.power.conf
 Patch1: acpid-1.0.6-makefile.patch
 Patch2: acpid-1.0.6-return.patch
 Patch3: acpid-1.0.6-fd.patch
+Patch4: acpid-1.0.6-log.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 ExclusiveArch: ia64 x86_64 %{ix86}
 URL: http://acpid.sourceforge.net/
@@ -29,6 +29,7 @@
 %patch1 -p1 -b .makefile
 %patch2 -p1 -b .return
 %patch3 -p1 -b .fd
+%patch4 -p1 -b .log
 
 %build
 make %{?_smp_mflags}
@@ -42,14 +43,11 @@
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/acpi/events
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/acpi/actions
 chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/acpi/events
-install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/events/video.conf
-install -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/events/power.conf
-
-mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
-install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/acpid
+install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/events/video.conf
+install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/acpi/events/power.conf
 
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
-install -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/acpid
+install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/acpid
 
 
 %clean
@@ -64,7 +62,6 @@
 %dir %{_sysconfdir}/acpi/actions
 %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/acpi/events/video.conf
 %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/acpi/events/power.conf
-%config(noreplace) %{_sysconfdir}/logrotate.d/acpid
 %{_bindir}/acpi_listen
 %{_sbindir}/acpid
 %attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/acpid
@@ -87,6 +84,11 @@
 fi
 
 %changelog
+* Fri Nov 23 2007 Zdenek Prikryl <zprikryl at redhat.com> - 1.0.6-4.fc8
+- Removed old logrotate file
+- Fixed socket leak (#394431)
+- Fixed dumping useless info to log (#389581)
+
 * Thu Oct 23 2007 Zdenek Prikryl <zprikryl at redhat.com> - 1.0.6-3.fc8
 - Silent initscript
 - Resolves: #345611


--- acpid.logrotate DELETED ---




More information about the fedora-extras-commits mailing list