automatically execute a script or commands after boot finished

General support questions
Post Reply
ron7000
Posts: 162
Joined: 2019/01/15 20:00:28

automatically execute a script or commands after boot finished

Post by ron7000 » 2019/06/19 16:29:11

I am coming from SUSE, and they had a mechanism where if the file /etc/init.d/after.local existed then anything within it was executed after the boot process fully completed. It was convenient because I could do for example "nvidia-smi -pm 1" to set persistence enabled, I had to do this as root because the "persistence" doesn't persist across reboots. And you could do a bunch of other useful things, I would start flexlm license managers.

What is the way to do something like this in RHEL/CentOS 7.6 ?

esokolowski
Posts: 6
Joined: 2019/06/19 17:14:21

Re: automatically execute a script or commands after boot finished

Post by esokolowski » 2019/06/19 18:52:51

/etc/rc.local. add your command.

Then chmod 755 /etc/rc.local. Should work.

Another option is to create a custom systemd service that does what you need to do. Tons of info on the web on creating a custom service.

Post Reply