Pregunta

Is it possible to write a System V init script (the scripts usually stored in /etc/init.d and run with service) in Perl, and have the shell recognize the #!/usr/bin/perl? Would there be any downside to doing this?

¿Fue útil?

Solución

The scripts themselves can be written in any language, but support tools may need to parse the script for metadata required to decide when the initscript will start/stop. This restricts the choices to those which can make this metadata available in the form that the tools accept.

Additionally, there may be external files written in shell script which the initscript will require in order to operate properly/efficiently/effectively. Unless these files are very simple, any parser used to read them may grow very complex.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top