Support for init.d startup scripts

I’m new to this forum. So please let me know if I posted in a wrong forum.

I’m using my startup script with /etc/init.d in CentOS and it worked fine.
With Rocky Linux I do not see “/etc/init.d” folder but I see “/etc/rc.d/init.d”. When I added my startup script in “/etc/rc.d/init.d” I did not see the startup script being triggered when the OS restarted.
I see the OS recommends using systemd, but also does not removed support for init.d
I would like to know if I need to do anything additional to use the startup with init.d script.
I’m using Rocky Linux 9.2

Let me know if anything is not clear or any details are needed from my side.


Rocky 9 doesn’t use init scripts because it is using systemd. I don’t believe Rocky 8 used it either. There may have been legacy support to allow init scripts in EL7 or EL8 but I cannot say for sure since EL7 was also the start of systemd in EL distros (RHEL6 was init script based). You should be looking at converting them to systemd service scripts and putting them under /etc/systemd/system and then using systemctl to enable/disable as well as start/stop/restart.

The /etc/rc.d/init.d I believe comes from the initscripts-service package being installed. Irrespective of the directories existing, you should still be using systemd scripts instead. There is no reason to use the old initd method.

Hi Jvisu, maybe you can consider using /etc/rc.d/rc.local. This file as stated in the comment line, "THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES"and “Please note that you must run ‘chmod +x /etc/rc.d/rc.local’ to ensure that this script will be executed during boot.” When I was moving from Centos to Rocky8, I still using this file to run some startup scripts and switched to systemd now. Hope this can help.

1 Like

Thanks a lot for the quick response.

Will work at our end to migrate to systemd or use init-scripts.

The request can be closed.

Thanks again.

1 Like


The “initscripts” package is still available in Rocky 9, as it is in Rocky 8 and CentOS 7.

However, as the other folks say, systemd has been the standard for managing services since CentOS 7, so do your best to convert those legacy apps, unless you really need init.d.


1 Like

I never got systemd to run scripts on startup and had resort to crontab.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.