seems i cannot fully understand {/,/usr/local/}/etc/rc.d/*

2012-06-20 Thread Wojciech Puchar
i have samba server and few virtualbox sessions using vboxnet which is 
started by /usr/local/etc/rc.d/vboxheadless


i want samba to be started AFTER vboxheadless as the latter configures 
vboxnet0 automatically when started, and samba do bind to vboxnet0.


so i appended vboxheadless to REQUIRE: line in /usr/local/etc/rc.d/samba
because vboxheadless is a word after PROVIDE: in 
/usr/local/etc/rc.d/vboxheadless script


yet - samba still is started before vboxheadless.

what i am missing?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: seems i cannot fully understand {/,/usr/local/}/etc/rc.d/*

2012-06-20 Thread Matthew Seaman
On 20/06/2012 09:24, Wojciech Puchar wrote:
 i have samba server and few virtualbox sessions using vboxnet which is
 started by /usr/local/etc/rc.d/vboxheadless
 
 i want samba to be started AFTER vboxheadless as the latter configures
 vboxnet0 automatically when started, and samba do bind to vboxnet0.
 
 so i appended vboxheadless to REQUIRE: line in /usr/local/etc/rc.d/samba
 because vboxheadless is a word after PROVIDE: in
 /usr/local/etc/rc.d/vboxheadless script
 
 yet - samba still is started before vboxheadless.
 
 what i am missing?

Create a new file in /usr/local/etc/rc.d/precedence with the following
contents:

#!/bin/sh
#
# Persuade vboxheadless to start before samba.

# PROVIDE: precedence
# REQUIRE: vboxheadless
# BEFORE: samba

:

Make it executable.  Note -- the ':' does seem to be necessary.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey





signature.asc
Description: OpenPGP digital signature


Re: seems i cannot fully understand {/,/usr/local/}/etc/rc.d/*

2012-06-20 Thread Wojciech Puchar


Create a new file in /usr/local/etc/rc.d/precedence with the following
contents:

#!/bin/sh
#
# Persuade vboxheadless to start before samba.

# PROVIDE: precedence
# REQUIRE: vboxheadless
# BEFORE: samba

:

Make it executable.  Note -- the ':' does seem to be necessary.

thank you for help. I will test it when being on place and could 
reboot.


But still - do you know why it is necessary?

cannot i just add BEFORE: samba in vboxheadless?


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


Re: seems i cannot fully understand {/,/usr/local/}/etc/rc.d/*

2012-06-20 Thread Matthew Seaman
On 20/06/2012 09:51, Wojciech Puchar wrote:

 Create a new file in /usr/local/etc/rc.d/precedence with the following
 contents:

 #!/bin/sh
 #
 # Persuade vboxheadless to start before samba.

 # PROVIDE: precedence
 # REQUIRE: vboxheadless
 # BEFORE: samba

 :

 Make it executable.  Note -- the ':' does seem to be necessary.

 thank you for help. I will test it when being on place and could reboot.
 
 But still - do you know why it is necessary?
 
 cannot i just add BEFORE: samba in vboxheadless?
 

Yes, that should work too.  However any time you update vboxheadless
you'll have to remember to add that modification back to the rc script.
 Using a separate file stops that being a problem.

If you want to test that your changes are having the desired effect
without having to reboot:

   # rcorder /etc/rc.d/* /usr/local/etc/rc.d/*

which will print out the order all the rc-scripts would be run.  (It
includes all the scripts, not just the ones enabled in /etc/rc.conf, but
that shouldn't matter.)

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey






signature.asc
Description: OpenPGP digital signature


Re: seems i cannot fully understand {/,/usr/local/}/etc/rc.d/*

2012-06-20 Thread Jerry
On Wed, 20 Jun 2012 10:51:04 +0200 (CEST)
Wojciech Puchar articulated:

  Create a new file in /usr/local/etc/rc.d/precedence with the
  following contents:
 
  #!/bin/sh
  #
  # Persuade vboxheadless to start before samba.
 
  # PROVIDE: precedence
  # REQUIRE: vboxheadless
  # BEFORE: samba
 
  :
 
  Make it executable.  Note -- the ':' does seem to be necessary.
 
 thank you for help. I will test it when being on place and could 
 reboot.
 
 But still - do you know why it is necessary?
 
 cannot i just add BEFORE: samba in vboxheadless?

I had a similar problem about two years ago. One program required
program X to load prior to it while program Y wanted to load it
after it. It was causing a conflict. It is slightly difficult to explain
in a few words. I had to manually check every file in
the /usr/local/etc/rc.d directory to straighten it out. I believe that
there is a way to have all of that information displayed without going
through that much intervention; however, I do not remember how to do it
at the moment.

Anyway, in the samba file, it has this notation:

# PROVIDE: nmbd smbd

I don't know if that makes any difference or not. I have never had to
move the starting order of samba around. I do know that in other
applications, they appear to have their name in the PROVIDE line. For
example, from the Postfix script:

# PROVIDE: postfix mail

-- 
Jerry ♔

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the Reply-To header.
__

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


Re: seems i cannot fully understand {/,/usr/local/}/etc/rc.d/*

2012-06-20 Thread Wojciech Puchar

#!/bin/sh
#
# Persuade vboxheadless to start before samba.

# PROVIDE: precedence
# REQUIRE: vboxheadless
# BEFORE: samba

:

Make it executable.  Note -- the ':' does seem to be necessary.


thank you for help. I will test it when being on place and could reboot.

But still - do you know why it is necessary?

cannot i just add BEFORE: samba in vboxheadless?



Yes, that should work too.  However any time you update vboxheadless
you'll have to remember to add that modification back to the rc script.
Using a separate file stops that being a problem.


now i understood completely. thank you
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: seems i cannot fully understand {/,/usr/local/}/etc/rc.d/*

2012-06-20 Thread Robert Bonomi
 From owner-freebsd-questi...@freebsd.org  Wed Jun 20 03:51:43 2012
 Date: Wed, 20 Jun 2012 10:51:04 +0200 (CEST)
 From: Wojciech Puchar woj...@wojtek.tensor.gdynia.pl
 To: Matthew Seaman matt...@freebsd.org
 Cc: freebsd-questions@freebsd.org
 Subject: Re: seems i cannot fully understand {/,/usr/local/}/etc/rc.d/*

 
  Create a new file in /usr/local/etc/rc.d/precedence with the following
  contents:
 
  #!/bin/sh
  #
  # Persuade vboxheadless to start before samba.
 
  # PROVIDE: precedence
  # REQUIRE: vboxheadless
  # BEFORE: samba
 
  :
 
  Make it executable.  Note -- the ':' does seem to be necessary.
 
 thank you for help. I will test it when being on place and could 
 reboot.

 But still - do you know why it is necessary?

An explanation written some 80 years ago; 
  'Because that way it will work'.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: seems i cannot fully understand {/,/usr/local/}/etc/rc.d/*

2012-06-20 Thread RW
On Wed, 20 Jun 2012 09:45:07 +0100
Matthew Seaman wrote:

 #!/bin/sh
 #
 # Persuade vboxheadless to start before samba.
 
 # PROVIDE: precedence
 # REQUIRE: vboxheadless
 # BEFORE: samba
 
 :
 
 Make it executable.  Note -- the ':' does seem to be necessary.

Why? None of the dummy scripts in the base system have a :.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: seems i cannot fully understand {/,/usr/local/}/etc/rc.d/*

2012-06-20 Thread Wojciech Puchar

But still - do you know why it is necessary?


An explanation written some 80 years ago;
 'Because that way it will work'.

if you don't have anything to say - just don't do it.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: seems i cannot fully understand {/,/usr/local/}/etc/rc.d/*

2012-06-20 Thread Jerry
On Wed, 20 Jun 2012 12:47:29 +0100
RW articulated:

 On Wed, 20 Jun 2012 09:45:07 +0100
 Matthew Seaman wrote:
 
  #!/bin/sh
  #
  # Persuade vboxheadless to start before samba.
  
  # PROVIDE: precedence
  # REQUIRE: vboxheadless
  # BEFORE: samba
  
  :
  
  Make it executable.  Note -- the ':' does seem to be necessary.
 
 Why? None of the dummy scripts in the base system have a :.

From man rc

EXAMPLES
 The following is a minimal rc.d/ style script.  Most scripts require lit-
 tle more than the following.

   #!/bin/sh
   #

   # PROVIDE: foo
   # REQUIRE: bar_service_required_to_precede_foo

   . /etc/rc.subr

   name=foo
   rcvar=`set_rcvar`
   command=/usr/local/bin/foo

   load_rc_config $name
   run_rc_command $1

You will notice the prominent use of :. If you feel that is in error,
please feel free to submit a PR against it.

-- 
Jerry ♔

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the Reply-To header.
__

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


Re: seems i cannot fully understand {/,/usr/local/}/etc/rc.d/*

2012-06-20 Thread Damien Fleuriot


On 6/20/12 11:09 AM, Matthew Seaman wrote:
 On 20/06/2012 09:51, Wojciech Puchar wrote:

 Create a new file in /usr/local/etc/rc.d/precedence with the following
 contents:

 #!/bin/sh
 #
 # Persuade vboxheadless to start before samba.

 # PROVIDE: precedence
 # REQUIRE: vboxheadless
 # BEFORE: samba

 :

 Make it executable.  Note -- the ':' does seem to be necessary.

 thank you for help. I will test it when being on place and could reboot.

 But still - do you know why it is necessary?

 cannot i just add BEFORE: samba in vboxheadless?

 
 Yes, that should work too.  However any time you update vboxheadless
 you'll have to remember to add that modification back to the rc script.
  Using a separate file stops that being a problem.
 
 If you want to test that your changes are having the desired effect
 without having to reboot:
 
# rcorder /etc/rc.d/* /usr/local/etc/rc.d/*
 
 which will print out the order all the rc-scripts would be run.  (It
 includes all the scripts, not just the ones enabled in /etc/rc.conf, but
 that shouldn't matter.)
 
   Cheers,
 
   Matthew
 

A very helpful post, adding to favorites.


Might that, possibly, warrant a handbook entry ?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: seems i cannot fully understand {/,/usr/local/}/etc/rc.d/*

2012-06-20 Thread Robert Bonomi

 From: Wojciech Puchar woj...@wojtek.tensor.gdynia.pl

  But still - do you know why it is necessary?
 
  An explanation written some 80 years ago;
   'Because that way it will work'.
 if you don't have anything to say - just don't do it.
practice what you preach.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org