You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

104 lines
3.0 KiB

  1. .\" A man page for service(8). -*- nroff -*-
  2. .\"
  3. .\" Copyright (C) 2006 Red Hat, Inc. All rights reserved.
  4. .\"
  5. .\" This copyrighted material is made available to anyone wishing to use,
  6. .\" modify, copy, or redistribute it subject to the terms and conditions of the
  7. .\" GNU General Public License v.2.
  8. .\"
  9. .\" This program is distributed in the hope that it will be useful, but WITHOUT
  10. .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. .\" more details.
  13. .\"
  14. .\" You should have received a copy of the GNU General Public License along
  15. .\" with this program; if not, write to the Free Software Foundation, Inc.,
  16. .\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. .\"
  18. .\" Author: Miloslav Trmac <mitr@redhat.com>
  19. .\" Updated by: Petter Reinholdtsen <pere@hungry.com>
  20. .TH service 8 "Jan 2006"
  21. .SH NAME
  22. service \- run a System V init script
  23. .SH SYNOPSIS
  24. \fBservice\fR \fISCRIPT\fR \fICOMMAND\fR [\fIOPTIONS\fR]
  25. \fBservice \-\-status\-all\fR
  26. \fBservice\fR \fB\-\-help\fR | \fB\-h\fR | \fB\-\-version\fR
  27. .SH DESCRIPTION
  28. .B service
  29. runs a System V init script or systemd unit in as predictable an
  30. environment as possible, removing most environment variables and with the
  31. current working directory set to \fB/\fR.
  32. The
  33. .I SCRIPT
  34. parameter specifies a System V init script,
  35. located in \fB/etc/init.d/\fISCRIPT\fR, or the name of a systemd unit.
  36. The existence of a systemd unit of the same name as a script in /etc/init.d
  37. will cause the unit to take precedence over the init.d script.
  38. The supported values of
  39. .I COMMAND
  40. depend on the invoked script.
  41. .B service
  42. passes
  43. .I COMMAND
  44. and
  45. .I OPTIONS
  46. to the init script unmodified. For systemd units, start, stop,
  47. status, and reload are passed through to their systemctl/initctl
  48. equivalents.
  49. All scripts should support at least the
  50. .B start
  51. and
  52. .B stop
  53. commands.
  54. As a special case, if
  55. .I COMMAND
  56. is \fB\-\-full-restart\fR, the script is run twice, first with the
  57. .B stop
  58. command, then with the
  59. .B start
  60. command.
  61. .B service \-\-status\-all
  62. runs all init scripts, in alphabetical order, with the
  63. .B status
  64. command. The status is [ + ] for running services, [ - ] for stopped
  65. services and [ ? ] for services without a 'status' command. This
  66. option only calls status for sysvinit jobs.
  67. .SH EXIT CODES
  68. .BR service
  69. calls the init script and returns the status returned by it.
  70. .SH FILES
  71. .TP
  72. \fB/etc/init.d\fR
  73. The directory containing System V init scripts.
  74. .TP
  75. \fB/{lib,run,etc}/systemd/system\fR
  76. The directories containing systemd units.
  77. .SH ENVIRONMENT
  78. .TP
  79. \fBLANG\fR, \fBLANGUAGE\fR, \fBLC_CTYPE\fR, \fBLC_NUMERIC\fR, \fBLC_TIME\fR, \fBLC_COLLATE\fR, \fBLC_MONETARY\fR, \fBLC_MESSAGES\fR, \fBLC_PAPER\fR, \fBLC_NAME\fR, \fBLC_ADDRESS\fR, \fBLC_TELEPHONE\fR, \fBLC_MEASUREMENT\fR, \fBLC_IDENTIFICATION\fR, \fBLC_ALL\fR, \fBTERM\fR, \fBPATH\fR
  80. The only environment variables passed to the init scripts.
  81. .SH SEE ALSO
  82. .IR /etc/init.d/skeleton ,
  83. .br
  84. .BR update\-rc.d (8),
  85. .br
  86. .BR init (8),
  87. .br
  88. .BR invoke\-rc.d (8).
  89. .br
  90. .BR systemctl (1).