Blog P1ratRuleZZZ

WD MyBook Live — впечатления. Put a full torrent client with web interface Deluge-web

And So, recently acquired the device and quite happy with purchase! Сначала брал Zyxel NSA210 ee — впечатления от него были не самые лучшие. And the price they themselves, and not different! Zyxel is ~ 4000r, а WD MyBookLive – 4500,причем в MyBook уже установлен HDD на 1TB,Zyxel and it do not exist. У Zyxel есть конечно два USB порта и еще порт eSata — но нужны ли они? Of course,it's good,they are. But Hardy installed in this device is not been. And he has a terrible support. In general,connected, установил на него торрент клиент transmission и еще несколько каких-то сторонних пакетов и сломал девайс — он перестал загружаться вообще! Not normally found on the internet instructions on how,how to repair this device,and so I took it back and was immediately bought dovolen.I WD MyBookLive with two terabytes of memory. Impressions of the device pretty good! A good model. On the more interesting things,than my pointless babble, можно прочитать далее.Что же касается MyBookLive — тут вся операционная система хранится на самом же основном харде,which is divided into 4 section:

MyBookLive:/# parted -l Model: ATA WDC WD20EURS-63S (scsi)
Disk / dev / sda: 2000GB Sector size (logical / physical): 512B / 512B Partition Table: gpt Number Start End Size File system Name Flags
 3      15,7MB 528MB 513MB linux-swap(v1)  primary
 1      528MB 2576MB 2048MB ext3 primary raid
 2      2576MB 4624MB 2048MB ext3 primary raid
 4      4624MB 2000GB 1996GB ext4 primary

Sections 1 and 2 combined into a RAID array. I do not know, Why do I need a section number 2, but I guess, что это и есть CacheVolume — туда извлекается прошивка и потом оттуда уже переносится на системный раздел 1. Section 3 – подкачка, there is nothing special. And section 4 – непосредственно раздел для хранилища файлов. Well, infa about mount points and other things:

MyBookLive:/# df -h Filesystem Size Used Avail Use% Mounted on tmpfs 50M     0   50M   0% /lib/init/rw
udev                   10M  6,6M  3,5M  66% /dev tmpfs 50M     0   50M   0% /dev/shm
rootfs                1,9G  1,2G  644M  65% /
tmpfs                  50M  3,7M   47M   8% /tmp
ramlog-tmpfs           20M  9,7M   11M  49% /var / log
/ Dev / sda4 1,9T 847G 1005G  46% /DataVolume

This shows, that we have a system Debian Lenny takes to drive 2GB.

Now the main thing:
To install any packages we need root access to devaysu. For those, who do not understand yet, что такое этот девайс — это обычный компьютер, on which the only motherboard with processor, RAM, чип BIOS (Basic input-output), that boots the system from the hard disk, which is also connected to the motherboard of our devaysa.

Beautiful interface in this device no. Of course, could it put gnome or KDE, but that devayse that I do not become. Access can be obtained via SSH. By default, SSH is disabled in the device settings, hence it is necessary kerf! Proceed at http://moy_ip_adres_devaysa / and enter the admin password there, if you ask. Now go to http://moy_ip_adres_devaysa / UI / ssh (Register important) and include the ssh settings:

SSH включили. Now you need to join through devaysu.
To do this we need a ssh client Putty for Windows. You can download it is there

Enter to data:
Hostname: root@ip_address_девайса
You can also try: root@mybooklive (mybooklive — это сетевое имя девайса. You can see,as it is called,если зайти в Мой компьютер–>Net)

and click Open.
Black window opens asking you to enter your password:

Now type in a password: welc0me (when typing nothing will be displayed) and click Enter
We see the following:

It says,you need to be careful,dealing with Root access via ssh. А ведь они правы — с этим можно наиграться так,that turn your device into a brick) But that's OK,If you already ended guarantee SC,it is safe to open and restore the original firmware. Or carry a service center,because at the opening of the housing guarantees immediately lose. In general,better to follow the advice of the black box and be careful.

Proceed to install a torrent client. We will put the deluge-web. Very comfortable and beautiful,similar to uTorrent from Windows. First you need to add a line source with the address of the repository, from where we will download and install deluge-web.

cat "http://ftp.de.debian.org/debian lenny main" >> /etc/apt/sources.list
apt-get update
apt-get install deluged deluge-web

The answer Y to all requests. Ждем….

Installation Complete. Now you need to configure. Create a script to start and stop the service. First, create a configuration file service:

touch /etc/default/deluge-daemon
chmod 644 /etc/default/deluge-daemon
nano /etc/default/deluge-daemon

and paste (copy and click in the black window, right-click) the following code

# Configuration for /etc/init.d/deluge-daemon

# The init.d script will only run if this variable non-empty.
DELUGED_USER="root"             #user, which starts the application

# Should we run at startup?
RUN_AT_STARTUP="YES"

Click Ctrl+O and then Enter.

Теперь создадим еще один файл — сам startup script.

touch /etc/init.d/deluge-daemon chmod 755 /etc / init.d / deluge-daemon nano /etc/init.d/deluge-daemon

And there we insert the following code:

#!/bin / sh
### BEGIN INIT INFO
# Provides:          deluge-daemon
# Required-Start:    $local_fs $ remote_fs
# Required-Stop:     $local_fs $ remote_fs
# Should-Start:      $network
# Should-Stop:       $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Daemonized version of deluge and webui.
# Description:       Starts the deluge daemon with the user specified in
#                    /etc / default / deluge-daemon.
### END INIT INFO

# Author: Adolfo R. Brandes PATH = / usr / local / sbin:/usr / local / bin:/sbin:/bin:/usr / sbin:/usr/bin
DESC="Deluge Daemon"
NAME1="deluged"
NAME2="deluge"
DAEMON1=/usr/bin/deluged
DAEMON1_ARGS="-d"             # Consult `man deluged` for more options
DAEMON2=/usr/bin/deluge-web
DAEMON2_ARGS=""               # Consult `man deluge-web` for more options
PIDFILE1=/var/run/$NAME1.pid
PIDFILE2=/var/run/$NAME2.pid
UMASK=022                     # Change this to 0 if running deluged as its own user
PKGNAME=deluge-daemon
SCRIPTNAME=/etc/init.d/$PKGNAME

# Exit if the package is not installed
[ -x "$DAEMON1" -a -x "$DAEMON2" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$PKGNAME ] && . /etc/default/$PKGNAME

# Load the VERBOSE setting and other rcS variables
[ -f /etc/default/rcS ] && . /etc/default/rcS

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

if [ -from "$RUN_AT_STARTUP" -O "$RUN_AT_STARTUP" != "YES" ]
then
   log_warning_msg "Not starting $PKGNAME, edit /etc/default/$PKGNAME to start it."
   exit 0
fi

if [ -from "$DELUGED_USER" ]
then
    log_warning_msg "Not starting $PKGNAME, DELUGED_USER not set in /etc/default/$PKGNAME."
    exit 0
fi

#
# Function that starts the daemon/service
#
do_start()
{
   # Return
   #   0 if daemon has been started
   #   1 if daemon was already running
   #   2 if daemon could not be started start-stop-daemon --start --background --quiet --pidfile $ PIDFILE1 --exec $ DAEMON1 \
      --chuid $ DELUGED_USER --user $ DELUGED_USER --umask $ UMASK --test > /dev / null RETVAL1 ="$?"
   start-stop-daemon --start --background --quiet --pidfile $ PIDFILE2 --exec $ DAEMON2 \
      --chuid $ DELUGED_USER --user $ DELUGED_USER --umask $ UMASK --test > /dev / null RETVAL2 ="$?"
   [ "$RETVAL1" = "0" -a "$RETVAL2" = "0" ] || return 1

   start-stop-daemon --start --background --quiet --pidfile $ PIDFILE1 --make-pidfile --exec $ DAEMON1 \
      --chuid $ DELUGED_USER --user $ DELUGED_USER --umask $ UMASK -- $DAEMON1_ARGS RETVAL1 ="$?"
        sleep 2
   start-stop-daemon --start --background --quiet --pidfile $ PIDFILE2 --make-pidfile --exec $ DAEMON2 \
      --chuid $ DELUGED_USER --user $ DELUGED_USER --umask $ UMASK -- $DAEMON2_ARGS RETVAL2 ="$?"
   [ "$RETVAL1" = "0" -a "$RETVAL2" = "0" ] || return 2
}

#
# Function that stops the daemon / service
#
do_stop()
{
   # Return
   #   0 if daemon has been stopped
   #   1 if daemon was already stopped
   #   2 if daemon could not be stopped
   #   other if a failure occurred start-stop-daemon --stop --quiet --retry = TERM / 30 / KILL / 5 --user $ DELUGED_USER --pidfile $ PIDFILE2 RETVAL2 ="$?"
   start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --user $DELUGED_USER --pidfile $PIDFILE1
   RETVAL1="$?"
   [ "$RETVAL1" = "2" -O "$RETVAL2" = "2" ] && return 2

   rm -f $PIDFILE1 $PIDFILE2

   [ "$RETVAL1" = "0" -a "$RETVAL2" = "0" ] && return 0 || return 1
}

case "$1" in
  start)
   [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME1"
   do_start
   case "$?" in
      0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
      2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
   ESAC
   ;;
  stop)
   [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME1"
   do_stop
   case "$?" in
      0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
      2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
   ESAC
   ;;
  restart|force-reload)
   log_daemon_msg "Restarting $DESC" "$NAME1"
   do_stop
   case "$?" in
     0|1)
      do_start
      case "$?" in
         0) log_end_msg 0 ;;
         1) log_end_msg 1 ;; # Old process is still running
         *) log_end_msg 1 ;; # Failed to start
      esac
      ;;
     *)
        # Failed to stop
      log_end_msg 1
      ;;
   ESAC
   ;;
  *)
   echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
   exit 3
   ;;
ESAC

:

Save, pressing Ctrl+O and then Enter.

For,service to start automatically when you turn on the device,You can perform the following code

update-rc.d deluge-daemon defaults

To remove from startup:

update-rc.d -f deluge-daemon remove

And, daemons and web interface:

/etc/init.d/deluge-daemon start

To stop:

/etc/init.d/deluge-daemon stop

At all, for myself, I set up a service enabling and disabling scheduled using cron

You can edit your own schedule, scored:

crontab -e

and not to forget to keep exit! Here's an example of my file with the schedule:

# m h  dom mon dow   command
# Launch torrent deluge in 10:00, 15:00 and in 20:00.
#и пишу данные в лог файл /var/log/deluge-daemon.cron.log
0,0,0 10,15,20 * * * /etc/init.d/deluge-daemon start && echo "Deluge daemon started at `date`">>/var/log/deluge-daemon.cron.log

#
# I stop the torrent in 1:00, 12:00 and in 18:00.
#and also write data to the same log file.
#0,0 1,15 * * * /etc/init.d/transmission-daemon stop>>/var/log/cron-transmission.log && echo "Cut down fuck">>/var/log/cron-transmission.log
#
0,0,0 1,13,18 * * * /etc/init.d/deluge-daemon stop && echo "Deluge daemon stopped at `date`">>/var/log/deluge-daemon.cron.log

Reference:

Exit mobile version