Client persistently wants to halt if SHUTDOWN_TIME is set and the current time is between SHTUDOWN_TIME and midnight

Bug #604908 reported by BlackJudas on 2010-07-13
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
LTSP5
Medium
Vagrant Cascadian

Bug Description

Binary package hint: ldm

Based on the documentation I've looked at, I understood that SHUTDOWN_TIME was a simple daily trigger. After setting the SHUTDOWN_TIME value, the system kept popping up the shudown dialog (10s to shutdown) every time ldm started.

After looking in /usr/share/ldm/rc.d/I01-halt-check I noticed two issues. At first, the script does not check if the $SHUTDOWN_TIME variable is actually defined (has a value) and that the date checks tell the system to always shutdown between the shutdown time specified and midnight.

I propose that the documentation for LTSP contain a snippet of this behaviour if this is fully intended, or otherwise change the test to be optional, as it's not required unless this behaviour was intended :).

Thanks

Related branches

Stéphane Graber (stgraber) wrote :

Assigning to Marc Gariepy who knows more about that part of the code than I do.

Changed in ldm (Ubuntu):
status: New → Triaged
Changed in ltsp:
assignee: nobody → Marc Gariépy (mgariepy)
no longer affects: ldm (Ubuntu)

I am astonished that this bug is set to "affects 1 person". I have tried out the SHUTDOWN_TIME option for the first time today and immediately ran into the described problem -- as must everyone who uses it.

In short: Using this option in lts.conf renders all clients useless after the specified time. I do not believe that this is the intended behavior.

This bug report is three years old, it is about a well documented feature of LTSP. This feature is broken since at least 07/2010. Please go and fix it.

> After looking in /usr/share/ldm/rc.d/I01-halt-check I noticed two
> issues. At first, the script does not check if the $SHUTDOWN_TIME
> variable is actually defined (has a value)

Fixed this part of the issue:

  https://bazaar.launchpad.net/~ltsp-upstream/ltsp/ldm-trunk/revision/1560

It's a little cleaner to check if the variable is specified than relying
on the fact that the date command errors out when no value is specified.

> and that the date checks tell the system to always shutdown between
> the shutdown time specified and midnight.

So, there are two places where SHUTDOWN_TIME is used.

In the LTSP portion of the code, it's a cron job that will only be
triggered at the specified time in SHUTDOWN_TIME, and only if there
isn't a logged in LDM session.

In the LDM portion of the code, it's a hook that's run when LDM is
initialized, and as you've noticed, is triggered any time after the time
specified by SHUTDOWN_TIME, on the same date... i.e. between
SHUTDOWN_TIME and midnight. This is in case a user is logged in when the
LTSP cron job is triggered.

I think a cleaner way might be to have the cron job create the
/var/log/ltsp-logout-action file if a user is logged into LDM at the
time the cron job runs, and otherwise reboot. Then LDM will respond
appropriately, but only once. This should allow all the code to be
removed from LDM entirely, and only be present in LTSP.

live well,
  vagrant

Vagrant Cascadian (vagrantc) wrote :

On 2014-09-20 14:21:29 -0500, Vagrant Cascadian wrote:
> I think a cleaner way might be to have the cron job create the
> /var/log/ltsp-logout-action file if a user is logged into LDM at the
> time the cron job runs, and otherwise reboot. Then LDM will respond
> appropriately, but only once. This should allow all the code to be
> removed from LDM entirely, and only be present in LTSP.

Untested patch to implement this attached.

live well,
  vagrant

Changed in ltsp:
importance: Undecided → Medium
status: New → Confirmed
Vagrant Cascadian (vagrantc) wrote :

On 2014-09-20 14:45:08 -0500, Vagrant Cascadian wrote:
> On 2014-09-20 14:21:29 -0500, Vagrant Cascadian wrote:
>> I think a cleaner way might be to have the cron job create the
>> /var/log/ltsp-logout-action file if a user is logged into LDM at the
>> time the cron job runs, and otherwise reboot. Then LDM will respond
>> appropriately, but only once. This should allow all the code to be
>> removed from LDM entirely, and only be present in LTSP.
>
> Untested patch to implement this attached.
...
> ** Patch added: "shutdown-time-improvements.diff"
> https://bugs.launchpad.net/bugs/604908/+attachment/4210003/+files/shutdown-time-improvements.diff

Patch works. The only real difference is that the user doesn't receive
any feedback about what's happening.

live well,
  vagrant

Marc Gariépy (mgariepy) on 2014-09-23
Changed in ltsp:
assignee: Marc Gariépy (mgariepy) → Vagrant Cascadian (vagrantc)
Vagrant Cascadian (vagrantc) wrote :
Changed in ltsp:
status: Confirmed → Fix Committed
Vagrant Cascadian (vagrantc) wrote :

Also need to be running LDM without the halt-check hook:

https://bazaar.launchpad.net/~ltsp-upstream/ltsp/ldm-trunk/revision/1570

Alkis Georgopoulos (alkisg) wrote :

Fix released in LTSP 5.5.5 and LDM 2.2.15.

Changed in ltsp:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers