at/at-3.1.14-parse-suse-sysconfig.patch
Kristyna Streitova 658a744b4d Accepting request 512270 from home:scarabeus_iv:branches:Base:System
- Drop patch at-3.1.8-eal3-manpages.patch merged upstream differently

- Version update to at 3.1.20 to match latest upstream:
  * Pam and selinux implemented upstream
  * various tiny fixes
- Rebase patches:
  * at-3.1.13-documentation-dir.patch
  * at-3.1.13-massive_batch.patch
  * at-3.1.14-joblist.patch
  * at-3.1.14-parse-suse-sysconfig.patch
  * at-3.1.14-usePOSIXtimers.patch
  * at-3.1.14.patch
- Drop no longer needed patches:
  * at-3.1.13-formatbugs.patch
  * at-3.1.13-pam-session-as-root.patch
  * at-3.1.13-pam.patch
  * at-3.1.13-queue-nice-level.patch
  * at-3.1.14-selinux.patch

OBS-URL: https://build.opensuse.org/request/show/512270
OBS-URL: https://build.opensuse.org/package/show/Base:System/at?expand=0&rev=102
2017-07-27 14:14:04 +00:00

93 lines
2.6 KiB
Diff

From: Cristian Rodríguez <crrodriguez@opensuse.org>
Last updated by: Jan Engelhardt <jengelh@inai.de>
http://bugzilla.novell.com/780259
---
Makefile.in | 4 ++--
atd.c | 21 +++++++++++++++++++++
configure.in | 44 +++++++++++++++++++++++++++-----------------
3 files changed, 50 insertions(+), 19 deletions(-)
Index: Makefile.in
===================================================================
--- Makefile.in.orig
+++ Makefile.in
@@ -28,7 +28,7 @@ LEX = @LEX@
LEXLIB = @LEXLIB@
CC = @CC@
-CFLAGS = -I$(srcdir) @CFLAGS@
+CFLAGS = -I$(srcdir) @CFLAGS@ @HX_CFLAGS@
LDFLAGS = @LDFLAGS@
LFILE = $(ATJOB_DIR)/.SEQ
DEFS = @DEFS@ -DVERSION=\"$(VERSION)\" \
@@ -36,7 +36,7 @@ DEFS = @DEFS@ -DVERSION=\"$(VERSION)\"
-DDAEMON_USERNAME=\"$(DAEMON_USERNAME)\" \
-DDAEMON_GROUPNAME=\"$(DAEMON_GROUPNAME)\" \
-DLFILE=\"$(LFILE)\" -Wall
-LIBS = @LIBS@
+LIBS = @LIBS@ @HX_LIBS@
LIBOBJS = @LIBOBJS@
INSTALL = @INSTALL@
PAMLIB = @PAMLIB@
Index: atd.c
===================================================================
--- atd.c.orig
+++ atd.c
@@ -74,6 +74,10 @@
#include <syslog.h>
#endif
+#include <libHX/defs.h>
+#include <libHX/map.h>
+#include <libHX/option.h>
+
/* Local headers */
#include "privs.h"
@@ -798,6 +802,7 @@ main(int argc, char *argv[])
* for execution and yet another one, optionally, for sending mail.
* Files which already have run are removed during the next invocation.
*/
+ struct HXmap *sc_map;
int c;
time_t next_invocation;
struct sigaction act;
@@ -875,6 +880,22 @@ main(int argc, char *argv[])
}
}
+ sc_map = HX_shconfig_map("/etc/sysconfig/atd");
+ if (sc_map != NULL) {
+ char *v;
+
+ v = HXmap_get(sc_map, "ATD_BATCH_INTERVAL");
+ if (v != NULL && strlen(v) > 0) {
+ batch_interval = strtol(v, NULL, 0);
+ syslog(LOG_INFO, "sysconfig requested batch_interval to be set to %d\n", batch_interval);
+ }
+ v = HXmap_get(sc_map, "ATD_LOADAVG");
+ if (v != NULL && strlen(v) > 0) {
+ load_avg = strtod(v, NULL);
+ syslog(LOG_INFO, "sysconfig requested load_avg to be set to %f\n", load_avg);
+ }
+ }
+
namep = argv[0];
if (chdir(ATJOB_DIR) != 0)
perr("Cannot change to " ATJOB_DIR);
Index: configure.ac
===================================================================
--- configure.ac.orig
+++ configure.ac
@@ -54,6 +54,8 @@ AC_CHECK_LIB(fl,yywrap,
[Define to 1 if we need to provide our own yywrap()])
)
+PKG_CHECK_MODULES([HX], [libHX])
+
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC