[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Check if laptop in use?



Hello Jacob,

Jacob S wrote:

> I have a laptop on my network that I need to do an occasional upgrade
> on. It runs Debian - what else? :-) I'd like to make sure it's not
> currently in use when I do the upgrades though, as the upgrades are
> usually done over the network via ssh.

> I know this user always closes the lid on their laptop when they leave
> it for any extended period of time. So, my question is, is there a way
> to check the status of the lcd screen/lid closed switch? Alternative
> suggestions that would work better?

If ACPI is enabled then closing and opening the Lid generates an ACPI event
on some notebooks, which can be handled by acpid. On my asus
closing/opening the lid generates

 button/lid LIDD 00000080 00000003
 button/lid LIDD 00000080 00000004

in /proc/acpi/event

Another solution would be to create a /etc/nologin file (it's existence
disabled non-root logins), wait until the user logs out and perform the
update then, afterwards delete it. At least that would be the way I would
do it on a server.

Yours,
Karsten



Reply to: