Service doesn't start at boot

Latest response

I created a service named fldcd, put the fldcd.service file in /usr/lib/systemd/system, executed systemctl enable fldcd.service, but in /etc/systemd/system there is no the link to the .service file.

I put the executable and the libraries in /usr/bin/fldc. Added this path in the file /etc/ld.so.conf.d/fldcd.conf.

This is the .service file:
**
[Unit]
Description=XXXXXXXXX
After=syslog.target network.target mariadb.target
Requires=mariadb.service

[Service]
Type=forking
ExecStart=/usr/bin/fldc/fldcd
Restart=always
**
I can start and stop the service but at boot it doesn't start.

If I remove the after and requires directive, the behavior is the same.

Could you help me? Thank you.

Responses

At first look it sounds that the service is not enabled to start on boot, please check. You could use 'systemctl is-enabled' command for respective service as similar to shown below:

#systemctl is-enabled sshd.service

If service is not enabled then enable it by running 'systemctl enable servicename'. This would create a symbolic link for the service in the respective target, I mean if the system is running in text mode then a link would get created in "/etc/systemd/system/multi-user.target.wants" directory.

Thanks Sadashiva for your quick and qualified answer. I restarted the setup from scratch and Indeed the service is enabled but the symlink is created in /etc/systemd/system and the service doesn't start at boot. Then I copied the symlink in /etc/systemd/system/multi-user.target.wants and on boot the service is loaded. I'm wondering why the symlink is not created by default in /etc/systemd/system/multi-user.target.wants, maybe did I miss some directive in the unit file? Thank again.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.