Linux Init.d – Symlink, Hard Link, or Actual File?

debinit.dlinuxrpmunix

I have a Debian and an RPM package that requires a start/stop script to be added to the /etc/init.d directory. Recently, I was informed by a remote developer that "those in the know" know that "best practice" is to actually install the start up in the /etc/init.d directory rather than use symlinks, especially when the package could be installing on a different partition. I've always used symlinks. An "ls -la" shows a lot of packages use symlinks.

Is there a Unix/Linux guru out there can give a definitive answer as to what the best practice regarding start up scripts in the /etc/init.d directory. Is best practice symlink, hard link, actual file or does it really matter?

It would be great if you could cite a source. I have google this topic, but I'm unable to find an answer.

Best Answer

The LSB standards ( https://refspecs.linuxbase.org/LSB_2.1.0/LSB-generic/LSB-generic/initsrcinstrm.html ) state that it's acceptable for /etc/init.d scripts to be symbolic links:

An init.d file is installed in /etc/init.d (which may be a symlink 
to another location) . . .

But honestly, I think I've only ever seen 3rd party vendor applications use symbolic links.

Edit: Identical verbiage in the 3.0 specifications ( https://refspecs.linuxfoundation.org/LSB_3.0.0/LSB-generic/LSB-generic/initsrcinstrm.html )

Related Topic