How can I make a perl script executable everywhere?

I wrote a very simple perl script, and now I want it to be executed everywhere.

I know that I can just paste it into / bin /, rename it from 'mytest.pl' → 'mytest' and chmod + x, but is this standard practice? I did not notice anything in the / bin / perl script.

Also, I want it to be able to write to / var / logs / mytest / *

Are there any security issues I should be aware of?

+4
source share
2 answers

It is preferable to put user scripts in / usr / local / bin, but this is your call, is it worth it to worry about. Regarding logging into / var / logs / mytest / *, you can try to make a script suid (sometimes this is not allowed security) with a user who can write to the directory, or just make / var / logs / mytest accessible to the whole world.

+6
source

Instead of worrying about log file permissions issues, why not log into the syslog? What is it there for. See Sys :: Syslog

+3
source

All Articles