Page 1 of 1

automatically execute a script or commands after boot finished

Posted: 2019/06/19 16:29:11
by ron7000
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 ?

Re: automatically execute a script or commands after boot finished

Posted: 2019/06/19 18:52:51
by esokolowski
/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.