It seems GlassFish is incompatible with Debian 7 due to an LSB incompliance.
As a result GlassFish is neither starting at host boot, neither the update-rc.d script is able to modify the runlevel settings of the created Service. But manually invoking e. g. /etc/rc2.d/S20GlassFish_domain1 in fact does boot GlassFish correctly when executed manually at the command line!
An identified workaround is to execute the following commands:
- sudo update-rc.d -f GlassFish_domain1 remove
- sudo rm /etc/rcS.d/K20GlassFish_domain1
- sudo update-rc.d GlassFish_domain1 Defaults
This sequence of commands actually fixed the problem very well, but certainly a future GlassFish release should produce rc*.d entries which do not need this Manual fix!
- "-f" is needed at update-rc.d because otherwise the command will not execute. The reason for this is that the rc*.d links produced by asadmin create-service seem to look "strange" in some way to the update-rc.d script. If I understand the output correctly, update-rc.d assumes that rc.local and GlassFish_domain1 scripts build a loop. The "-f" option Forces to ignore any such problems and simply kill all rc*.d links.
- The manual deletion of the file in /etc/rcS.d is needed because even with the "-f" option, update-rc.d is not deleting the link in rcS.d. I suspect this is due to the fact that LSB defaults are K016 but not K016S?
- I have not found out what actually the difference is between the original result of asadmin create-service, and the result of update-rc.d remove followed by update-rc.d default – besides the fact that the latter does not create a link in rcS.d, and sets sequence level 02 instead of 20.
I know that Debian is not officially supported, but as it looks as an LSB incomplicance to me, it would be good to fix this anyways.