Are there ways to run rc.d scripts in the background?

Hello, I've written an rc.d script that simply runs the portsnap program. However, the problem (as I've forseen it) is that I have to wait until the script finishes before handing control over to the user -- which is ridiculous considering that downloading a 60MB or so file may take minutes depending on the speed of your Internet connection. I was wondering if there are any ways to run this (or other scripts) in the background. Any ideas? Dirty hacks and workarounds accepted ;)
 
When I add the & operator, it says that it shouldn't be run interactively and recommends running portsnap cron instead. However, running portsnap at boot really wasn't the point of the exercise -- what I'm really trying to do is run lengthy processes at boot from rc.d without having to wait for them to resolve to be able to use the console.
 
wafflesausage said:
When I add the & operator, it says that it shouldn't be run interactively and recommends running portsnap cron instead. However, running portsnap at boot really wasn't the point of the exercise -- what I'm really trying to do is run lengthy processes at boot from rc.d without having to wait for them to resolve to be able to use the console.

Like phoenix told you portsnap(8)() already does what you want via a cron(1)() job.

For further help in rc.d scripting there is a lot of available information in FreeBSD docs:

Link: http://www.freebsd.org/doc/en/articles/rc-scripting/

Best Regards,
 
Back
Top