Buffalo NAS-Central Forums

Welcome to the Linkstation Wiki community
It is currently Tue Nov 21, 2017 4:29 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sun Mar 08, 2015 1:18 pm 
Offline
Total Newbie

Joined: Sun Mar 08, 2015 1:08 pm
Posts: 1
Hello,

this is my first post and first i want to thank anyone who did scripts and stuff, to get things run on the Linkstation.
Recently i obtained root access on my linkstation and installed IPKG (thanks for the bootstrap scripts, very easy).

Now i tried out the syncthing binaries (work like charm, thanks to the developers).
Source and binaries here: https://github.com/syncthing/syncthing/ ... g/v0.10.25

Since there is no IPKG feed, i manually detared it and put it in /mnt/array1/.optware/bin.

I can perfectly start it via SSH from every folder.

Now i want it to include in the autostart but was a litte confused by this thread:
viewtopic.php?f=39&t=2999&hilit=add+binary+to+autostart
Via SSH is cannot find exec_sh and i am not shure, whether i can simply add a newline "syncthing" to /etc/init.d/rcS.

May anyone answer this question?

Thanks in advance, jevaboy


Top
   
PostPosted: Mon Apr 06, 2015 5:02 am 
Offline
Newbie

Joined: Mon Oct 12, 2009 5:41 pm
Posts: 12
jevaboy wrote:
Now i want it to include in the autostart but was a litte confused by this thread:
viewtopic.php?f=39&t=2999&hilit=add+binary+to+autostart
Via SSH is cannot find exec_sh and i am not shure, whether i can simply add a newline "syncthing" to /etc/init.d/rcS.


Yes, you can do this. The simplest would be to add to the list of scripts on one of the lines starting "for cmd in ...". However you want to be sure that your command doesn't prevent or delay other commands. So my preference is to add a line at the very end of rcS just before the "exit 0" line, and probably with an ampersand (&) at the end to run it in background.

A more traditional alternative is to create a new script in /etc/init.d/rc3.d/. The stock firmware looks for files or symlinks in /etc/init.d/ and runs them with a "start" parameter. For example, you could create the file /etc/init.d/rc3.d/S99syncthing containing the following:

Code:
#!/bin/sh
/mnt/array1/.optware/bin/syncthing &


A more standard approach is to create the file in /etc/init.d/, named "syncthing.sh", and then create a symlink in /etc/init.d/rc3.d/ like this:

Code:
# ln -s ../syncthing.sh /etc/init.d/rc3.d/S99syncthing

Another option (not tested by me) is to add a line to /etc/daemonwatch.list. This seems to have a list of processes to run, and to restart if they die. More info here: http://buffalo.nas-central.org/wiki/Open_Stock_Firmware#Daemonwatch.._Adding_sshd.

Hmm. Syncthing looks very interesting. I'll have to look into it.

Note: exec_sh is a function that is defined in some of the startup scripts, and is not available from the command line. Essentially, all it does is run a script with a "start" parameter. Here's the definition of exec_sh() from rc3.sh:

Code:
exec_sh()
{
        echo "=====  exec:$1  ====="
        ./$1 start
}


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited