#1 2024-03-09 11:54

derekz
Member
Registered: 2014-09-24
Posts: 11

Accidental shutdown with two users

Hi

I set a condition that if an user is inactive for 3 hours, poweroff pc

This is the problem:

User A login
User A normally shutdown PC

User B PowerON pc and, cause fastboot, Windows offers the login screen where you can enter your credentials and in the meantime preloads the desktop, where Shutter already starts (last user A session).

User B will use his credentials, and then Windows will load a new session, leaving user A in the background even though he is not in use. Due to this while user B is working, the computer will shut down due to user A being inactive.
How can I avoid this?

Thanks

Offline

#2 2024-03-23 21:18

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,400

Re: Accidental shutdown with two users

At the moment there is no built-in way to avoid this issue.

We are working on adding an option to handle such cases, possibly via an extra option or a dedicated event.

In the meantime, one could use the Program Output event with some external tool or a batch script that would trigger the event only if there is exactly one logged in user.

Offline

#3 2024-03-26 11:21

derekz
Member
Registered: 2014-09-24
Posts: 11

Re: Accidental shutdown with two users

den4b wrote:

At the moment there is no built-in way to avoid this issue.

We are working on adding an option to handle such cases, possibly via an extra option or a dedicated event.

In the meantime, one could use the Program Output event with some external tool or a batch script that would trigger the event only if there is exactly one logged in user.


Ok Den, update this topic when you have news ;-)

Thanks for your great work

Last edited by derekz (2024-03-26 11:21)

Offline

#4 2024-05-04 16:33

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,400

Re: Accidental shutdown with two users

While we are still working on a proper solution for this issue, there is something else you could try in the meantime.

Have you tried using other methods of monitoring user inactivity?

The event offers three different methods (available since v4.0.0.1):

  1. Last Input Event

  2. Low Level Hook

  3. Injection Hook

The first method captures activity only of the initiating user session. The other two methods should be able to capture user activity across all user sessions. This is not a solution, but it should mitigate the issue somewhat. Let us know how it goes.

Offline

#5 2024-05-05 17:27

derekz
Member
Registered: 2014-09-24
Posts: 11

Re: Accidental shutdown with two users

First attempt is with 1 and it doesn't work.

Workaround that I'm using (but I'm not sure that is ok) is this:

Condition ALL

Inactive user for 5min and flag on " Execute when user become active"
Cpu <50%
Inactive user for xxx min and no flag

I hope I explained myself, I have the Italian version

Last edited by derekz (2024-05-05 17:28)

Offline

#6 2024-05-31 18:08

derekz
Member
Registered: 2014-09-24
Posts: 11

Re: Accidental shutdown with two users

Hi Den, is there any news?

I haven't figured out yet if my experiment works, I always have little time to do a specific test, forgive me.

In the meantime, I would like to point out another problem in this procedure: when the PC turns off, it loses fastboot, and therefore it takes longer when I turn it back on. (tick OFF on "force" and ON on "reload app...")

Thanks for your work

Offline

#7 2024-06-04 08:19

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,400

Re: Accidental shutdown with two users

derekz wrote:

is there any news?

We have been experimenting with ways of detecting user logons and logoffs, but the findings are not very nice.

Windows provides a bunch of different APIs for enumerating user sessions, each geared towards different types of uses and session types. The problem is that there is no simple method to retrieve the total number of logged in users. Furthermore, enumerating user sessions requires administrative privileges, which means that either Shutter will have to run with administrative privileges (this is not a good solution) or we would need to develop and install a dedicated service that will run with administrative privileges for the sole purpose of enumerating user sessions and making that information available for Shutter instances to retrieve on demand.

It is possible to do that, but this won't come any time soon, if ever.

Have you tried using other methods of monitoring user inactivity, as mentioned above?

Offline

Board footer

Powered by FluxBB