This configuration could be useful for security reasons and in order to create a multiuser environment (see setuprecording plugin).
NOTE: ALL THESE STEPS HAVE BEEN TESTED ON UBUNTU (12.04.4 at the moment).
Steps:
1.- Create a new gcuser user
{code:none}
sudo adduser --system --quiet --home /var/lib/gcuser --shell /bin/false --group --gecos "Galicaster Administrator" gcuser
{code}
2.- Create a new gcusers group
{code:none}
sudo addgroup --system --quiet gcusers
3.- Change galicaster log and conf files permissions.
{code:none}
ETCDIR="/etc/galicaster"
LOGDIR="/var/log/galicaster"
sudo chown -R gcuser:gcuser \${ETCDIR}
sudo find ${ETCDIR} -type d -exec chmod 0770 {} \;
sudo find ${ETCDIR} -type f -exec chmod 0660 {} \;
sudo install -d -o gcuser -g gcuser -m770 \${LOGDIR}
sudo touch \${LOGDIR}/galicaster.log
sudo chown gcuser:gcuser \${LOGDIR}/galicaster.log
sudo chmod 660 \${LOGDIR}/galicaster.log
{code}
4.- Add the application to sudoers.d
{code:none}
sudo sh -c 'cat >/etc/sudoers.d/galicaster <<EOF
%gcusers ALL=(gcuser:gcuser) NOPASSWD: /usr/bin/python /usr/share/galicaster/run_galicaster.py
EOF'
sudo chmod 0440 /etc/sudoers.d/galicaster
{code}
5.- Modify galicaster bin
{code:none}
sudo sh -c 'cat >/usr/bin/galicaster <<EOF
#!/bin/sh
sudo -g gcuser /usr/bin/python /usr/share/galicaster/run_galicaster.py
EOF'
sudo chmod -R 755 /usr/bin/galicaster
{code}
6.- Add the normal user to the gcusers group (you need to do this for each user you want to be able to run galicaster)
{code:none}
sudo addgroup `whoami` gcusers
{code}
Finally you need to close the session so the permission changes are applied correctly.
If you use a single repository for recordings common to all users, permissions have to allow read and write for all those users, so it should allow writing to group gcuser.
NOTE: ALL THE PROFILES CREATED IN /etc/galicaster/profiles SHOULD HAVE THE RIGHT PERMISSIONS (SEE 3)