On Fedora 23 I wanted to add custom action when laptop lid is opened. I have installed acpid and created three files:/etc/acpi/events/lidconf event=button/lidaction=/etc/acpi/actions/lid.sh %e/etc/acpi/actions/lid.sh#!/bin/bash/home/user/Utility/lid.sh $1/home/user/Utility/lid.sh#!/bin/bashDISPLAY=:0.0 su user -c echo $1 >> /home/user/lid.txtIt works perfectly when I run # /usr/sbin/acpid -f, but not at all when I do # systemctl start acpid.I have noticed that result of ps command is a bit different.As root:root      3796  0.0  0.0   4344  1704 ?        Ss   22:24   0:00 /usr/sbin/acpid -fUsing systemd:root      3918  0.0  0.0   4344  1780 pts/0    S+   22:25   0:00 /usr/sbin/acpid -fWhy it does not work when started by systemd?Edit: I have enabled log for acpid and this is what I get:received input layer event button/lid LID openrule from /etc/acpi/events/lidconf matchedexecuting action /etc/acpi/actions/lid.sh button/lid LID openaction exited with status 1261 total rule matchedcompleted input layer event button/lid LID openEdit2: ps aux -ZSystemd:system_u:system_r:apmd_t:s0     root      5177  0.1  0.0   4348  1756 ?        Ss   22:52   0:00 /usr/sbin/acpid -f -l -dRan as root:unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 root 5341 0.0  0.0 4344 1808 pts/0 S+ 22:56   0:00 /usr/sbin/acpid -f -l -d
Acpid action works when ran as root but not when started by systemd
fedora;systemd;acpid