Can same level runlevel scripts have the same priority? For instance, can say runlevel x have these 2 scripts: S10ScriptName1 and S10ScriptName2 ? If so, what is the execution order?
It depends on the exact implementation your distro is using (and sometimes the configuration), but one of:
- Alphabetical, by some definition of alphabetical, likely the LC_ALL=C one. This is basically the easy way to implement it, and a common one. It's why the numbers are 0-prefixed, to make sure that a plain old sort puts them in the right order.
- In parallel. This is what
-Mdid, back in the days of Debian Lenny.
- The numbers don't control, order is determined by LSB headers declaring dependencies: what
startpar -Mdoes. Or what other init systems' (e.g., systemd) SysV compatibility layers do.
You would need to check the documentation for your system or the code (which under SysV init was often shell scripts, so relatively easy to check; you can find where it is by reading