-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syslog 3.1 has a hardcoded path for sh which causes issues running other scripts #151
Comments
exec_background is a Cacti function |
Thanks @cigamit I will re-test with exec_background but I am sure the hardcoded shell path should be removed |
Ah actually I noticed this in syslog_process.php the only files included are include(dirname(FILE) . '/../../include/cli_check.php'); I dont see poller.php being included which I would think would be required for that function to work |
Have you tried putting the python command (with full path) in front of the command? |
yes it also fails until you removed the path to sh |
cli_check.php includes global.php, which then includes the lib/poller.php. Otherwise you would be getting an error in your cacti log about it, and Cacti would be disabling the plugin. |
ah ok makes sense |
OK I just tried again with background_exec($command) that breaks it |
ya, we may have a to make a change to pass "-c" tell /bin/sh that its a command as /bin/sh can execute python just fine like so
Your other option for now is to wrap the python script in a shell executor
|
So try changing it to |
That whole section does need to be changed though, as
|
trying now |
No go I did run that command using /bin/sh -c command manually as the apache user and it did execute the script |
|
Likely cause your Debian system is running 'dash' as it's default shell. |
This is a rhel system
Default shell is bash though
…On Tue., Mar. 9, 2021, 18:30 TheWitness, ***@***.***> wrote:
Likely cause your Debian system is running 'dash' as it's default shell.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#151 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADGEXTCQTTPJ52KFP22GBK3TC2OQVANCNFSM4Y2E44OA>
.
|
Yea, makes no sense, pushing a workaround. |
Should be fixed now. Close if so. |
Hey Everyone,
I ran into an issue with syslog 3.1 where it would execute a shell script but would not execute a python script
the Log would repport the script was executed without error but the script was not actually run
I even created a simple hello world script to log to a file same deal
I came across the below block of code and I notice that exec_background has a hardcoded path to /bin/sh
I removed that path still no go I changed
To
And that resolved my issue
See the original block
Is there a reason to have the exec_background vs exec ?
I will send a pull request but just want to understand the original design
Thanks !
The text was updated successfully, but these errors were encountered: