You are not logged in.

#1 2012-09-18 21:20:33

replabrobin
Member
Registered: 2010-05-06
Posts: 240

systemd versus acpid

I have converted a netbook to pure systemd. As I use slim+openbox I'm using acpid.service to handle lid close and power button presses. Mostly things work OK, but  about 10% of the time I find that acpid starts up in a weird state, the message says 'cannot open input layer'. When this happens acpid doesn't receive the power button event. I assume this is some kind of asynchronous start up issue caused by systemd not starting everything in the same order. If I restart acpid.service then the button press is properly intercepted. In the faiked state I see that logind is intercepting the power button (in journalctl output). Is this some kind of clash between logind & acpid? logind deosn't work for me as I want the power button to start oblogout and the lid switch to power the machine off; those beahviours are apparently beyond logind.

How do I fix/debug this kind of systemd issue? Do I actually need logind? Etc etc etc.

Offline

#2 2012-09-18 22:05:47

bwat47
Member
Registered: 2009-10-07
Posts: 638

Re: systemd versus acpid

Make sure all the lid/button handling stuff is disabled in /etc/systemd/logind.conf

Offline

#3 2012-09-18 23:57:01

David Batson
Member
Registered: 2011-10-13
Posts: 640

Re: systemd versus acpid

Offline

#4 2012-09-19 07:53:42

replabrobin
Member
Registered: 2010-05-06
Posts: 240

Re: systemd versus acpid

bwat47 wrote:

Make sure all the lid/button handling stuff is disabled in /etc/systemd/logind.conf

I have the logind.conf at default which according to the comment seems to mean OFF. I notice that even when acpid is working properly the event is passed to logind (according to journalctl -f).

I'll give that a try. However, the message 'cannot open input layer' seems to imply that acpid is starting too early. Perhaps I need to start it later?

Offline

#5 2012-09-19 08:55:18

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: systemd versus acpid

replabrobin wrote:

How do I fix/debug this kind of systemd issue? Do I actually need logind? Etc etc etc.

Are you using archbang?


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#6 2012-09-19 19:50:45

replabrobin
Member
Registered: 2010-05-06
Posts: 240

Re: systemd versus acpid

ngoonee wrote:
replabrobin wrote:

How do I fix/debug this kind of systemd issue? Do I actually need logind? Etc etc etc.

Are you using archbang?

no, I'm using standard Arch from the penultimate install media (I think that's 2012-07-15). You guys forced me to install arch last time I mentioned that my systems were originally installed from Archbang and banned me from a thread.

Offline

#7 2012-09-20 00:48:32

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: systemd versus acpid

replabrobin wrote:
ngoonee wrote:
replabrobin wrote:

How do I fix/debug this kind of systemd issue? Do I actually need logind? Etc etc etc.

Are you using archbang?

no, I'm using standard Arch from the penultimate install media (I think that's 2012-07-15). You guys forced me to install arch last time I mentioned that my systems were originally installed from Archbang and banned me from a thread.

OR you could have just kept archbang and asked on their forum. Choices, etc.

If you suspect a timing issue you should file a bug report, so that the package maintainer sees it.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#8 2012-09-20 20:52:00

replabrobin
Member
Registered: 2010-05-06
Posts: 240

Re: systemd versus acpid

If you suspect a timing issue you should file a bug report, so that the package maintainer sees it.

I think the problem is that acpid tries to open all the files /dev/input/event*, but presumably some or all of them are not ready when acpid starts. Systemd units allow to check for a glob pattern of files using ConditionPathExistsGlob=, but that presumably is part of the acpid.service file in the package which is controlled by Arch. Is this not an Arch bug? As for Archbang I think they do a good job of introducing Arch to naive users; there's no requirement to make life difficult.

Offline

#9 2012-09-21 01:11:29

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: systemd versus acpid

replabrobin wrote:

If you suspect a timing issue you should file a bug report, so that the package maintainer sees it.

I think the problem is that acpid tries to open all the files /dev/input/event*, but presumably some or all of them are not ready when acpid starts. Systemd units allow to check for a glob pattern of files using ConditionPathExistsGlob=, but that presumably is part of the acpid.service file in the package which is controlled by Arch. Is this not an Arch bug?

