service man page on FreeBSD

Man page or keyword search:  
man Server   9747 pages
apropos Keyword Search (all sections)
Output format
FreeBSD logo
[printable version]

SERVICE(8)		  BSD System Manager's Manual		    SERVICE(8)

     service — control (start/stop/etc.) or list system services

     service -e
     service [-v] -l | -r
     service [-v] <rc.d script> start|stop|etc.

     The service command is an easy interface to the rc.d system.  Its primary
     purpose is to start and stop services provided by the rc.d scripts.  When
     used for this purpose it will set the same restricted environment that is
     in use at boot time (see below).  It can also be used to list the scripts
     using various criteria.

     The options are as follows:

     -e	 List services that are enabled.  The list of scripts to check is com‐
	 piled using rcorder(8) the same way that it is done in rc(8), then
	 that list of scripts is checked for an "rcvar" assignment.  If
	 present the script is checked to see if it is enabled.

     -l	 List all files in /etc/rc.d and the local startup directories.	 As
	 described in rc.conf(5) this is usually /usr/local/etc/rc.d.  All
	 files will be listed whether they are an actual rc.d script or not.

     -r	 Generate the rcorder(8) as in -e above, but list all of the files,
	 not just what is enabled.

     -v	 Be slightly more verbose

     When used to run rc.d scripts the service command sets HOME to / and PATH
     to /sbin:/bin:/usr/sbin:/usr/bin which is how they are set in /etc/rc at
     boot time.

     The service utility exits 0 on success, and >0 if an error occurs.

     The following are examples of typical usage of the service command:

	   service named status
	   service -rv

     The following programmable completion entry can be use in bash(1) for the
     names of the rc.d scripts:
	   _service () {
		local cur
		COMPREPLY=( $( compgen -W '$( service -l )' -- $cur ) )
		return 0
	   complete -F _service service

     bash(1) (ports/shells/bash), rc.conf(5), rc(8), rcorder(8)

     The service manual page service first appeared in FreeBSD 7.3.

     This manual page was written by Douglas Barton <>.

BSD			       December 26, 2009			   BSD

List of man pages available for FreeBSD

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
Vote for polarhome
Free Shell Accounts :: the biggest list on the net