Главная > IMHO / Компьютеры > QNAP - автозапуск

QNAP - автозапуск


19 сентября 2014 23:02. Разместил: Altyn

Ссылка на скрипт автозапуска.
http://wiki.qnap.com/wiki/Running_Your_Own_Application_at_Startup

 

QPKG-based method (new)

This method consists of declaring a dummy QPKG which launches your script at startup.

  • Log into your QNAP device using SSH or Telnet, for instance by using Putty
  • Edit QPKG config file:

# vi /etc/config/qpkg.conf

  • Declare a new dummy package by adding something like that in this file:

[autorun]
	Name = autorunVersion = 0.1
	Author = neomilium
	Date = 2013-05-06
	Shell = /share/MD0_DATA/.qpkg/autorun/autorun.sh
	Install_Path = /share/MD0_DATA/.qpkg/autorun
	Enable = TRUE

 

As you can see, Shell is the interesting variable: at boot-time, QNAP OS will launch each QPKG's Shell variable content.

Note: if your NAS doesn't have /share/MD0_DATA (i.e. is a one-drive NAS), put the right directory into the Shell and Install_Path variables and adapt the following commands to your needs.

  • Create the dummy package directory:

# mkdir /share/MD0_DATA/.qpkg/autorun

  • Create the autorun script with the contents of your choice:

# vi /share/MD0_DATA/.qpkg/autorun/autorun.sh


Note: don't forget "#!/bin/sh" at the beginning of script.
  • Set the execute bit:

# chmod +x /share/MD0_DATA/.qpkg/autorun/autorun.sh

 

 

Так же можно научить MC отображать русские буквы в каталогах

 

  • Добавить в скрипт автозапуска

# /bin/echo TERM='xterm' >> /root/.profile
	# /bin/echo TERMINFO='/opt/share/terminfo' >> /root/.profile

 

  • Добавление в прошивку соответсвующих gconv модулей. Устанавливаем из optware

# ipkg install gconv-modules

 

  • Заменяем в скрипте автозапуска родные из прошивки на модули optware

# /bin/mv /usr/lib/gconv /usr/lib/gconv.bak
	# /bin/ln -sf /opt/lib/gconv /usr/lib


Reboot and enjoy!

Вернуться назад