Shouldn't you check, first? Its not like its very hard to read .service and .socket files....

Hint: the acpid.service file in any Arch package besides systemd-arch-units is pure upstream

Hint 2: There is no ConditionPathExistsGlob in the acpid.service file. If this is a bug (and you'd have to test that it works with such a key) then bring it upstream. Part of the benefit of systemd is that a bug found in Arch is easily fixed for everyone...


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#10 2012-09-21 07:41:51

replabrobin
Member
Registered: 2010-05-06
Posts: 240

Re: systemd versus acpid

ngoonee wrote:

....

Shouldn't you check, first? Its not like its very hard to read .service and .socket files....

Hint: the acpid.service file in any Arch package besides systemd-arch-units is pure upstream

Hint 2: There is no ConditionPathExistsGlob in the acpid.service file. If this is a bug (and you'd have to test that it works with such a key) then bring it upstream. Part of the benefit of systemd is that a bug found in Arch is easily fixed for everyone...

Certainly I checked that there is no ConditionPathExistsGlob in the service file. I also looked at the abs version of the acpid package. The acpid.service file is not part of the acpid upstream so far as I can tell (it lives along side the PKGBUILD http://www.archlinux.org/packages/community/i686/acpid/) so I assume it's controlled by an Arch maintainer.

On the other hand I am not sure that just putting a ConditionPathExistsGlob in the service will work; the code in acpid input_layer.c seems to be attempting to read those files and presumably one or more exists, but is not openable for read.

Systemd is new to me, as are the exact details of the input_layer. That's why I ask here for advice. I don't think there's a bug in acpid, I think it's starting too early, but exactly how does one tell if the input layer is 'ready'? When this error happens some, but not all of the /dev/input/event* files are opened for listening by acpid. On a similar system with slightly different hardware I have not seen this problem, perhaps the errant hardware is slower?

Offline

#11 2012-09-21 08:38:01

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: systemd versus acpid

From someone who uses systemd (and did as well previously when it was still relatively new), the rather obvious answer would be that acpid should have a socket (which it does) which would cache all calls to it. The daemon should be able to handle those calls when it comes online but perhaps as you've seen the daemon actually doesn't. So perhaps the socket mechanism (which is a great way to parallelize things) is causing problems here.

A workaround would be to set the acpid service to start up right at the end, by setting After=something.target or something related (can't remember the syntax, sorry). Since your system is affected, you may want to try something along those lines. If it works as a workaround, file a report in flyspray, you'll get kicked upstream pronto if it is indeed upstream. AFAIK all arch maintainers who add systemd files also submit them upstream at the same time, so the 'control' of the file is temporary. That's part of the point for service files.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#12 2012-09-21 12:59:49

replabrobin
Member
Registered: 2010-05-06
Posts: 240

Re: systemd versus acpid

I will try delaying till after multi-user.target and see if that makes things better.

Offline

#13 2012-09-26 22:59:30

Chmurzak
Member
Registered: 2012-08-23
Posts: 1

Re: systemd versus acpid

I'm also having a problem with acpid and systemd. The command "sudo systemctl start acpid.service" starts it, but some commands in /etc/acpi/handler.sh don't work (like obshutdown or slock), others (like pm-suspend or systemctl suspend) work perfectly fine. When I execute acpid just by typing "sudo acpid" everything works very well.

Offline

#14 2012-09-27 00:05:31

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: systemd versus acpid

If you use the service, it will be run as root user and no X display will be associated.
To run screenlockers on all displays, you can use this script as an example: https://bbs.archlinux.org/viewtopic.php … 5#p1156025


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#15 2012-09-27 01:37:03

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: systemd versus acpid

@Chmurzak, I think your contribution to this thread is pretty blatantly thread hi-jacking.  Please open a new thread regarding your issue, as the only similarity between your problem and the OP is that they both involve acpid.

https://wiki.archlinux.org/index.php/Fo … _Hijacking  -- see here, though it would be wise to read the entire page.

BTW, welcome to the forums!

Offline

Board footer

Powered by FluxBB