service(8)
๐ service(8) โ the System Manager's Manual glow-up ๐
okay bestie, welcome to service(8), straight out of the System Manager's Manual โจ this is the lil command that runs your System V init scripts, and honestly? she's doing the most with the least. let's get into it ๐ซถ
๐ธ NAME ๐ธ
service โ run a System V init script ๐
โจ SYNOPSIS โจ
service SCRIPT COMMAND [OPTIONS]
service --status-all
service --help | -h | --version
like, that's the whole vibe check. three shapes, pick your fighter ๐
๐ฆ DESCRIPTION ๐ฆ
service runs a System V init script in as predictable an environment as possible โ which lowkey means it yeets most of your environment variables out the window and sets the current working directory to /. no cap. clean slate energy โจ
the SCRIPT parameter specifies a System V init script, and she lives at /etc/init.d/SCRIPT ๐ the supported values of COMMAND depend on whichever script you invoked, because service is a total girlboss delegator โ she passes COMMAND and OPTIONS to the init script unmodified. she does not edit. she does not interpret. she just hands it over ๐
โจ pro tip from the ancestors: all scripts should support at least thestartandstopcommands. that's the bare minimum, babes.
now for the special case ๐ if COMMAND is --full-restart, the script gets run twice โ first with the stop command, then with the start command. it's giving "we're doing this properly" ๐ค
service --status-all runs all the init scripts, in alphabetical order, with the status command. very organized. very demure. very mindful ๐ง
and here's the plot twist ๐ญ if the init script file does not exist, the script tries to use legacy actions. if there's no suitable legacy action found and COMMAND is one of the actions specified in the LSB Core Specification, then input is redirected to systemctl. otherwise? the command fails with return code 2 ๐ so close, yet so far.
๐ FILES ๐
/etc/init.dโ the directory containing System V init scripts. it's the home address of every script you're about to summon ๐ก
๐ ENVIRONMENT ๐
PATH,TERMโ these two are literally the only environment variables passed to the init scripts. that's it. that's the whole guest list. everyone else got left on read ๐
โญ SEE ALSO โญ
chkconfig(8)ntsysv(8)systemd(1)systemctl(8)systemd.service(5)
go read those too, bestie, they're all in the same friend group ๐ซถ
๐ that's the whole page!! this one came from the System Manager's Manual, dated Jan 2006 โ yeah she's been iconic for a minute ๐ thanks for reading, mwah ๐ โจ
๐ฆ where this page comes from
- centos-stream 10: initscripts-service 10.26-2.el10 ยท GPL-2.0-only
- centos-stream 9: initscripts-service 10.11.9-2.el9 ยท GPLv2
- fedora 43: initscripts-service 10.26-4.fc43 ยท GPL-2.0-only
- fedora 43: initscripts-service 10.27-1.fc43 ยท GPL-2.0-only
- fedora 44: initscripts-service 10.27-2.fc44 ยท GPL-2.0-only
- Copyright (C) 2006 Red Hat, Inc. All rights reserved
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms