On Tue, May 16, 2023 at 10:54:05AM +0530, Susmita/Rajib wrote: > Please once more check the two links that I had posted on the OP. If I > want to run a script named script.sh how should I set my system up, > like what should the supporting files look like, based on the OP?
Without knowing what this "script.sh" does, and how your system is configured (which init system, etc.) it's impossible to answer this question. There are too many possible answers. Is it network-related? Then maybe it should be run when an interface is brought up. Or maybe not! Maybe you should write a systemd unit file for it. Or maybe your system isn't running systemd at all. In that case, do you write a legacy init.d script? Or write a run script for some other init system? Or do you just drop a few lines of shell code in rc.local? Is it an end user application? Then it probably belongs in a user's login configuration. Unless it's a GRAPHICAL end user application, in which case it probably belongs in a GUI session's configuration. Or maybe it's a daemon that's supposed to support an end user's overall session, in which case maybe a systemd --user unit file is appropriate. Again, unless your system doesn't run systemd, in which case an entirely different approach is needed. And so on.