The following error is displayed when running the systemctl to start/stop/restart/status the processd:
Failed to stop processd.service: Unit processd.service not loaded
DX NetOps Spectrum: Any version
Missing /etc/systemd/system/processd.service file
Create the /etc/systemd/system/processd.service file (as root).
# vi /etc/systemd/system/processd.service (update the $SPECROOT path):
[Unit]
SourcePath=/usr/Spectrum/lib/SDPM/processd_init.sh
Description=LSB: SPECTRUM Processd Daemon
Before=runlevel3.target
Before=runlevel5.target
Before=shutdown.target
After=network-online.target
Wants=network-online.target
Conflicts=shutdown.target
[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/bin/bash /usr/Spectrum/lib/SDPM/processd_init.sh start
ExecStop=/bin/bash /usr/Spectrum/lib/SDPM/processd_init.sh stop
[Install]
WantedBy=multi-user.target
Grant this file permission:
chmod 664 /etc/systemd/system/processd.service
# ls -la /etc/systemd/system/processd*
-rw-rw-r--. 1 root root 542 Nov 26 13:58 /etc/systemd/system/processd.service
And then run: systemctl daemon-reload
The automatic startup of the /etc/systemd/system/processd.service file (the Spectrum Process Daemon) is managed by systemd, which is the modern system and service manager for most Linux distributions.
The process of automatic startup at boot time involves two main components within the systemd framework: the Service Unit File and the Target Unit.
processd.service)The file /etc/systemd/system/processd.service is a systemd unit file that defines and controls the daemon. It contains sections like:
[Unit] Section: This defines metadata and dependencies.
Description: A human-readable description of the service.
After: Crucially, this directive specifies that processd.service should only start after other required services or system states have been reached (e.g., networking is up). A common configuration for a service like this would include:
[Unit]
SourcePath=/opt/Spectrum/lib/SDPM/processd_init.sh
Description=LSB: SPECTRUM Processd Daemon
Before=runlevel3.target
Before=runlevel5.target
Before=shutdown.target
After=network-online.target
Wants=network-online.target
Conflicts=shutdown.target
This ensures the service waits for the network and a basic multi-user environment to be ready.
[Service] Section: This defines how the service itself runs.
ExecStart: The command that systemd executes to start the Spectrum Process Daemon.
Type: The startup type (e.g., forking, simple, notify). For a traditional daemon that forks a child process and the parent exits, it's often set to Type=forking.
Restart: Defines if and when systemd should automatically restart the process if it terminates.
[Install] Section: This is the most critical part for automatic startup.
WantedBy: This directive specifies which Target Unit should activate this service.1 For services that should run in a typical server environment, this is usually set to multi-user.target:
[Install]
WantedBy=multi-user.target
multi-user.target)Target units (files ending in .target) are used by systemd to group related services and act as synchronization points, similar to runlevels in older SysVinit systems.
When the administrator enables the service using the command:
sudo systemctl enable processd.service
systemd does the following:
It reads the [Install] section of /etc/systemd/system/processd.service.
Since the file specifies WantedBy=multi-user.target, systemd creates a symbolic link in a special directory associated with that target.
The link is typically created as: /etc/systemd/system/multi-user.target.wants/processd.service $\rightarrow$ /etc/systemd/system/processd.service
When your Linux system boots up, the sequence is:
The kernel loads and starts systemd as the very first process (PID 1).
Systemd's job is to bring the system to its configured default state, which is usually defined by a default target (often multi-user.target or graphical.target).
Systemd reads the multi-user.target unit and all the units it wants to start. It sees the symbolic link for processd.service in the multi-user.target.wants directory.
It checks the dependencies specified in the [Unit] section of processd.service (like After=network.target).
Once all dependencies are met, systemd executes the ExecStart command defined in the [Service] section of processd.service, thereby starting the Spectrum Process Daemon.
In summary, the service starts automatically because the systemctl enable command created a symbolic link that tells the main multi-user.target system state to activate the processd.service during the boot process.