Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1338039

Summary: scripts run through "at" ignore SIGPIPE due to systemd, atd@.service needs IgnoreSIGPIPE=no
Product: Red Hat Enterprise Linux 7 Reporter: giulioo
Component: atAssignee: Tomas Mraz <tmraz>
Status: CLOSED ERRATA QA Contact: Radka Brychtova <rskvaril>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: jscotka, rskvaril
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: at-3.1.13-22.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 03:30:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description giulioo 2016-05-20 21:03:19 UTC
Description of problem:
Scripts run through "at" will ignore SIGPIPE sue to atd being tun from systemd which defaults to IgnoreSIGPIPE=yes

Version-Release number of selected component (if applicable):
at-3.1.13-20.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Create this script

#!/bin/sh
/usr/bin/seq 1 1000000|/usr/bin/head -n 1  >/tmp/my.out
/usr/bin/perl -le 'print $SIG{PIPE}' >> /tmp/my.out

2.
echo /path/script|at "now +1 minutes"

Actual results:
1. /tmp/my.out will contain 
   1
   IGNORE
2. /var/spool/mail/<user> will contain an email with
   /usr/bin/seq: write error: Broken pipe

Expected results:
1. /tmp/my.out will contain 
   1
   
2. No email

Additional info:

The file /usr/lib/systemd/system/atd.service needs
IgnoreSIGPIPE=no
in [Service] section

Comment 5 Radka Brychtova 2016-06-09 09:21:59 UTC
OLD PACKAGE
at-3.1.13-20.el7.x86_64

running reproducer: 
:: [   PASS   ] :: Command 'echo '#!/bin/sh
:: [   PASS   ] :: /usr/bin/seq 1 1000000|/usr/bin/head -n 1  >/tmp/my.out
:: [   PASS   ] :: /usr/bin/perl -le 'print {PIPE}' >> /tmp/my.out
:: [   PASS   ] :: ' > /tmp/tmp.vnQQ84kQ0d/testscript.sh' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'chmod +x /tmp/tmp.vnQQ84kQ0d/testscript.sh'
:: [   PASS   ] :: Command 'chmod +x /tmp/tmp.vnQQ84kQ0d/testscript.sh' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'echo $TmpDir/testscript.sh |at "now +1 minutes"'
job 1 at Thu Jun  9 08:53:00 2016
:: [   PASS   ] :: Command 'echo $TmpDir/testscript.sh |at "now +1 minutes"' (Expected 0, got 0)
:: [   PASS   ] :: File '/tmp/my.out' should contain '1' 
:: [   FAIL   ] :: File '/var/spool/mail/root' should not contain '/usr/bin/seq: write error: Broken pipe' 

-----------------------------

NEW PACKAGE
at-3.1.13-22.el7.x86_64

running reproducer:
:: [   PASS   ] :: Command 'echo '#!/bin/sh
:: [   PASS   ] :: /usr/bin/seq 1 1000000|/usr/bin/head -n 1  >/tmp/my.out
:: [   PASS   ] :: /usr/bin/perl -le 'print {PIPE}' >> /tmp/my.out
:: [   PASS   ] :: ' > /tmp/tmp.S7tx9LXGyG/testscript.sh' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'chmod +x /tmp/tmp.S7tx9LXGyG/testscript.sh'
:: [   PASS   ] :: Command 'chmod +x /tmp/tmp.S7tx9LXGyG/testscript.sh' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'echo $TmpDir/testscript.sh |at "now +1 minutes"'
job 1 at Thu Jun  9 04:51:00 2016
:: [   PASS   ] :: Command 'echo $TmpDir/testscript.sh |at "now +1 minutes"' (Expected 0, got 0)
:: [   PASS   ] :: File '/tmp/my.out' should contain '1' 
:: [   PASS   ] :: There is no new email


Since this test Passed on all architectures => verified

Comment 7 errata-xmlrpc 2016-11-04 03:30:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2311.html