ZoneMinder / zoneminder

ZoneMinder is a free, open source Closed-circuit television software application developed for Linux which supports IP, USB and Analog cameras.
http://www.zoneminder.com/
GNU General Public License v2.0
5.13k stars 1.23k forks source link

Install difficulty, Linux Mint 18.3: "Insecure directory in $ENV{PATH}" #2169

Closed dirtbirb closed 6 years ago

dirtbirb commented 6 years ago

Forgive me if I'm missing anything important, I'm definitely a noob in this stuff!

I'm trying to follow the directions here, on Linux Mint 18.3, but on "service zoneminder start" (step 7), I get the following:

"Job for zoneminder.service failed because the control process exited with error code. See "systemctl status zoneminder.service" and "journalctl -xe" for details."

The systemctl command gives the following (emphasis mine):

● zoneminder.service - ZoneMinder CCTV recording and surveillance system Loaded: loaded (/lib/systemd/system/zoneminder.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2018-07-25 16:17:17 CDT; 8s ago Process: 23773 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=2)

Jul 25 16:17:17 carme systemd[1]: Starting ZoneMinder CCTV recording and surveillance system... Jul 25 16:17:17 carme zmpkg.pl[23773]: Insecure directory in $ENV{PATH} while running with -T switch at /usr/share/perl5/ZoneMinder/Memory.pm line 138. Jul 25 16:17:17 carme zmpkg.pl[23773]: Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 37. Jul 25 16:17:17 carme zmpkg.pl[23773]: BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder.pm line 37. Jul 25 16:17:17 carme zmpkg.pl[23773]: Compilation failed in require at /usr/bin/zmpkg.pl line 48. Jul 25 16:17:17 carme zmpkg.pl[23773]: BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 48. Jul 25 16:17:17 carme systemd[1]: zoneminder.service: Control process exited, code=exited status=2 Jul 25 16:17:17 carme systemd[1]: Failed to start ZoneMinder CCTV recording and surveillance system. Jul 25 16:17:17 carme systemd[1]: zoneminder.service: Unit entered failed state. Jul 25 16:17:17 carme systemd[1]: zoneminder.service: Failed with result 'exit-code'.

(Edit: This paragraph has been undone, see first comment) I took a look at zmpkg.pl, and tried replacing the architecture detection chunk with $arch = 64; Whether that's correct or not, it let things continue, and found more "insecure directories" in other files. After I was done "fixing" all of them (probably breaking them in the process), it still fails, but the systemctl output has no information:

● zoneminder.service - ZoneMinder CCTV recording and surveillance system Loaded: loaded (/lib/systemd/system/zoneminder.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2018-07-25 16:04:01 CDT; 1s ago Process: 1523 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=1/FAILURE)

Jul 25 16:04:01 carme systemd[1]: Starting ZoneMinder CCTV recording and surveillance system... Jul 25 16:04:01 carme zmpkg[1523]: INF [Sanity checking States table...] Jul 25 16:04:01 carme zmpkg[1523]: INF [Command: start] Jul 25 16:04:01 carme systemd[1]: zoneminder.service: Control process exited, code=exited status=1 Jul 25 16:04:01 carme systemd[1]: Failed to start ZoneMinder CCTV recording and surveillance system. Jul 25 16:04:01 carme systemd[1]: zoneminder.service: Unit entered failed state. Jul 25 16:04:01 carme systemd[1]: zoneminder.service: Failed with result 'exit-code'.

I'm guessing that my "fixes" just broke stuff, but I was hoping to at least get some info from it. What's the right way to fix this? As a side note, I notice that the guide I'm following mentions php5 but the guide ends up installing php7, if that's an issue.

Thank you!

dirtbirb commented 6 years ago

Update:

I learned about taint checking, undid my previous edits, and just removed "T" from the #! line at the top of /usr/bin/zmdc.pl and /usr/bin/zmpkg.pl. Now the service starts just fine.

I'm leaving the issue open because this seems like a workaround that someone would be upset about, but feel free to close it if it's uninteresting!

connortechnology commented 6 years ago

Can you look into something for me? do

ls -l /bin

and

ls -l /bin/uname

dirtbirb commented 6 years ago

Done: https://pastebin.com/BD3VxyQx

dirtbirb commented 6 years ago

Update: syslog reported that other .pl scripts (zmwatch, zmaudit, etc) were also exiting abnormally, so I went through /usr/bin and removed the T from the #! line at the top of all zm****.pl files. The messages went away.

Basically taint checking is somehow broken on my system, dunno what the proper response is.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.