Date: Sun, 30 Aug 2015 11:55:24 +0200 From: Fabian Keil <freebsd-listen@fabiankeil.de> To: zhup <zhup@tutamail.com> Cc: freebsd-questions@freebsd.org Subject: Re: How to make process working in background? Message-ID: <2ac65a7c.445eda7a@fabiankeil.de> In-Reply-To: <1440834990532-6035821.post@n5.nabble.com> References: <1440834990532-6035821.post@n5.nabble.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
zhup <zhup@tutamail.com> 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:
https://www.freebsd.org/cgi/man.cgi?query=daemon
> Why I am not able to stop this process?
>
> root@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.
Fabian
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iEYEARECAAYFAlXi0wkACgkQBYqIVf93VJ2g4wCgsK576RXGmHNrp37znvvYz+sF
OtIAoIbbUe4CrazkQKUmSnoV0IZ7J/rp
=JHPJ
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2ac65a7c.445eda7a>
