Munin custom plugin Permission Denied - plugins

My tomcat application writes some value in a file under /usr/share/tomcat6/webapps/myApp/munin/. Permissions on this file are default (tomcat:tomcat ownership) 644. I wrote a very simple munin plugin to read those value, and it stands in /usr/share/munin/plugins/. Permissions there are (root:root) 755, like the other plugins. I also made a symlink in /etc/munin/plugins/.
If I use munin-run myApp_lookuptime, I get proper output for values, config and --debug.
However, if I telnet, it gives me "Bad exit".
munin-node.log says:
2013/05/03-14:35:08 [30657] Error output from myApp_lookuptime:
2013/05/03-14:35:08 [30657] /etc/munin/plugins/myApp_lookuptime: line 15: /usr/share/tomcat6/webapps/myApp/munin/myApp.LookupTime.log: Permission denied
2013/05/03-14:35:08 [30657] Service 'myApp_lookuptime' exited with status 1/0.
In /etc/munin/plugin-conf.d/munin-node, I wrote:
[myApp*]
user root
group root
But it still fails. From any dummy account on this server, I'm able to read that log, but still munin fails with "Permission Denied" error. What am I doing wrong?

Well, it was simple really. SELinux was blocking my plugins. So, either turn it off if your server is not public or learn to make rules if the server is public.
Here is a guide for CentOS: http://www.centos.org/docs/5/html/5.2/Deployment_Guide/sec-sel-enable-disable.html
After that, I rebooted, and my plugins worked like a charm.
Thank you, me.

Setting env.PATH variable for your plugin in /etc/munin/plugin-conf.d/munin-node so it can find all executables did the trick for me.
See
http://munin-monitoring.org/wiki/faq#Q:Whydoesapluginworkwithmunin-runbutnotinmunin-node

Related

Why does BitBake error if it can't find www.example.com?

BitBake fails for me because it can't find https://www.example.com.
My computer is an x86-64 running native Xubuntu 18.04. Network connection is via DSL. I'm using the latest versions of the OpenEmbedded/Yocto toolchain.
This is the response I get when I run BitBake:
$ bitbake -k core-image-sato
WARNING: Host distribution "ubuntu-18.04" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
ERROR: OE-core's config sanity checker detected a potential misconfiguration.
Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
Following is the list of potential problems / advisories:
Fetcher failure for URL: 'https://www.example.com/'. URL https://www.example.com/ doesn't work.
Please ensure your host's network is configured correctly,
or set BB_NO_NETWORK = "1" to disable network access if
all required sources are on local disk.
Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
The networking issue, the reason why I can't access www.example.com, is a question for the SuperUser forum. My question here is, why does BitBake rely on the existence of www.example.com? What is it about that website that is so vital to BitBake's operation? Why does BitBake post an Error if it cannot find https://www.example.com?
At this time, I don't wish to set BB_NO_NETWORK = "1". I would rather understand and resolve the root cause of the problem first.
Modifying poky.conf didn't work for me (and from what I read, modifying anything under Poky is a no-no for a long term solution).
Modifying /conf/local.conf was the only solution that worked for me. Simply add one of the two options:
#check connectivity using google
CONNECTIVITY_CHECK_URIS = "https://www.google.com/"
#skip connectivity checks
CONNECTIVITY_CHECK_URIS = ""
This solution was originally found here.
For me, this appears to be a problem with my ISP (CenturyLink) not correctly resolving www.example.com. If I try to navigate to https://www.example.com in the browser address bar I just get taken to the ISP's "this is not a valid address" page.
Technically speaking, this isn't supposed to happen, but for whatever reason it does. I was able to work around this temporarily by modifying the CONNECTIVITY_CHECK_URIS in poky/meta-poky/conf/distro/poky.conf to something that actually resolves:
# The CONNECTIVITY_CHECK_URI's are used to test whether we can succesfully
# fetch from the network (and warn you if not). To disable the test set
# the variable to be empty.
# Git example url: git://git.yoctoproject.org/yocto-firewall-test;protocol=git;rev=master
CONNECTIVITY_CHECK_URIS ?= "https://www.google.com/"
See this commit for more insight and discussion on the addition of the www.example.com check. Not sure what the best long-term fix is, but the change above allowed me to build successfully.
If you want to resolve this issue without modifying poky.conf or local.conf or any of the files for that matter, just do:
$touch conf/sanity.conf
It is clearly written in meta/conf/sanity.conf that:
Expert users can confirm their sanity with "touch conf/sanity.conf"
If you don't want to execute this command on every session or build, you can comment out the line INHERIT += "sanity" from meta/conf/sanity.conf, so the file looks something like this:
Had same issue with Bell ISP when accessing example.com gave DNS error.
Solved by switching ISP's DNS IP to Google's DNS (to avoid making changes to configs):
https://developers.google.com/speed/public-dns/docs/using

Jorani [Open Source Leave Management] - Local Server Issue

I have hosted the jorani Open Source LMS, under local server and after logging in, redirects me to home page (http://localhost/lms/home), but I get a 404 - File or directory not found. error.
What can I do to fix this? I know I need a server configuration but I don't know what. Thanks
It seems that you didn't activate the rewrite module.
Jorani contains a page at the root of the installation (e.g. http://localhost/lms/requirements.php) that checks your system and tell you what is missing.
You should read the manual of installation.

Magento: Add New Product Form not displaying in Admin

I've just installed the magento and when I tried to add new product from admin,But now product form is not being displaying. I can see the page like this
what should I do? Please, I searched through Google, but, couldn't find any appropriate answer.
Have you already tried to clear cache and cookies? also some times you have to do it on the shell on /path/to/my/magento/folder/var/cache just run "rm -fr *".
If that doesn't work you can check you files ownership and permissions (the http service has to have the write write permissions an ownership on the files and folder - http://www.magentocommerce.com/wiki/groups/227/resetting_file_permissions).
Hope that works for you.
You could try enabling display_errors in index.php i.e.
ini_set('display_errors', 1);
Also you could enable logs in your backend, and check for errors in system.log and exception.log
As Magneto's back end makes heavy use of prototype.js, check your console for errors .

Coldfusion FarCry CMS error on start up after server reboot

We're using Farcry CMS which runs on top of ColdFusion. Site was running fine but we are getting this error message after a web server reboot.
"Failed to initialise core type: dmHTML.cfc"
"Parameter 1 of function IsDefined, which is now application.stcoapi.dmHTML.stWebskins.Copy of displayPageCalculatorSelector.displayname, must be a syntactically valid variable name."
Really not sure where to start, could anyone suggest a strategy for troubleshooting this type of error.
Looks like you have a file called "Copy of displayPageCalculatorSelector.cfm" in your dmHTML webskin folder.
Remove this file is the best option.
Or rename it and remove the spaces, e.g. "Copy_of_displayPageCalculatorSelector.cfm"

GWT AccessControlException

I'm trying to comunicate with a JNI service in the serverpart of my GWT application. The problem is that I'm getting a
'java.security.AccessControlException:
access denied
(java.lang.RuntimePermission
loadLibrary.HelloWorld)'
Error. I ´Google for the java Security and Permissions model and found a description on http://java.sun.com/developer/onlineTraining/Programming/JDCBook/appA.html
I tried to add the
grant { permission
java.security.AllPermission; };
to my \workspace.......\war\WEB-INF\deploy.......\rpcPolicyManifest\manifest.txt
but that wasnt the policy manifest file...
In which file do I add premissions or how do I tell at compiletime what premissions he uses.
Regards,
Stefan
I found the solution (well part of it)
To run code which needs extra premissions you have to use AccessController.doPrivileged(...)
See:
http://download.oracle.com/javase/1.4.2/docs/api/java/security/AccessController.html