Прошу помощи в реализации
Система Freebsd8 Stable.
Трансмиссия стоит и уже работает на одного пользователя.
1. Создал нового пользователя системы, скопировал конфиг рабочей трансмисии, заменил в конфиге, порты пути и т.д., раздал права на каталоги
При запуске
Код: Выделить всё
/usr/local/bin/transmission-daemon --config-dir /home/transmission2
Так же, хотелось бы запускать второй процесс как демон, т.е. start/ restart и т.д.
Для этого скопировал старт скрипт trransmission в transmission2 и привел к такому виду
Код: Выделить всё
#!/bin/sh
#
# $FreeBSD: head/net-p2p/transmission-cli/files/transmission.in 338648 2014-01-04 15:33:14Z crees $
#
# PROVIDE: transmission2
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable this service:
#
# transmission2_enable:> Set to NO by default. Set it to YES to enable it.
# transmission2_watch_dir: Directory for torrent files to download
#<-----><------><------> automatically. Off by default unless you add
#<-----><------><------> a path.
# transmission2_conf_dir: Directory where transmission configuration
#<-----><------><------> data is stored.
#<-----><------><------> Default: /usr/local/etc/transmission/home
# transmission2_download_dir: Directory to store downloaded data.
#<-----><------><------> Default: /usr/local/etc/transmission/home/Downloads
# transmission2_user:<-> The user account transmission daemon runs as what
#<-----><------><------> you want it to be. It uses 'transmission' user by
#<-----><------><------> default.
# transmission2_web_home: Use alternative directory for the web interface
#<-----><------><------> files, such as javascript, html and graphics.
# transmission2_chown:<> By default, transmission checks and fixes the
#<-----><------><------> permissions for its home directory. If this
#<-----><------><------> causes problems, set this variable to no.
#
. /etc/rc.subr
name=transmission2
rcvar=transmission2_enable
load_rc_config $name
: ${transmission2_enable:=NO}
: ${transmission2_conf_dir=/usr/local/etc/transmission/home}
: ${transmission2_download_dir=/usr/local/etc/transmission/home/Downloads}
: ${transmission2_user:=transmission}
transmission2_group=${transmission2_group:-$transmission2_user}
: ${transmission2_chown:=yes}
command=/usr/local/bin/transmission-daemon
pidfile=/var/run/transmission2/daemon2.pid
start_precmd=transmission_prestart
transmission_flags=" \
<------>${transmission2_watch_dir:+-c ${transmission2_watch_dir}} \
<------>${transmission2_conf_dir:+-g ${transmission2_conf_dir}} \
<------>${transmission2_download_dir:+-w ${transmission2_download_dir}} \
<------>${pidfile:+-x $pidfile} \
<------>${transmission2_flags}"
transmission_prestart()
{
<------>install -d -o $transmission2_user ${pidfile%/*}
<------>if checkyesno transmission2_chown; then
<------><------>mkdir -p $transmission2_conf_dir $transmission2_download_dir
<------><------>chown $transmission2_user:$transmission2_group $transmission2_download_dir
<------><------>chown -R $transmission2_user:$transmission2_group $transmission2_conf_dir
<------><------>chgrp $transmission2_group $transmission2_conf_dir
<------><------>chmod 750 $transmission2_conf_dir
<------>fi
<------>if [ -n "$transmission2_web_home" ]; then
<------><------>TRANSMISSION_WEB_HOME=$transmission2_web_home
<------><------>export TRANSMISSION_WEB_HOME
<------>fi
}
# Unfortunately there was a typo in a previous version, which may have
# left some people with /var/run/transmission/damon.pid . Deal with
# this for a few months at least, until everyone will have restarted
# transmission
if [ ! -f $pidfile -a -f /var/run/transmission2/damon2.pid ]; then
<------>pidfile=/var/run/transmission2/damon2.pid
fi
run_rc_command $1
Код: Выделить всё
transmission2_enable="YES"
transmission2_conf_dir="/usr/home/transmission2/"
transmission2_download_dir="/storage1/media/Torrent2"
transmission2_user="transmission2"
transmission2_flags=""
Собственно цель всего этого, запустить отдельный демон трансмисии со своим конфигом