On 10. apr. 2010, at 17.16, Christian Weisgerber wrote:
> Mats-Gxran Karlsen <[email protected]> wrote:
>
>> I'm trying to create a startup script that executes the transmission-daemon
as
>> a regular user.
>
>> /usr/bin/sudo -u $USERNAME -p $PASSWD $DAEMON -g $CONFIGDIR
> You are going about this the wrong way. sudo(8) is primarily
> designed to give additional priviledges to an unpriviledged user.
> You want to use su(1):
>
> su $USERNAME -c $DAEMON -g $CONFIGDIR
>
The problem seemed to be related to another execution of a script in rc.local
which needed to be executed and put into
the backround in order for the startup process to continue reading rc.local:
------snippet
if [ -f /etc/coherence/coherence.conf ]; then
if [ X"${coherence}" = X"YES" -a -x /usr/local/bin/coherence ]; then
# wrontg! echo -n ' coherence'; nohup /usr/local/bin/coherence -c
/etc/coherence/coherence.conf > /dev/null 2>& 1 &
echo -n ' coherence'; nohup /usr/local/bin/coherence -c
/etc/coherence/coherence.conf > /dev/null 2>& 1 &
fi
fi
------
After figuring this out i ditched my noobish transmission startup script and
went about doing things as obviously are meant to be done:
moved my rc.conf changes into rc.conf.local and changed to the following in
rc.local
---snippet
if [ -f /etc/transmission/rc.transmission ]; then
if [ X"${transmission}" = X"YES" -a -x
/usr/local/bin/transmission-daemon ]; then
echo -n ' transmission'; su -l transmission -c
"/usr/local/bin/transmission-daemon \
-g
/home/transmission/.config/transmission-daemon"
fi
fi
-------
Thanks for all the helpful input guys:)
----
Mats