incorrect info in mysql docs

Michael Powell nightrecon at
Sun Oct 25 18:57:08 UTC 2009

Chris Whitehouse wrote:

> hi,
> I just noticed this at
> On FreeBSD, startup scripts generally should go in /usr/local/etc/rc.d/.
> The rc(8) manual page states that scripts in this directory are executed
> only if their basename matches the *.sh shell file name pattern. Any
> other files or directories present within the directory are silently
> ignored. In other words, on FreeBSD, you should install the mysql.server
> script as /usr/local/etc/rc.d/ to enable automatic startup.

That was before the import of the rc.subr subsystem from NetBSD. Sounds like 
the docs may be a trifle stale.
> That's not actually right is it? My mysql is started by
> /usr/local/etc/rc.d/mysql-server. rc(8) says *.sh is for older style
> startup scripts or for scripts that are to be read into the current shell.

The rc.subr start up system was imported from NetBSD quite some time ago, I 
think it might have been sometime around the 6.0 to 6.2 time frame. I know 
this bit me because I had mostly not bothered with executing mergemaster 
during updates and at some point only scripts with the .sh extension would 
run. When others told me they did not experience this I got to looking for 
the culprit and it was that I had failed to update the /etc/rc.d properly 
with mergemaster to bring in the newly imported rc.subr subsystem.

Before the rc.subr import from NetBSD the .sh extension was correct; some 
other OS's call these "legacy" start up scripts. After the rc.subr import 
the .sh extension is no longer required for scripts that are written in 
compliance to the new spec. If you examine a very old start up script from 
the pre rc.subr days and what is currently in use you will see a slight 
difference in the way the scripts are constructed internally.

The .sh extension "legacy" scripts may still run if marked as executable, 
but the difference is that they do not contain the rc.subr hooks, and 
therefore will require the .sh extension for operation, as per the man page 
you described above.


More information about the freebsd-questions mailing list