Package: at Version: 3.1.20-3 Severity: wishlist Tags: patch I use at from cronjobs (I can't use cron directly because the cronjob calculates the time according to sunrise / sunset). I think it's silly that at always outputs two lines to stderr and that there's no way to prevent this; I don't need to know the job number and that the script will be run using /bin/sh, thank you very much; I know that by now.
I've added an option -s for silent that suppresses these two output lines. Please consider adding this to the official build. Thanks, Paul Slootman -- System Information: Debian Release: 9.0 APT prefers oldoldstable APT policy: (500, 'oldoldstable'), (500, 'unstable'), (500, 'oldstable') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.11.3-wurtel-ws (SMP w/8 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Init: sysvinit (via /sbin/init) Versions of packages at depends on: ii init-system-helpers 1.48 ii libc6 2.24-11 ii libpam-runtime 1.1.8-3.6 ii libpam0g 1.1.8-3.6 ii libselinux1 2.6-3+b1 ii lsb-base 9.20161125 Versions of packages at recommends: ii exim4-daemon-heavy [mail-transport-agent] 4.89-2 at suggests no packages. -- Configuration Files: /etc/at.deny [Errno 13] Permission denied: '/etc/at.deny' -- no debconf information
diff -ru --unidirectional-new-file at-3.1.20.orig/debian/changelog at-3.1.20/debian/changelog --- at-3.1.20.orig/debian/changelog 2016-12-08 20:21:58.000000000 +0100 +++ at-3.1.20/debian/changelog 2017-06-26 11:17:47.865773878 +0200 @@ -1,3 +1,10 @@ +at (3.1.20-3.1) UNRELEASED; urgency=medium + + * Added option -s for silencing at when creating jobs, ie. don't warn + about the shell and don't show the job ID. + + -- Paul Slootman <p...@debian.org> Mon, 26 Jun 2017 11:06:21 +0200 + at (3.1.20-3) unstable; urgency=medium * New version, because the previous one was tagged in error and remote diff -ru --unidirectional-new-file at-3.1.20.orig/debian/patches/99-silent-option at-3.1.20/debian/patches/99-silent-option --- at-3.1.20.orig/debian/patches/99-silent-option 1970-01-01 01:00:00.000000000 +0100 +++ at-3.1.20/debian/patches/99-silent-option 2017-06-26 11:22:32.977802011 +0200 @@ -0,0 +1,102 @@ +diff -ru at-3.1.20.orig/at.1.in at-3.1.20/at.1.in +--- at-3.1.20.orig/at.1.in 2015-12-18 21:29:24.000000000 +0100 ++++ at-3.1.20/at.1.in 2017-06-26 11:15:32.883058668 +0200 +@@ -8,7 +8,7 @@ + .IR queue ] + .RB [ -f + .IR file ] +-.RB [ -mMlv ] ++.RB [ -mMlvs ] + .IR timespec ... + .br + .B at +@@ -17,7 +17,7 @@ + .IR queue ] + .RB [ -f + .IR file ] +-.RB [ -mMkv ] ++.RB [ -mMkvs ] + .RB [ -t + .IR time ] + .br +@@ -257,6 +257,9 @@ + .P + Times displayed will be in the format "Thu Feb 20 14:50:00 1997". + .TP ++.B \-s ++Be silent; don't output "job xx at xxx" or "warning: commands will be executed using /bin/sh" messages when jobs are created. ++.TP + .B + \-c + cats the jobs listed on the command line to standard output. +diff -ru at-3.1.20.orig/at.c at-3.1.20/at.c +--- at-3.1.20.orig/at.c 2016-06-28 22:18:00.000000000 +0200 ++++ at-3.1.20/at.c 2017-06-26 11:15:25.773091230 +0200 +@@ -116,6 +116,7 @@ + "TERM", "DISPLAY", "_", "SHELLOPTS", "BASH_VERSINFO", "EUID", "GROUPS", "PPID", "UID" + }; + static int send_mail = 0; ++static int silent = 0; + + /* External variables */ + +@@ -512,10 +513,12 @@ + + close(fd2); + +- runtime = localtime(&runtimer); ++ if (!silent) { ++ runtime = localtime(&runtimer); + +- strftime(timestr, TIMESIZE, TIMEFORMAT_POSIX, runtime); +- fprintf(stderr, "job %ld at %s\n", jobno, timestr); ++ strftime(timestr, TIMESIZE, TIMEFORMAT_POSIX, runtime); ++ fprintf(stderr, "job %ld at %s\n", jobno, timestr); ++ } + + /* Signal atd, if present. Usual precautions taken... */ + fd = open(PIDFILE, O_RDONLY); +@@ -749,7 +752,7 @@ + char *pgm; + + int program = AT; /* our default program */ +- char *options = "q:f:MmbvlrdhVct:"; /* default options for at */ ++ char *options = "q:f:MmbvlrdhVct:s"; /* default options for at */ + int disp_version = 0; + time_t timer = 0; + struct passwd *pwe; +@@ -864,6 +867,10 @@ + timer -= timer % 60; + break; + ++ case 's': ++ silent = 1; ++ break; ++ + default: + usage(); + break; +@@ -946,7 +953,9 @@ + It also alows a warning diagnostic to be printed. Because of the + possible variance, we always output the diagnostic. */ + +- fprintf(stderr, "warning: commands will be executed using /bin/sh\n"); ++ if (!silent) { ++ fprintf(stderr, "warning: commands will be executed using /bin/sh\n"); ++ } + + writefile(timer, queue); + break; +--- at-3.1.20.orig/panic.c 2015-08-22 00:09:22.000000000 +0200 ++++ at-3.1.20/panic.c 2017-06-26 11:21:46.454681618 +0200 +@@ -92,8 +92,8 @@ + { + /* Print usage and exit. + */ +- fprintf(stderr, "Usage: at [-V] [-q x] [-f file] [-mMlbv] timespec ...\n" +- " at [-V] [-q x] [-f file] [-mMlbv] -t time\n" ++ fprintf(stderr, "Usage: at [-V] [-q x] [-f file] [-mMlbvs] timespec ...\n" ++ " at [-V] [-q x] [-f file] [-mMlbvs] -t time\n" + " at -c job ...\n" + " atq [-V] [-q x]\n" + " at [ -rd ] job ...\n" diff -ru --unidirectional-new-file at-3.1.20.orig/debian/patches/series at-3.1.20/debian/patches/series --- at-3.1.20.orig/debian/patches/series 2016-12-08 20:21:58.000000000 +0100 +++ at-3.1.20/debian/patches/series 2017-06-26 11:19:44.361907180 +0200 @@ -1,2 +1,3 @@ 01-fix-hyphenated-typo-on-parsetime.y 02-fix-pam.conf-from-ubuntu +99-silent-option