abusenius / insaned

Simple daemon for polling button presses on SANE scanners
GNU General Public License v2.0
43 stars 13 forks source link

INSANED_USER and INSANED_GROUP variables have no effect #13

Open antimatter84 opened 6 years ago

antimatter84 commented 6 years ago

The environments file says:

# event handler scripts are executed with privileges of this user INSANED_USER=andreas INSANED_GROUP=andreas

but they are not.

I have set INSANED_USER and INSANED_GROUP as above and I have a dummy event handler "copy" in place and it only contains this for testing:

!/bin/bash

echo "Running as $(whoami)" >/tmp/copy.log

When pressing the copy button at the scanner the log file contains:

Running as root

Shouldn't this be "andreas"? I looked through the code but it does not seem, that INSANED_USER or INSANED_GROUP is picked up anywhere.

System: Linux Mint 19 Cinnamon

abusenius commented 6 years ago

Indeed, systemd/insaned.service is not using these variables.

hankschwie commented 5 years ago

And it seems you can't change the user/group in insaned.service either; if you try, the service does not start anymore. So seemingly there is no way to send emails from the accounts of the current user via thunderbird or evolution since they are started by root. Is there a solution for this?

The only workaround I found so far is to add insaned manually to autostart, not using the systemd-version.

EDIT: I found a way, I posted my solution here: [https://github.com/coaxial/insaned-config/issues/7]

system Ubuntu 18.04