Joined: 29 Jan 2006
|Posted: Thu Oct 11, 2012 1:43 pm Post subject: what user is used to call an external script ?
|I am currently running dovecot, and have written a service /etc/init.d/getmail that .... gets mail at regular intervals.
I wanted to use a plugin fetchmail-wakeup https://github.com/marschap/fetchmail_wakeup and use it to call the script when a client logs in. In the plugin configuration, I write
fetchmail_helper = /etc/init.d/getmail restart
Now this doesn't work because the service can only be started by root, and obviously the plugin does not call the script as root. I wanted now to use sudo for the call, but then I need to know the userid or group that does the calling.
I tried to write a small script "whoami > /tmp/output", gave it +x rights and changed the plugin to
fetchmail_helper = /my-whoami-script
I also get nothing from this, probably because the script runs as something like nobody and is not even allowed to write to tmp.
What could I do to try and get info on the userid that this plugin uses ?