Autostart Debian services ?

282 views
Skip to first unread message

Lx Timoniks

unread,
Jan 10, 2017, 3:46:18 PM1/10/17
to Alt-F
My device DNS 320L.....
How can I run Debian services at startup, using the script (User - user - Config)?
Now I go to the device for ssh and and executes commands 
////
[root@Cloud]# debian -chroot
root@Cloud:/# service mldonkey-server start (or /etc/init.d/mldonkey-server start)
Starting MLDonkey: mlnet.
////
And the service is launched...

How to do it through a script  (User - user - Config) ?



 

João Cardoso

unread,
Jan 11, 2017, 4:12:20 PM1/11/17
to Alt-F
the 'debian' script accepts an optional command as an argument:

[root@dns-323]# debian
usage: debian [-chroot [command] | -kexec]

so   try  (untested)

debian -chroot "service mldonkey-server start"

The user script must be saved in a filesystem that is discovered after or at the same time that the debian installation filesystem is discovered, i.e., if debian is installed in sdb3, the user script shouldn't be saved in any sdaxx ot sdb3 filesystem. Filesystem discovering is done in ascending order.






 

Konrád Lőrinczi

unread,
Jan 11, 2017, 4:30:32 PM1/11/17
to al...@googlegroups.com
I installed Debian 7 Wheezy successfully to DNS-320 A1. Then upgraded to Debian 8 Jessie successfully. 
Using ALT-F RC4 version. 

So based on your example might be possible to install Bittorrent Sync (which is not available for ALT-F as package), then execute it as Debian chroot service, which is started, after ALT-F booting? 


Thanks, 
Konrad Lorinczi 



--
You received this message because you are subscribed to the Google Groups "Alt-F" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/alt-f.
For more options, visit https://groups.google.com/d/optout.

Lx Timoniks

unread,
Jan 12, 2017, 1:15:02 AM1/12/17
to al...@googlegroups.com

[root@Cloud]# debian -chroot "service mldonkey-server start"
Starting MLDonkey: mlnet.

The system says that the service is started, but the web gui does not work.
If you execute commands separately, everything works =)

The feeling that the service starts but then stops immediately.


четверг, 12 января 2017 г., 0:12:20 UTC+3 пользователь João Cardoso написал:

Konrád Lőrinczi

unread,
Jan 12, 2017, 6:37:47 AM1/12/17
to Alt-F
Successfully installed Bittorrent Sync (Resilio Sync) into the chrooted Debian 8.
Also I was able to start the Resilio Sync service successfully.

The web-gui was accessible using:
http://mynasip:8888


Also tried to access the chrooted Debian through a separate ssh session.
So I modified the sshd config file in chrooted Debian, so I can access through port 222.
Started ssh service, and I was able to connect the chrooted Debian through mynasip:222

So it seems everything works well.


Now the next step would be to start chrooted Debian at ALT-F boot.

I created a script:
/root/debianstart.sh


The question is the content of it.

Something like this would work?
/root/debianstart.sh:
# ------------------------------
debian -chroot &
debian -chroot service resilio-sync start
debian -chroot service ssh start


Thanks,
Konrad

kKimmell

unread,
Jan 12, 2017, 8:30:25 AM1/12/17
to Alt-F


On Tuesday, January 10, 2017 at 3:46:18 PM UTC-5, Lx Timoniks wrote:
How to do it through a script  (User - user - Config) ?



Not to hijack but... is there any document at all on the use of debian?

João Cardoso

unread,
Jan 12, 2017, 11:26:45 AM1/12/17
to Alt-F


On Thursday, 12 January 2017 11:37:47 UTC, Konrád Lőrinczi wrote:
Successfully installed Bittorrent Sync (Resilio Sync) into the chrooted Debian 8.
Also I was able to start the Resilio Sync service successfully.

The web-gui was accessible using:
http://mynasip:8888


Also tried to access the chrooted Debian through a separate ssh session.
So I modified the sshd config file in chrooted Debian, so I can access through port 222.
Started ssh service, and I was able to connect the chrooted Debian through mynasip:222

So it seems everything works well.


Now the next step would be to start chrooted Debian at ALT-F boot.

I created a script:
/root/debianstart.sh

That should be in the user boot script, not under /root, as it is (should be!!!) volatile upon a reboot



The question is the content of it.

Something like this would work?
/root/debianstart.sh:
# ------------------------------
debian -chroot &

As you don't know when it will be available (fsck...), you can't rely on putting in the background. Instead test its return status.
Something like:

while ! debian; do echo "waiting for debian"; sleep 10; done # untested
... your debian related code

Of course if it never shows up, the loop will never stops, so you might want to add a countdown.

João Cardoso

unread,
Jan 12, 2017, 11:31:47 AM1/12/17
to Alt-F
No, Alt-F installs Debian, customize it a bit and provides the 'debian' command. But anyone can write one and put it in the wiki ;-)
The debian message of the day  says, when you login: "You leaved Alt-F, you are now on your own"
 

Konrád Lőrinczi

unread,
Jan 12, 2017, 1:55:55 PM1/12/17
to Alt-F
Created a WIKI for the task: Bittorrent Sync (Resilio Sync) install into chrooted Debian
https://sourceforge.net/p/alt-f/wiki/Bittorrent%20Sync%20-%20Resilio%20Sync%20install%20Debian%20instructions/
This seems to work, even after rebooting.

I did not test your solution, yet, so did not include into the WIKI at the moment:

while ! debian; do echo "waiting for debian"; sleep 10; done # untested
... your debian related code


Let me know if it works, for others, too.


Best regards,
Konrad Lorinczi
To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+un...@googlegroups.com.

Lx Timoniks

unread,
Jan 12, 2017, 2:08:30 PM1/12/17
to Alt-F
Many thanks!

Problem solved! 

debian -chroot &
debian -chroot service mldonkey-server start 


четверг, 12 января 2017 г., 14:37:47 UTC+3 пользователь Konrád Lőrinczi написал:
To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+un...@googlegroups.com.

Lx Timoniks

unread,
Jan 17, 2017, 11:42:54 AM1/17/17
to Alt-F
Service not start automatically - after 5-7 reboots :(

четверг, 12 января 2017 г., 22:08:30 UTC+3 пользователь Lx Timoniks написал:
Reply all
Reply to author
Forward
0 new messages