Skip to content

Medusa installation CentOS

Dario edited this page Mar 4, 2019 · 17 revisions

CentOS 6-7

The following instructions are for installing Medusa on CentOS.

The installation should also be applicable to RHEL 6 and Fedora (12, 13, or 14) with minimal changes.

The installation assumes that you're not using the root user to install/run medusa - the entries for user:group throughout the document will have to be modified to match your user configuration.

  1. Install IUS Community Project repository The repository is needed for recent Python versions

    For CentOS 6:

    sudo yum install https://centos6.iuscommunity.org/ius-release.rpm
    

    For Centos 7:

    sudo yum install https://centos7.iuscommunity.org/ius-release.rpm
    
  2. Install prerequisites

     sudo yum install python36u wget git
    

    Install unrar:

    64bit

    wget https://www.rarlab.com/rar/rarlinux-x64-5.7.0.tar.gz
    tar -zxvf rarlinux-x64-5.7.0.tar.gz
    sudo cp -v rar/rar rar/unrar /usr/local/bin/
    

    32bit

    wget https://www.rarlab.com/rar/rarlinux-5.7.0.tar.gz
    tar -zxvf rarlinux-5.7.0.tar.gz
    sudo cp -v rar/rar rar/unrar /usr/local/bin/
    
  3. Add new group and user

    sudo groupadd media
    sudo useradd -g media medusa
    
  4. Clone medusa git repo

    sudo git clone https://github.com/pymedusa/Medusa.git /usr/share/medusa
  5. Set correct ownership

    chown -R medusa:media /usr/share/medusa

For systemd (CentOS 7)

  1. Copy systemd service

    sudo cp -v /usr/share/medusa/runscripts/init.systemd /etc/systemd/system/medusa.service
    

    Make sure your new service has correct permissions

    sudo chown root:root /etc/systemd/system/medusa.service
    sudo chmod 644 /etc/systemd/system/medusa.service
  2. Enable, start, and then check the status of your new service

    sudo systemctl enable medusa
    sudo systemctl start medusa
    sudo systemctl status medusa
  3. Add Medusa to startup (optional)

    sudo systemctl enable medusa.service
    

For Init Systems

  1. Copy init file to system init

    sudo cp /usr/share/medusa/runscripts/init.fedora /etc/init.d/medusa
  2. Make init file executable

    sudo chmod +x /etc/init.d/medusa
  3. Modify init file

    sudo sed 's|/etc/sysconfig/sickbeard|/etc/sysconfig/medusa|' -i /etc/init.d/medusa
  4. Create configuration file /etc/sysconfig/medusa with the following content

    # Medusa service configuration
    
    #run Medusa as
    SR_USER=media
    SR_HOME=/usr/share/medusa
    SR_DATA=/usr/share/medusa
    SR_PIDFILE=/usr/share/medusa/medusa.pid
    
    #gui address, eg: \${protocol}://\${host}:\${port}/home/
    protocol=http
    host='<<< hostname or IP >>>' #example host=mymachine
    port='<<<Desired Port>>>'     #example port=8081
    
    #leave blank if no username/password is required to access the gui
    username=
    password=
    
    #use nice, ionice, taskset to start Medusa
    nicecmd=
    #  example: nicecmd="nice -n 19 ionice -c3"
  5. Add the medusa service to system services

    sudo chkconfig --add medusa
  6. Configure medusa service to start on system startup

    sudo chkconfig medusa on
  7. Start medusa service

    sudo service medusa start

All done, verify that Medusa is accessible at gui address, eg: http://your_ip:8081