Hello.
I'm running a headless OpenBSD server.
I'm trying to create a startup script that executes the transmission-daemon as
a regular user.
Details:
located in /etc/transmission/rc.transmission
permissions
-rw-r----- 1 root wheel 390 Jul 13 18:30 rc.transmission
Script follows:
-------script start--------
#! /bin/sh
#Provides transmission-daemon
# --- Configuration ---
USERNAME=username
PASSWD=password
# --- End configuration ---
DESC="bittorrent client"
NAME=transmission-daemon
DAEMON=$(which $NAME)
CONFIGDIR="/home/$USERNAME/.config/$NAME"
#Start daemon
/usr/bin/sudo -u $USERNAME -p $PASSWD $DAEMON -g $CONFIGDIR
------script end---------
The following is appended to /etc/rc.conf
--
transmission=YES
--
the following is appended to /etc/rc.local
--
if [ -f /etc/transmission/rc.transmission]; then
if [ X"${transmission}" = X"YES" -a -x
/usr/local/bin/transmission-daemon ]; then
echo -n ' transmission-daemon'; .
/etc/transmission/rc.transmission
fi
fi
--
The rc.transmission script runs fine when executed under root, but it isn't
executed during boot.
Have been roaming around for tips but since i haven't figured out how OpenBSD
executes
startup scripts with other owners than root i'm out of ideas.
Hope somebody can give me pointers to what's wrong.
---
Regards,
Mats