⬆️ ⬇️

Running Terminal Server for 1C Applications on Synology NAS





More recently, DS412 + NAS from Synology has come into our hands. If you believe the words from the manufacturer's website, it is designed for small and medium businesses that require high performance, ease of management and a full-featured network storage solution for centralizing data backup, protecting critical information and sharing files between different platforms . Our customer was interested in using it not only as a drive (for storing the 1C database), but also as a terminal server for working with the 1C platform. Under the cut, you will find the DS412 + adaptation process itself.



Let's start with a brief description of the characteristics of the device, complete you can find here :



We were lucky that the Atom CPU stands at 412m and its architecture allowed us to use pre-compliled 1C packages for the i386 platform, although on the same DS213j there is already MARVELL Armada 370, which, unfortunately, there are no ready-made solutions. To build the packages, we used a virtual machine running on a working PC. So let's get started.



1. Install the minimum distribution of Debian on a virtual machine;

2. Install on this system debootstrap (from the repository);

')

apt-get install debootstrap 


3. Prepare debootstrap to run on another system. Since DS412 + under i686, we specify the architecture. Put it in the ~ / deboo folder:



 debootstrap --foreign --arch i386 wheezy deboo 


Copy our repositories to the prepared image:



 cp /etc/apt/sources.list ~/deboo/etc/apt/sources.list 


And we pack it in a tarball-file so that it is more convenient to transfer:



 tar xvzpf synodebian.tar.gz 


4. After DiskStation initialization, we turn on the ftp-server, add the share folder via the web interface.











We transfer the tarball-file with the system (debootstrap) prepared in the third stage to this folder;

5. In order not to build on a weak DS later, we immediately collect XRDP packets on a virtual machine:



 apt-get install git git clone https://github.com/scarygliders/X11RDP-o-Matic.git cd X11RDP-o-Matic ./X11rdp-o-matic.sh –justdoit 


It will take a long time to collect, at the end we pick up ready-made packages from ./X11RDP-o-Matic/packages, put it in the same share share folder on the DS. There we also copy the service script from ./X11RDP-o-Matic/RDPsesconfig.sh. The virtual machine is no longer needed, it can be turned off.

6. Connect to DS via SSH. The system mounts the section in the folder "/ volume1", go to it, to the subfolder share (which is shared by ftp). Extract the created tarball file to / volume1 / deboo;

7. Transfer the DNS settings and server name:



 hostname > /volume1/deboo/etc/hostname cp /etc/resolv.conf /volume1/deboo/etc/ 


8. Unpack all the packages:



 chroot /volume1/deboo /debootstrap/debootstrap --second-stage 


9. Making scripts for mounting / unmounting system folders, allowing them to run:



 ~/deboo-mount.sh: /bin/mount -o bind /dev /volume1/deboo/dev /bin/mount -o bind /proc /volume1/deboo/proc /bin/mount -o bind /dev/pts /volume1/deboo/dev/pts /bin/mount -o bind /sys /volume1/deboo/sys /bin/mount -o bind /mnt/share /volume1/deboo/share ~/deboo-umount.sh: /bin/umount /volume1/deboo/proc /bin/umount /volume1/deboo/dev/pts /bin/umount /volume1/deboo/dev /bin/umount /volume1/deboo/sys /bin/umount /volume1/deboo/share 


10. We mount system folders, and we launch already full-fledged debian:



 sh ~/deboo-mount chroot /volume1/deboo /bin/bash 


11. Everything, now began full-fledged work with debian in bash. We prepare work with repositories and update packages:



 apt-get update && apt-get upgrade 


12. Install probably the easiest graphical shell (the Xs are also installed when dependencies are resolved):



 apt-get install --no-install-recommends lxde 


13. Install the XRDP packages collected in the fifth step:



 cd /volume1/share/packages dpkg -i *.deb && apt-get install -f 


14. Add users to the system that will connect to the terminal server, run the RDPsesconfig.sh script, obtained in step 5, which will generate the necessary configuration files for them;

15. Start the XRDP:



 /etc/init.d/xrdp start 


Now you can connect to the terminal server.

16. Download from here client and server packages for DEB-based systems. Unpack them into one folder and install:



 dpkg -i *.deb && apt-get -f install 


17. For the platform, additional font packages and imagemagick are needed, put them:



 apt-get install ttf-mscorefonts-installer imagemagick 




It is done! Stayed routine. In the same shared folder we place the file base 1C (already unpacked demo version of Trade Management). We connect via RDP to the server under our user, the shell is launched, we add a shortcut to launch Enterprise 1C on the desktop, we launch it. 1C invites you to add a base. We add existing, we specify in a shared folder in which the base was placed. Connect in enterprise mode, select user.



And a few more words in the end, despite the fact that we still managed to start the terminal server, we consider using this configuration to solve the task inappropriate, due to the high cost and difficulty in preparing the software component.

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



All Articles