title: Linux Malware Detect on shared hosting
body: <p>I am trying to install the excellent <a href="http://www.rfxn.com/projects/linux-malware-detect/" rel="nofollow">http://www.rfxn.com/projects/linux-malware-detect/</a> on a shared hosting.</p>
  
  <p>I have changed the inspath to my local dir but it gives errors on creating symbolic links, read only on /usr/lib/, and finally /usr/local/maldetect/conf.maldet not found.</p>
  
  <p>Thanks for any help. I think solving this would prove very useful to a lot of people.</p>
  
  <p>Here's the error:</p>
  
  <pre><code>./install.sh
  ln: creating symbolic link `/usr/local/sbin/maldet' to `/home6/anton/mal/maldet': No such file or directory
  ln: creating symbolic link `/usr/local/sbin/lmd' to `/home6/anton/mal/maldet': No such file or directory
  cp: cannot create regular file `/usr/lib/libinotifytools.so.0': Read-only file system
  Linux Malware Detect v1.3.9
              (C) 2002-2011, R-fx Networks &lt;proj@r-fx.org&gt;
              (C) 2011, Ryan MacDonald &lt;ryan@r-fx.org&gt;
  inotifywait (C) 2007, Rohan McGovern &lt;rohan@mcgovern.id.au&gt;
  This program may be freely redistributed under the terms of the GNU GPL v2
  
  maldet(15528): {glob} /usr/local/maldetect/conf.maldet not found, aborting.
  
  installation completed to /home6/anton/mal
  config file: /home6/anton/mal/conf.maldet
  exec file: /home6/anton/mal/maldet
  exec link: /usr/local/sbin/maldet
  exec link: /usr/local/sbin/lmd
  cron.daily: /etc/cron.daily/maldet
  
  .ca.def: line 1: /usr/local/maldetect/conf.maldet: No such file or directory
  imported config options from /home6/anton/mal.last/conf.maldet
  
  maldet(15578): {glob} /usr/local/maldetect/conf.maldet not found, aborting.
  </code></pre>
  
  <p>And here's the install bash:</p>
  
  <pre><code>#!/bin/bash
  #
  ##
  # Linux Malware Detect v1.3.9
  #             (C) 2002-2011, R-fx Networks &lt;proj@r-fx.org&gt;
  #             (C) 2011, Ryan MacDonald &lt;ryan@r-fx.org&gt;
  # inotifywait (C) 2007, Rohan McGovern  &lt;rohan@mcgovern.id.au&gt;
  # This program may be freely redistributed under the terms of the GNU GPL v2
  ##
  #
  inspath=/home6/anton/mal
  logf=$inspath/event_log
  cnftemp=.ca.def
  
  if [ ! -d "$inspath" ] &amp;&amp; [ -d "files" ]; then
      mkdir -p $inspath
      chmod 750 $inspath
      cp -pR files/* $inspath
      chmod 750 $inspath/maldet
      ln -fs $inspath/maldet /usr/local/sbin/maldet
      ln -fs $inspath/maldet /usr/local/sbin/lmd
      cp $inspath/inotify/libinotifytools.so.0 /usr/lib/
  else
      $inspath/maldet -k &gt;&gt; /dev/null 2&gt;&amp;1
      mv $inspath $inspath.bk$$
      rm -f $inspath.last
      ln -fs $inspath.bk$$ $inspath.last
          mkdir -p $inspath
          chmod 750 $inspath
          cp -pR files/* $inspath
          chmod 750 $inspath/maldet
      ln -fs $inspath/maldet /usr/local/sbin/maldet
      ln -fs $inspath/maldet /usr/local/sbin/lmd
      cp $inspath/inotify/libinotifytools.so.0 /usr/lib/
      cp -f $inspath.bk$$/sess/* $inspath/sess/ &gt;&gt; /dev/null 2&gt;&amp;1
      cp -f $inspath.bk$$/tmp/* $inspath/tmp/ &gt;&gt; /dev/null 2&gt;&amp;1
      cp -f $inspath.bk$$/quarantine/* $inspath/quarantine/ &gt;&gt; /dev/null 2&gt;&amp;1
  fi
  
  if [ -d "/etc/cron.daily" ]; then
      cp -f cron.daily /etc/cron.daily/maldet
      chmod 755 /etc/cron.daily/maldet
  fi
      touch $logf
      $inspath/maldet --alert-daily
      $inspath/maldet --alert-weekly
          echo "Linux Malware Detect v1.3.9"
          echo "            (C) 2002-2011, R-fx Networks &lt;proj@r-fx.org&gt;"
          echo "            (C) 2011, Ryan MacDonald &lt;ryan@r-fx.org&gt;"
          echo "inotifywait (C) 2007, Rohan McGovern &lt;rohan@mcgovern.id.au&gt;"
          echo "This program may be freely redistributed under the terms of the GNU GPL"
      echo ""
      echo "installation completed to $inspath"
      echo "config file: $inspath/conf.maldet"
      echo "exec file: $inspath/maldet"
      echo "exec link: /usr/local/sbin/maldet"
      echo "exec link: /usr/local/sbin/lmd"
      echo "cron.daily: /etc/cron.daily/maldet"
      echo ""
      if [ -f "$cnftemp" ] &amp;&amp; [ -f "$inspath.bk$$/conf.maldet" ]; then
          . files/conf.maldet
          . $inspath.bk$$/conf.maldet
          . $cnftemp
          echo "imported config options from $inspath.last/conf.maldet"
      fi
      $inspath/maldet --update 1
  </code></pre>