at does not respect the [.ss] portion of the -t option

Bug #1464051 reported by Jim Rollenhagen
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
at (Debian)
Fix Released
Unknown
at (Ubuntu)
Fix Released
Low
Paride Legovini
Focal
Won't Fix
Undecided
Utkarsh Gupta
Groovy
Won't Fix
Undecided
Utkarsh Gupta

Bug Description

[Impact]
========

The seconds in the time string passed to -t is explicitly dropped in all cases. See: https://anonscm.debian.org/cgit/collab-maint/at.git/tree/at.c#n860

Thus the job is always locked to HH:MM:00.

[Test Plan]
===========

$ lxc launch ubuntu-daily:focal lp1464051-at-focal

$ lxc shell lp1464051-at-focal

# apt update && apt install at

# at -t 201506101624.05
warning: commands will be executed using /bin/sh
at> echo hi
at> <EOT>
job 1 at Wed Jun 10 16:24:00 2015

// now installing the patched version
# add-apt-repository ppa:utkarsh/at

# apt update && apt upgrade

# at -t 201506101624.05
warning: commands will be executed using /bin/sh
at> echo hi
at> <EOT>
job 1 at Wed Jun 10 16:24:05 2015

// thereby confirming that the fix indeed worked fine

[Where Problems Could Occur]
============================

Now that the patch doesn't subtracts the seconds anymore, there could be some edge case here and there (though unlikely & trivial).

Related branches

Revision history for this message
Jim Rollenhagen (jim-rollenhagen) wrote :

Patch compiles successfully and works as expected.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "0001-Allow-seconds-in-t-option.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in at (Ubuntu):
status: New → Confirmed
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I can also confirm this behavior

$ at -t 202012140849.27
warning: commands will be executed using /bin/sh
at> date > /tmp/testme
at> <EOT>
job 2 at Mon Dec 14 08:49:00 2020

$ cat /tmp/testme
Mo 14. Dez 08:49:00 CET 2020

So it announces AND executes ignoring the seconds.

That code is in since 3.1.11 by upstream which was the time that -t was added.

Seconds are only used in "-t option" -> "posixtime" -> "posixtime_time_parse" which is called before seconds are dropped intentionally.

This isn't a regression it always was a missing detail from upstream that never worked.
Note: this is the same as https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=792040
Adding that as tracker.

The change got now implemented by upstream in:
https://salsa.debian.org/debian/at/-/commit/15ee22de9dfd67d9c97404302623a9d45ce887a2

This was meant to be in 3.1.24, but that got never released.
It got into 3.2.0 which is a bigger step and not yet packaged/uploaded for Debian/Ubuntu (there is 3.2.1 already).

I'll subscribe paride who was recently merging "at" to consider getting this updated.

Changed in at (Ubuntu):
importance: Undecided → Low
Changed in at (Debian):
status: Unknown → New
Paride Legovini (paride)
Changed in at (Ubuntu):
assignee: nobody → Paride Legovini (paride)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package at - 3.1.23-1.1ubuntu2

---------------
at (3.1.23-1.1ubuntu2) hirsute; urgency=medium

  * d/patches: add 03-do-not-drop-seconds.patch (cherry-pick).
    When calculating time for the job, do not drop seconds. (LP: #1464051)

 -- Paride Legovini <email address hidden> Tue, 15 Dec 2020 12:01:14 +0100

Changed in at (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Affects Focal as well; would be awesome to backport this.

tags: added: server-next
Utkarsh Gupta (utkarsh)
tags: added: focal
Utkarsh Gupta (utkarsh)
description: updated
Changed in at (Ubuntu Focal):
assignee: nobody → Utkarsh Gupta (utkarsh)
Utkarsh Gupta (utkarsh)
Changed in at (Ubuntu Groovy):
assignee: nobody → Utkarsh Gupta (utkarsh)
Revision history for this message
Robie Basak (racb) wrote :

Please could you clarify the use case that requires sub-minute precision? Without an explanation of this, I don't see how an SRU is justified here.

Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Hi Robie,

Using at with `-t` is well-defined and used. From the manpage of at from focal:
-t time run the job at time, given in the format [[CC]YY]MMDDhhmm[.ss]

But that doesn't work w/o this patch, that is, [.ss] is never respected. If I were to schedule a one-time job where I need the sub-minute precision, I could never get that done even though "at" says (and documents) that it's indeed possible.

With this patch (and SRU), that [.ss] is respected and "at" works again as documented. Let me know if you need more details. Thanks for taking a look.

Revision history for this message
Robie Basak (racb) wrote :

I discussed this further with Utkarsh. Since there isn't currently a high impact use case and we have so few people affected since 2015, I'm going to reject this SRU on the basis that it doesn't meet the bar for risking regression and download/install bandwidth/time for existing users. On this basis, I'm marking the SRU tasks Won't Fix. Hirsute is fixed, and so the next LTS will also have this fixed.

This decision can be revisited if a high impact use case is put forward, and affected users volunteer to do the necessary QA.

Changed in at (Ubuntu Focal):
status: New → Won't Fix
Changed in at (Ubuntu Groovy):
status: New → Won't Fix
Revision history for this message
Robie Basak (racb) wrote : Proposed package upload rejected

An upload of at to groovy-proposed has been rejected from the upload queue for the following reason: "See previous comment".

Revision history for this message
Robie Basak (racb) wrote :

An upload of at to focal-proposed has been rejected from the upload queue for the following reason: "See previous comment".

Changed in at (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.