at-3.1.13-mailwithhostname.patch in email mention also hostname address.
This commit is contained in:
parent
451d8d2a07
commit
e85ff306c1
62
at-3.1.13-mailwithhostname.patch
Normal file
62
at-3.1.13-mailwithhostname.patch
Normal file
@ -0,0 +1,62 @@
|
||||
diff -up at-3.1.13/atd.c.hostname at-3.1.13/atd.c
|
||||
--- at-3.1.13/atd.c.hostname 2012-01-12 18:19:36.000000000 +0100
|
||||
+++ at-3.1.13/atd.c 2012-01-12 18:52:34.000000000 +0100
|
||||
@@ -99,6 +99,10 @@ int selinux_enabled=0;
|
||||
#define BATCH_INTERVAL_DEFAULT 60
|
||||
#define CHECK_INTERVAL 3600
|
||||
|
||||
+#ifndef MAXHOSTNAMELEN
|
||||
+#define MAXHOSTNAMELEN 64
|
||||
+#endif
|
||||
+
|
||||
/* Global variables */
|
||||
|
||||
uid_t real_uid, effective_uid;
|
||||
@@ -116,6 +120,7 @@ static time_t last_chg;
|
||||
static int nothing_to_do;
|
||||
unsigned int batch_interval;
|
||||
static int run_as_daemon = 0;
|
||||
+static int mail_with_hostname = 0;
|
||||
|
||||
static volatile sig_atomic_t term_signal = 0;
|
||||
|
||||
@@ -297,6 +302,7 @@ run_file(const char *filename, uid_t uid
|
||||
char fmt[64];
|
||||
unsigned long jobno;
|
||||
int rc;
|
||||
+ char hostbuf[MAXHOSTNAMELEN];
|
||||
#ifdef WITH_PAM
|
||||
int retcode;
|
||||
#endif
|
||||
@@ -451,6 +457,11 @@ run_file(const char *filename, uid_t uid
|
||||
|
||||
write_string(fd_out, "Subject: Output from your job ");
|
||||
write_string(fd_out, jobbuf);
|
||||
+ if (mail_with_hostname > 0) {
|
||||
+ gethostname(hostbuf, MAXHOSTNAMELEN-1);
|
||||
+ write_string(fd_out, " ");
|
||||
+ write_string(fd_out, hostbuf);
|
||||
+ }
|
||||
write_string(fd_out, "\nTo: ");
|
||||
write_string(fd_out, mailname);
|
||||
write_string(fd_out, "\n\n");
|
||||
@@ -910,7 +921,7 @@ main(int argc, char *argv[])
|
||||
run_as_daemon = 1;
|
||||
batch_interval = BATCH_INTERVAL_DEFAULT;
|
||||
|
||||
- while ((c = getopt(argc, argv, "sdl:b:f")) != EOF) {
|
||||
+ while ((c = getopt(argc, argv, "sdnl:b:f")) != EOF) {
|
||||
switch (c) {
|
||||
case 'l':
|
||||
if (sscanf(optarg, "%lf", &load_avg) != 1)
|
||||
@@ -932,6 +943,10 @@ main(int argc, char *argv[])
|
||||
daemon_foreground++;
|
||||
break;
|
||||
|
||||
+ case 'n':
|
||||
+ mail_with_hostname=1;
|
||||
+ break;
|
||||
+
|
||||
case 's':
|
||||
run_as_daemon = 0;
|
||||
break;
|
7
at.spec
7
at.spec
@ -23,6 +23,7 @@ Patch5: at-3.1.13-pam.patch
|
||||
Patch6: at-3.1.13-selinux.patch
|
||||
Patch7: at-3.1.12-nowrap.patch
|
||||
Patch8: at-3.1.12-fix_no_export.patch
|
||||
Patch9: at-3.1.13-mailwithhostname.patch
|
||||
|
||||
BuildRequires: fileutils /etc/init.d
|
||||
BuildRequires: flex flex-static bison autoconf
|
||||
@ -73,6 +74,7 @@ cp %{SOURCE1} .
|
||||
%patch6 -p1 -b .selinux
|
||||
%patch7 -p1 -b .nowrap
|
||||
%patch8 -p1 -b .export
|
||||
%patch9 -p1 -b .mail
|
||||
|
||||
%build
|
||||
# patch9 touches configure.in
|
||||
@ -188,10 +190,13 @@ fi
|
||||
%attr(0755,root,root) %{_initrddir}/atd
|
||||
|
||||
%changelog
|
||||
* Tue Apr 17 2012 Marcela Mašláňová <mmaslano@redhat.com> - 3.1.13-7
|
||||
- at-3.1.13-mailwithhostname.patch in email mention also hostname address
|
||||
|
||||
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.13-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||
|
||||
* Mon Nov 14 2011 Marcela Mašláňová <mmaslano@redhat.com> - 3.1.13-6
|
||||
* Mon Nov 14 2011 Marcela Mašláňová <mmaslano@redhat.com> - 3.1.13-5
|
||||
- 754156 fix typo in script
|
||||
|
||||
* Mon Nov 14 2011 Marcela Mašláňová <mmaslano@redhat.com> - 3.1.13-5
|
||||
|
Loading…
Reference in New Issue
Block a user