How to make process working in background?

Fabian Keil freebsd-listen at
Sun Aug 30 09:56:48 UTC 2015

zhup <zhup at> wrote:

> I have below startup script.
> My question is how to make this process working in background?
> #!/bin/sh
> . /etc/rc.subr
> name=test
> rcvar=test_enable
> command="/usr/sbin/${name}"
> load_rc_config $name
> run_rc_command "$1"

If the program itself has no flag to go into the background
you can use daemon(8) for this:

> Why I am not able to stop this process?
> root at mys:~ # /etc/rc.d/test stop
> Stopping test.
> Waiting for PIDS: 5146 5147Stopping oscam.
> Waiting for PIDS: 5146 5147

Did you verify that the PIDs are correct?
Specifying a pidfile may help.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the freebsd-questions mailing list