# Why use the 'onestart' command as opposed to just 'start'?



## johnblue (Dec 12, 2009)

I was messing around by breaking stuff in 8.0 just to see what the error message would be.  So I renamed the /etc/pf.conf file and removed pf_enable="YES" from rc.conf and then tried to start pf with: './pf start' from /etc/rc.d.

The error message said:





> Cannot 'start' pf.  Set pf_enable to YES in /etc.rc.conf or use 'onestart' instead of 'start'.


This is the first time I've seen the command 'onestart'.  So I googled for the onestart and found several sites that talked about issuing it, but none that talked about why you would want to use it.

What makes it different?


----------



## graudeejs (Dec 12, 2009)

To start service one time, without modifying /etc/rc.conf


----------



## aragon (Dec 12, 2009)

The RC scripts are called with "start" as an argument at boot time, and when called as such the service is only started if it is enabled in /etc/rc.conf.

When called with "onestart", the script ignores the enabled state in /etc/rc.conf.


----------



## johnblue (Dec 12, 2009)

Cool.  That makes sense.  I removed pf_enable=yes and the rc default is "no" so onestart would fire it up.

Thanks guys.

:e


----------



## graudeejs (Dec 12, 2009)

Yes, but next time you reboot, pf will not start automatically


----------

