Welcome! Log In Create A New Profile

Advanced

How to start a custom service on the NAS 325 v2

Posted by d-t 
d-t
How to start a custom service on the NAS 325 v2
January 13, 2019 10:00AM
Hello
I have the Zyxel NSA325 v2 NAS storage with the original firmware version: V4.81(AALS.1)

Now I want to run syncthing application on it. The syncthing is not originally supported by the packages available, but it works without problems on my NAS when unpacked and started manually.

What I need is to start the syncthing automatically when the NAS boots up. I have created 'SYNCTHING' init script (attached), but I am not able to plug it into the boot sequence. First, I have copied it into '/etc/init.d', but it disappeared from there every new boot. Then I installed it into '/usr/local/zy-pkgs/etc/init.d/', when it remains, but it still is not started (manual start by calling '/usr/local/zy-pkgs/etc/init.d/syncthing start' works, though).

Don't you know, what I am missing? Is there something, which must be carried out to convince the init system to call the startup script?

Thank you very much.
Attachments:
open | download - SYNCTHING (2.4 KB)
Re: How to start a custom service on the NAS 325 v2
January 14, 2019 02:33AM
D-t,

Sorry I can’t help you with stock FW. You might want to try NASCentral forum.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
d-t
Re: How to start a custom service on the NAS 325 v2
January 25, 2019 05:17PM
Hello,
I have finally able to manage it.

The trick is:
  • paste the init script into /usr/local/zy-pkgs/etc/init.d/
  • start is trigered by startup argument, stop by shutdown argument

The source of information was in http://zyxel.nas-central.org/wiki/Boot_process_(300_series). There is /ram_bin/etc/init.d/rcS2 script (trigered as the last action in /etc/init.d/rcS) and in turn that starts /etc/init.d/zypkg_controller.sh. There, the /usr/local/zy-pkgs/etc/init.d is searched and additional scripts are started with "startup" argument.

The working init script is in the attachment.

Regards,
R.
Attachments:
open | download - SYNCTHING (2.1 KB)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: