Reload systemd and a service you swore was hand-configured turns out to be a wrapper: systemd-sysv-generator just imported it from /etc/init.d/. This guide shows you how to find that script, read the generated unit it produced, and check the ordering and boot targets it was given. Allow about 10 minutes.
You need a shell account that can read the service files; reach for sudo only where a step needs privileged access.
/etc/init.d/ and builds temporary .service wrappers when the system manager starts or reloads. The wrapper just calls the original script./usr/lib/systemd/system-generators/systemd-sysv-generator
Do not run that path to start or stop a service. Use systemctl for service operations and let systemd invoke its generators in the background.
List the script named by the service you are investigating. Replace the placeholder with a real service name; this is a read-only command and does not need elevated privileges.
SERVICE_NAME=example-daemon
ls -l "/etc/init.d/$SERVICE_NAME"
sed -n '1,100p' "/etc/init.d/$SERVICE_NAME"
Look for an LSB header between ### BEGIN INIT INFO and ### END INIT INFO. Fields such as Required-Start, Required-Stop, Should-Start, Default-Start and Default-Stop describe ordering and runlevel intent. A script without useful headers can still be wrapped, but systemd has less to go on when ordering it.
Checkpoint: you should have a real file below /etc/init.d/. If it is missing, you are probably looking at a native unit, or a service name from a different package entirely.
Use the service name with a .service suffix. Neither command changes service state:
systemctl status "$SERVICE_NAME.service" --no-pager
systemctl cat "$SERVICE_NAME.service"
systemctl cat commonly shows a comment saying the unit was automatically generated, a SourcePath=/etc/init.d/... line, and something like ExecStart=/etc/init.d/example-daemon start. The exact Type, timeout and stop command depend on the script and its headers./etc/init.d/; a script anywhere else is not its problem.Ask systemd to show the unit's effective ordering and relationships:
systemctl show "$SERVICE_NAME.service" \
-p FragmentPath -p SourcePath -p Type -p Before -p After \
-p WantedBy --no-pager
Generated units live under /run/systemd/, which is runtime state, not a file you should ever edit directly. The SourcePath points back to the SysV script. If you need to change behaviour, change the package configuration or replace the script with a native unit; edits to the generated file are lost on the next reload or boot.
$remote_fs, $network, $named, $portmap and $time are recognised and become dependencies on native systemd targets. The generated unit is also ordered after basic.target, because systemd does not support SysV scripts as part of early boot.runlevel2.target and runlevel5.target. The wrapper is wanted by the targets that match the runlevels the original script was enabled for, which is why a script can exist on disk but never start during a normal boot.Generators run when the system manager reloads, so after a package changes an init script, tell systemd to catch up. This is an administrative operation and may need elevated privileges:
sudo systemctl daemon-reload
systemctl cat "$SERVICE_NAME.service"
The second command is your verification step. Compare SourcePath, the ExecStart and ExecStop lines, and the ordering from systemctl show. A reload does not, by itself, start, stop or restart the service.
systemctl stop, disable and mask all change availability or boot behaviour. If you have made a reversible change, restore it with the matching systemctl enable or systemctl unmask command once you have confirmed the unit name.Safety boundary: when replacing a script, record its current start order, stop order, environment and dependencies first. Write a native unit with explicit After=, Wants= or Requires= relationships, test it in a maintenance window, and only remove the old script once you have a verified rollback path.
/etc/init.d/.systemctl cat, including its source path.systemctl show./run/systemd/.