I added a new group: ircuser and a new user: ircuser
In visudo I placed this line:
myuser localhost=(ircuser) NOPASSWD: /usr/bin/irssi
Created ircuser directory, where config files, caches, etc should be saved:
drwxrwx--- 2 ircuser ircuser 4096 Mar 2 10:28 ircuser
When issuing the command:
sudo -Hu ircuser /usr/bin/irssi
or
sudo -u ircuser /usr/bin/irssi
The program can't save the config file in the ircuser directory.
** ERROR **: Couldn't create /home/myuser/_web/ircuser/.irssi directory
aborting...
Aborted
But, it is being run as ircuser:
ps auxw | grep irssi
ircuser 11962 0.0 0.0 23684 2504 pts/6 S+ 11:18 0:00 /usr/bin/irssi
So, albeit irssi is run by ircuser it can't write to a directory owned by the same user?
What do I need to change to allow it saving there?

/home/myuser/_web/ircuser/exists ? if yes, it belongs to ? – Coren Mar 2 '12 at 14:35