質問

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?

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top