Runs scripts in /etc/init.d
Part of SystemV, in /etc/rc.d/
, based on the distro you have folders or files defining each runlevel
rc
for "run commands" defines what is run at each runlevelsystemd
is a suite of basic building blocks for service management.
/usr/lib/systemd
holds configurationsUsed on Ubuntu by default
Used on macOS
is an init scheme for unix-like operating systems.
init
process.service
files, in /usr/lib/systemd/system/
have unit types:
simple
does not block on start process, becoming "active" immediately after forking off the first processoneshot
blocks on start operation until the first process exits. The status is reported as "activating"forking
, process configured with ExecStart=
will call fork()
as part of its startup. PIDFile=
is used so that systemd can identify the main process of the daemonEnvironment=
specifies variables accessible by Exec
commandsExecStart=
specifies exactly one command with arguments that is run when the service is startedBasic service:
[Unit]
Description=Foo
[Service]
ExecStart=/usr/sbin/foo-daemon