rc.stop_packages synxtax error when executed
|Affected version:||2.1||Affected Architecture:|
PHP appears to be choking on the new changed syntax in /etc/rc.stop_packages. It's giving a syntax error when executed, even though php -l says the code contains no syntax errors.
The error is:
Parse error: syntax error, unexpected '=' in - on line 42
However there is no real error there. If you put any code in there, an echo, a global statement, etc, it chokes on it, even if you cut out any other PHP code ahead of it. If you revert the changes made to rc.stop_packages in 0124456b0c4d602adea538cee35fc67c977e9f2e the behavior from #1564 comes back where it will exec fine from the shell but will not reboot from the GUI.
I ran out of time to debug it today -- if someone else has any ideas, have at it. Otherwise I'll poke at it next week.
#2 Updated by Jim P over 3 years ago
Looks like that syntax:
/usr/local/bin/php -q <<ENDPHP ... ENDPHP
Is being interpreted by the shell and all of the $vars are being stripped among other changes. This didn't even work on 2.0.x either, so it's not a recent problem. We'll have to go back to the other syntax (calling with php -f) since to make this work we'd have to shell escape the entire source of the script, which would be ugly and hard to maintain.
#3 Updated by Jim P over 3 years ago
- Status changed from New to Feedback
- % Done changed from 0 to 100
Applied in changeset 60dd7649d02e4a82f9d57953359bf312038f174a.