title: Run script at boot after MySQL started
body: <p>I want to start Seafile (cloud-server which needs MySQL) at the boot of my Raspberry Pi. My Problem is, that the Seafile starts befor mysql and caused many errors, because seafile needs mysql.
  I took the recommended script:</p>
  
  <pre><code>#! /bin/sh
  # /etc/init.d/seafile
  
  ### BEGIN INIT INFO
  # Provides:          seafile
  # Required-Start:    $local_fs $remote_fs $network mysql
  # Required-Stop:     $local_fs
  # Default-Start:     2 3 4 5
  # Default-Stop:      0 1 6
  # Short-Description: Script to start/stop/restart seafile
  # Description:       Simple script to start, stop or restart seafile for the cloud
  ### END INIT INFO
  
  # Change the value of "user" to your linux user name
  user=chromo
  
  # Change the value of "script_path" to your path of seafile installation
  seafile_dir=/home/chromo/cloud
  script_path=${seafile_dir}/seafile-server-latest
  seafile_init_log=${seafile_dir}/logs/seafile.init.log
  seahub_init_log=${seafile_dir}/logs/seahub.init.log
  
  # Change the value of fastcgi to true if fastcgi is to be used
  fastcgi=true
  # Set the port of fastcgi, default is 8000. Change it if you need different.
  fastcgi_port=8000
  
  case "$1" in
      start)
              sudo -u ${user} ${script_path}/seafile.sh start &gt;&gt; ${seafile_init_log}
  if [  $fastcgi = true ];
              then
                      sudo -u ${user} ${script_path}/seahub.sh start-fastcgi ${fastcgi_port} &gt;&gt; ${seahub_init_log}
              else
                      sudo -u ${user} ${script_path}/seahub.sh start &gt;&gt; ${seahub_init_log}
              fi
      ;;
      restart)
              sudo -u ${user} ${script_path}/seafile.sh restart &gt;&gt; ${seafile_init_log}
              if [  $fastcgi = true ];
              then
                      sudo -u ${user} ${script_path}/seahub.sh restart-fastcgi ${fastcgi_port} &gt;&gt; ${seahub_init_log}
              else
                      sudo -u ${user} ${script_path}/seahub.sh restart &gt;&gt; ${seahub_init_log}
              fi
      ;;
  stop)
              sudo -u ${user} ${script_path}/seafile.sh $1 &gt;&gt; ${seafile_init_log}
              sudo -u ${user} ${script_path}/seahub.sh $1 &gt;&gt; ${seahub_init_log}
      ;;
      *)
              echo "Usage: /etc/init.d/seafile {start|stop|restart}"
              exit 1
      ;;
  esac
  </code></pre>
  
  <p>Can someone help me?</p>