Make sure we explicitly mention that scripts that are used to start
services from /usr/local/etc/rc.d have to be executable and need an extension of .sh to be picked up by /etc/rc at startup & shutdown. Inspired by: A question by Ryan Hill <rhill@xypoint.com> on freebsd-questions.
This commit is contained in:
parent
f61d605eab
commit
c0662a19a4
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=12857
1 changed files with 13 additions and 3 deletions
|
|
@ -379,9 +379,19 @@ esac
|
|||
exit 0
|
||||
</programlisting>
|
||||
|
||||
<para>This script is called with <option>start</option>
|
||||
at startup, and the <option>stop</option> at shutdown to allow
|
||||
it to carry out its purpose.</para>
|
||||
<para>The startup scripts of FreeBSD will look in
|
||||
<filename>/usr/local/etc/rc.d</filename> for scripts that have an
|
||||
<literal>.sh</literal> extension and are executable by root. Those
|
||||
scripts that are found are called with an option <option>start</option>
|
||||
at startup, and <option>stop</option> at shutdown to allow them to carry
|
||||
out their purpose. So if you wanted the above sample script to be
|
||||
picked up and run at the proper time during system startup, you should
|
||||
save it to a file called <filename>FooBar.sh</filename> in
|
||||
<filename>/usr/local/etc/rc.d</filename> and make sure it's
|
||||
executable. You can make a shell script executable with &man.chmod.1;
|
||||
as shown below:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>chmod 755 <replaceable>FooBar.sh</replaceable></userinput></screen>
|
||||
|
||||
<para>Some services expect to be invoked by &man.inetd.8; when a
|
||||
connection is received on a suitable port. This is common for
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue