How to make process working in background?

Hello,

I have below startup script.
My question is how to make this process working in background?

Code:
#!/bin/sh
. /etc/rc.subr
name=test
rcvar=test_enable
command="/usr/sbin/${name}"
load_rc_config $name
run_rc_command "$1"
Why I am not able to stop this process?

Code:
root@mys:~ # /etc/rc.d/test stop
Stopping test.
Waiting for PIDS: 5146 5147
Waiting for PIDS: 5146 5147
Thank you in advance.
 
I found solution for the process working in background:
Code:
command_args="--daemon"
How to stop the process?
Code:
root@mys:~ # /etc/rc.d/test stop
Stopping test.
Waiting for PIDS: 5146 5147
Waiting for PIDS: 5146 5147
 
Back
Top