GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SERVICE(8) FreeBSD System Manager's Manual SERVICE(8)

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

service [
-j jail
] -e

service [
-j jail
] -R

service [
-j jail
] [
-v
] -l

service [
-j jail
] [
-v
] -r

service [
-j jail
] [
-v
] script command

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 ENVIRONMENT). It can also be used to list the scripts using various criteria.
The options are as follows:
List services that are enabled. The list of scripts to check is compiled 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.
jail
Perform the given actions under the named jail. The jail argument can be either a jail ID or a jail name.
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.
Generate the rcorder(8) as in -e above, but list all of the files, not just what is enabled.
Restart all enabled local services.
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 -j dns 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 
	cur=${COMP_WORDS[COMP_CWORD]} 
	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 utility first appeared in FreeBSD 7.3.

This manual page was written by Douglas Barton <dougb@FreeBSD.org>.
May 31, 2018 FreeBSD 12.0-RELEASE

Search for    or go to Top of page |  Section 8 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.