Re: [OpenWrt-Devel] Build ipk and make autostart?

2014-09-14 Thread Ted Hess
The main source of your problem is the first line of your init script starts with: #!/bin/ash instead of #!/bin/sh The OpenWrt build script that process the start/stop items in /etc/init.d is using: grep '#!/bin/sh /etc/rc.common' to determine the need to create the initial rc.d links.

Re: [OpenWrt-Devel] Build ipk and make autostart?

2014-09-13 Thread Gerald Matzka
Am 13.09.2014 um 08:48 schrieb Nguyễn Hồng Quân ng.hong.q...@gmail.com: Hello, When I package an application to ipk file, how do I make the application to automatically start? I already make the init script, which is supposed to install to /etc/init.d/ I tried add these lines to

Re: [OpenWrt-Devel] Build ipk and make autostart?

2014-09-13 Thread Nguyễn Hồng Quân
Hi Gerald Thanks for your quick reply On Sat, Sep 13, 2014 at 2:59 PM, Gerald Matzka mgeral...@yahoo.de wrote: Take a look at http://wiki.openwrt.org/doc/devel/packages - section Package/postinst. Seems you forgot the #!/bin/sh Now I update the Makefile like this (there is no indentation)

Re: [OpenWrt-Devel] Build ipk and make autostart?

2014-09-13 Thread Jiří Šlachta
Hi, there is no need to enable the init script in postinst. The only thing you need to make it start automatically is to give the executable bit to the init script. See below: define Package/package/install $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/package.init

Re: [OpenWrt-Devel] Build ipk and make autostart?

2014-09-13 Thread Nguyễn Hồng Quân
Hi Jiří, My init script (puppysplash) is already executable as shown below root@OpenWrt:~# ls -l /etc/init.d/ -rwxr-xr-x1 root root 1419 Apr 16 17:32 boot -rwxr-xr-x1 root root 729 Sep 13 07:07 cron -rwxr-xr-x1 root root 330 Dec 12 2013

Re: [OpenWrt-Devel] Build ipk and make autostart?

2014-09-13 Thread John Crispin
Hi, imho all replies are superflous. i did fix this in trunk 3 days ago by adding a generic postinst that will cal the enable and start target John On 13/09/2014 10:53, Nguyễn Hồng Quân wrote: Hi Jiří, My init script (puppysplash) is already executable as shown below

Re: [OpenWrt-Devel] Build ipk and make autostart?

2014-09-13 Thread Karl P
Presumably this one: https://dev.openwrt.org/changeset/42470 For the mortals among us, a) does this mean all packages now start as soon as they're installed? It used to be that packages that were selected and _built in_ to an image were listed to start automatically, but packages manually

Re: [OpenWrt-Devel] Build ipk and make autostart?

2014-09-13 Thread Nguyễn Hồng Quân
Hi Ted On Sat, Sep 13, 2014 at 11:16 PM, Ted Hess th...@kitschensync.net wrote: As Jiri said, you don't need a postinst function to enable the script. Your script should start with #!/bin/sh /etc/rc.common and include the line: START=xx Where 'xx' is the startup position number you