⬆️ ⬇️

Installing Firebird on D-Link DNS-325

I had a “budget” idea to use the existing D-Link DNS-325 NAS as a backup DBMS (as a temporary solution in case of failure). Organization of a small + continuous production + lack of a specialist on duty, but this is only for entry.



Solving this issue, I spent a lot of time searching for the necessary information, which prompted me to write this publication.



Since the Linux device is on board with this device, the task looked quite solvable. From the box, the device is controlled via a web interface and has rather limited capabilities; the list of applications available for installation is not impressive .



1. I wondered about connecting via telnet or SSH and further installing software



This helped me to publish from my favorite Habr - "The wheelbarrow for pumping - we set up and expand the capabilities of D-Link DNS-325 ". According to the instructions in it, we managed to configure access via SSH, as well as configure additional repositories (Optware) for software installation. Unfortunately, the Optware firebird repositories could not be found.

')

2. Attempts to install Firebird



Since The device uses an ARM processor with the ARMV5TEL architecture, at that time there was no architecture support for Firebird 2.5. I still decided to try the installation directly on the device from the source from here: Firebird 2.5 . Recommended Autogen.sh refused to install with a message about the unknown architecture. Only the configuration stage “configure” was able to go hand-to-hand, after which the “make” dumped errors, according to which (+ search) it was clear that one could not do without editing the source code.



There remained 2 solutions: cross-compiling for the required architecture or using existing compiled packages for the specified architecture that were found in the debian repositories. I looked for information on both solutions, and in my opinion, installing debian using the debootstrap tool seemed easier . Another advantage of this solution is the ability to access the debian repository, in which there is much more software than Optware.



3. Installing debian wheezy using the debootstrap tool



Since debootstrap itself is also absent in the Optware repositories, I will prepare the debian system image on ubuntu installed on the virtual machine.



Install debootstrap (with insufficient privileges, don't forget about sudo):



apt-get install debootstrap -y apt-get clean 


Create an image and pack it into the archive:



 debootstrap --foreign --arch armel wheeze debian "http://ftp.ru.debian.org/debian" tar -czf debian.tar.gz debian 


Next, the resulting archive debian.tar.gz must be copied to the NAS in any way, as an option through shared folders. Next we connect to the NAS via SSH, for example, using PUTTY and perform the following.



Unpack the archive, mount the device files from the current NAS system, deploy the system:



 tar -xf debian.tar.gz mount -o bind /dev ./debian/dev mount -o bind /proc ./debian/proc grep -v rootfs /proc/mounts > ./debian/etc/mtab chroot ./debian/ /bin/bash /debootstrap/debootstrap --second-stage exit 


Copy network settings from current NAS system:



 cp /etc/hosts ./debian/etc/hosts cp /etc/resolv.conf ./debian/etc/resolv.conf hostname > ./debian/etc/hostname 


You now have a real Debian system on disk, chroot into it:



 mount -o bind /dev ./public/debian/dev mount -o bind /proc ./debian/proc grep -v rootfs /proc/mounts > ./debian/etc/mtab chroot ./debian/ /bin/bash 


Update the repository and installed software:



 wget http://files.satware.com/synology/chroot/sources.list -O /etc/apt/sources.list apt-get update -y apt-get upgrade -y apt-get dist-upgrade -y 


4. Install Firebird:



 apt-get install Firebird2.5-superclassic -y dpkg-reconfigure firebird2.5-superclassic 


Customize:



Enable Firebird server? => Yes

Password for sysdba? => your_password



Exit debian to the main system:



 exit 


It remains to create a script to start / stop the Firebird server. Download the script:



 wget http://files.satware.com/synology/ipkg/S80firebird.sh 


We fix the paths to the debian folder, I have "/ mnt / HD / HD_a2 / home / debian", the current directory can be viewed with the pwd command:



 vi S80firebird.sh 


Copy the file to the startup folder of the scripts, set the rights to run:



 mkdir -p /opt/etc/init.d mv S80firebird.sh /opt/etc/init.d/ chmod +x /opt/etc/init.d/S80firebird.sh 


To start / stop the Firebird server, respectively:



 /opt/etc/init.d/S80firebird.sh start /opt/etc/init.d/S80firebird.sh stop 


All is ready! After rebooting, our Firebird server will be launched on our NAS on the default port - 3050, you can connect.



Related Links



Pimping wheelbarrow - set up and expand the capabilities of the D-Link DNS-325

Firebird SQL auf Synology Diskstation installieren

Installing Debian GNU / Linux from a Unix / Linux system

Source: https://habr.com/ru/post/304008/



All Articles