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 ?
automatically execute a script or commands after boot finished
-
- Posts: 6
- Joined: 2019/06/19 17:14:21
Re: automatically execute a script or commands after boot finished
/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.
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.