Hello everybody!
I've been using BARRIER BREAKER (14.07, r42625) on the tp-link mr3020 for some time and I have a question:

I compilled some c sources ( a scheduler ) I've developed, there are 5 programs that talks to each other using shared memory (shmget):

run_task ( takes care of the schedule and parses the commands from the other 4 programs )
add_task ( add a new task )
remove_task ( remove a task )
end_tasks ( remove all tasks )
list_task ( show a list with all added tasks )

They are working as expected when I login via putty and execute them into bash.

Now the problem:

I have this script ( new_task.sh ) on the init.d:

#!/bin/sh /etc/rc.common
# Example script
# Copyright (C) 2007 OpenWrt.org

START=99
STOP=15

start() {
        #echo start
        # commands to launch application
        cd /scheduler/
        ./run_task &
        ./add_task 18:30 front.sh 12:00
}

stop() {
        #echo stop
        # commands to kill application
        killall run_task
}

restart(){
        #echo restart
        #commands to restart the application
        killall run_task
        cd /scheduler/
        ./run_task &
        ./add_task 18:30 front.sh 12:00
}

The symlink is on the rc.d as S99new_task.sh

I've made a test and I know that the daemon ( run_task ) is working good, and that the added task is doing it's job. I can remove/add tasks, and end all the tasks with no problem, however, when I try to see the task list by doing:

./scheduler/list_task

I see nothing and I should see the list on the busybox bash with the added tasks.

If I do:

/etc/init.d/new_task.sh restart

and after do:

./scheduler/list_task

I see the list on the bash and everything works fine. The same is true when I start the program and add tasks manually. It works as expected.

Is this problem related to runlevel?
How can I redirect the output of my daemon ( run_task ) - started by the init process - to the busybox bash?

Thanks!

Ps: I tried the rc.local method to autostart the daemon and the result is the same as with the init.d/rc.d method.

Update: This problem I have seems a lot like when you start a program in one session and then open another session and do a command to the process started in the first session. The output will be on the first session. In my case I think that the output could be going to the serial console ( didn't check this yet ) that's up before the busybox itself, once my daemon is starting at boot time. If that's the case, there's a way to change the output to the busybox session instead the serial console?

(Last edited by evilmonkey on 5 Apr 2016, 00:16)