Runnig a sudo command on startup

hello, I need help with a simple task.

In order to run a program I must, every time I turn on my pc, run this command:

sudo /etc/rc.d/init.d/sesinetd start

It is a sudo command, so it asks me for my password.

Is there any way to make this happen when I turn on my machine so I can just run my program normally?

You seem to have a service. On Rocky 8 and 9 services are handled by systemd.
You should create a unit file that does the same operations as the ‘sesinetd’ and then enable that service.

First of all, including sudo in a rc file is a non-sense. All scripts in rc* are executed by root, no need to say it.

And if you don’t know how to create a service file which is kind of hard, just put the command in the /etc/rc.d/rc.local file, give it a 755 mode if it is not and enable the rc.local by:

systemctl enable rc-local