Re: not adding daemons to rc.conf

2006-09-04 Thread Chris Whitehouse

Jona Joachim wrote:

Jonathan Horne wrote:
ive noticed that apache can be started manually using the apachectl tool, even 
if it is not enabled in /etc/rc.conf.  do many other daemons have this 
ability?  i have a dev server that i would like to not have many things 
enabled in the rc.conf, but i would like an easy way to just start specific 
daemons when i need.


Take a look at /usr/local/etc/rc.d
You will see several scripts belonging to server applications you
installed. Each one of these scripts can start or stop the service.
For example:
/usr/local/etc/rc.d/apache.sh start
/usr/local/etc/rc.d/apache.sh stop

When you put something into rc.conf it is actually this script that is
executed, so every daemon that can be enabled in rc.conf can also be
started/stopped using those scripts.


But the scripts check rc.conf so they still have to be enabled in 
rc.conf unless you use forcestart...


box# grep pf_enable /etc/rc.conf
box# pwd
/etc/rc.d
box# ./pf start
box# echo pf_enable=\YES\  /etc/rc.conf
box# grep pf_enable /etc/rc.conf
pf_enable=YES
box# ./pf start
Enabling pf.
No ALTQ support in kernel
ALTQ related functions disabled
No ALTQ support in kernel
ALTQ related functions disabled
box#

Chris

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: not adding daemons to rc.conf

2006-08-31 Thread Karol Kwiatkowski
On 31/08/2006 05:25, Daniel Bye wrote:
 On Wed, Aug 30, 2006 at 08:47:06PM -0500, Jonathan Horne wrote:
 ive noticed that apache can be started manually using the apachectl tool, 
 even if it is not enabled in /etc/rc.conf.  do many other daemons have this 
 ability?  i have a dev server that i would like to not have many things 
 enabled in the rc.conf, but i would like an easy way to just start specific 
 daemons when i need.
 
 There is the force modifier which may be of help/interest.  It works
 like this:
 
  # /usr/local/etc/rc.d/script forcestart
 
 This will, well, force the script to run, even if it's not explicitly
 enabled in /etc/rc.conf.

It does more, it will force the script to run even if a daemon is
running. What OP is looking for is 'one' prefix:

# /usr/local/etc/rc.d/script onestart
# /usr/local/etc/rc.d/script onestop

After rc.subr(8) manpage:

--
run_rc_command argument
[...]
force  Skip the checks for rcvar being set to ``YES'', and
   sets rc_force=YES.  This ignores argument_precmd
   returning non-zero, and ignores any of the required_*
   tests failing, and always returns a zero exit status.

oneSkip the checks for rcvar being set to ``YES'', but
   performs all the other prerequisite tests.
--

HTH,

Karol

-- 
Karol Kwiatkowski  freebsd at orchid dot homeunix dot org
OpenPGP: http://www.orchid.homeunix.org/carlos/gpg/0x06E09309.asc



signature.asc
Description: OpenPGP digital signature


Re: not adding daemons to rc.conf

2006-08-31 Thread Daniel Bye
On Thu, Aug 31, 2006 at 02:43:20PM +0200, Karol Kwiatkowski wrote:
 It does more, it will force the script to run even if a daemon is
 running. What OP is looking for is 'one' prefix:

Ah!  Even better.  Thanks for the tip.

Dan

-- 
Daniel Bye

PGP Key: http://www.slightlystrange.org/pgpkey-dan.asc
PGP Key fingerprint: D349 B109 0EB8 2554 4D75  B79A 8B17 F97C 1622 166A
 _
  ASCII ribbon campaign ( )
 - against HTML, vCards and  X
- proprietary attachments in e-mail / \


pgpMyuwrpFpbk.pgp
Description: PGP signature


Re: not adding daemons to rc.conf

2006-08-31 Thread Tofik Suleymanov

Jonathan Horne wrote:
ive noticed that apache can be started manually using the apachectl tool, even 
if it is not enabled in /etc/rc.conf.  do many other daemons have this 
ability?  i have a dev server that i would like to not have many things 
enabled in the rc.conf, but i would like an easy way to just start specific 
daemons when i need.


thanks,
jonathan
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]

  

You can always use:
/usr/local/etc/rc.d/scriptname forcestart
or
/etc/rc.d/scriptname forcestart

But this just overrides enable keyword in rc scripts and of course 
will not start your service in the next boot.


Sincerely,
Tofig Suleymanov
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: not adding daemons to rc.conf

2006-08-30 Thread Jona Joachim
Jonathan Horne wrote:
 ive noticed that apache can be started manually using the apachectl tool, 
 even 
 if it is not enabled in /etc/rc.conf.  do many other daemons have this 
 ability?  i have a dev server that i would like to not have many things 
 enabled in the rc.conf, but i would like an easy way to just start specific 
 daemons when i need.

Take a look at /usr/local/etc/rc.d
You will see several scripts belonging to server applications you
installed. Each one of these scripts can start or stop the service.
For example:
/usr/local/etc/rc.d/apache.sh start
/usr/local/etc/rc.d/apache.sh stop

When you put something into rc.conf it is actually this script that is
executed, so every daemon that can be enabled in rc.conf can also be
started/stopped using those scripts.

Daemons coming with the base system have there scripts in the /etc/rc.d
directory.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: not adding daemons to rc.conf

2006-08-30 Thread Darrin Chandler
On Wed, Aug 30, 2006 at 08:47:06PM -0500, Jonathan Horne wrote:
 ive noticed that apache can be started manually using the apachectl tool, 
 even 
 if it is not enabled in /etc/rc.conf.  do many other daemons have this 
 ability?  i have a dev server that i would like to not have many things 
 enabled in the rc.conf, but i would like an easy way to just start specific 
 daemons when i need.

Why, yes. There's nothing magical about the rc mechanisms, and you are
free to start daemons on your own. Be warned that there may be side
effects with some daemons, being that they are not started the same way
regarding login class or whatnot. But normally this won't be a problem.

-- 
Darrin Chandler|  Phoenix BSD Users Group
[EMAIL PROTECTED]   |  http://bsd.phoenix.az.us/
http://www.stilyagin.com/  |
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: not adding daemons to rc.conf

2006-08-30 Thread Robert Huff

Darrin Chandler writes:

  On Wed, Aug 30, 2006 at 08:47:06PM -0500, Jonathan Horne wrote:
   ive noticed that apache can be started manually using the
   apachectl tool, even if it is not enabled in /etc/rc.conf.  do
   many other daemons have this ability?  i have a dev server
   that i would like to not have many things enabled in the
   rc.conf, but i would like an easy way to just start specific
   daemons when i need. 
  
  Why, yes. There's nothing magical about the rc mechanisms, and
  you are free to start daemons on your own. Be warned that there
  may be side effects with some daemons, being that they are not
  started the same way regarding login class or whatnot. But
  normally this won't be a problem.

The cool thing about using a properly designed script is it will
be aware of all the things which need to be started first and try to
start them is they aren't already running.
For a hard-core development server maybe this doesn't matter
... but the closer one gets to a production environment, the more
useful it tends to become.


Robert Huff
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: not adding daemons to rc.conf

2006-08-30 Thread Daniel Bye
On Wed, Aug 30, 2006 at 08:47:06PM -0500, Jonathan Horne wrote:
 ive noticed that apache can be started manually using the apachectl tool, 
 even if it is not enabled in /etc/rc.conf.  do many other daemons have this 
 ability?  i have a dev server that i would like to not have many things 
 enabled in the rc.conf, but i would like an easy way to just start specific 
 daemons when i need.

There is the force modifier which may be of help/interest.  It works
like this:

 # /usr/local/etc/rc.d/script forcestart

This will, well, force the script to run, even if it's not explicitly
enabled in /etc/rc.conf.

Close to what you want?

-- 
Daniel Bye

PGP Key: http://www.slightlystrange.org/pgpkey-dan.asc
PGP Key fingerprint: D349 B109 0EB8 2554 4D75  B79A 8B17 F97C 1622 166A
 _
  ASCII ribbon campaign ( )
 - against HTML, vCards and  X
- proprietary attachments in e-mail / \


pgpmKV4wqx9KX.pgp
Description: PGP signature