Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
Im new here and beginner on CentOS so helps are appreciated,
The problem is that everytime when a cronjob run I get this error on the log:
Code:
Sep 25 22:29:01 host crond[1821]: Cannot make/remove an entry for the specified session
Sep 25 22:29:01 host crond[1821]: CRON (root) ERROR: failed to open PAM security session: Success
Sep 25 22:29:01 host crond[1821]: CRON (root) ERROR: cannot set security context
Note that the command line run normally from SSH command.
And the same script was running fine on another hosting.
...and unless you post the script and give us details about it, there's little we can do. Those error(s) are in the script itself, not cron. Best guess would be it's either running as root and needs to run as another user, or that there's an inherited environment variable in your shell, that's not present in CRON.
...and unless you post the script and give us details about it, there's little we can do. Those error(s) are in the script itself, not cron. Best guess would be it's either running as root and needs to run as another user, or that there's an inherited environment variable in your shell, that's not present in CRON.
"Doesn't help" is not a diagnostic message we can do anything with. Instead post /var/log/secure and /var/log/cron output like you did before.
Quote:
Originally Posted by mhrlive
How can I remove the crond package and reinstall it ?
With Linux there's rarely reason to remove and re-install software as it may disrupt services and it's, with all due respect, a reflex people learnt using a certain other OS. Please get used to troubleshooting things properly and that starts with diagnosing things properly.
"Doesn't help" is not a diagnostic message we can do anything with. Instead post /var/log/secure and /var/log/cron output like you did before.
With Linux there's rarely reason to remove and re-install software as it may disrupt services and it's, with all due respect, a reflex people learnt using a certain other OS. Please get used to troubleshooting things properly and that starts with diagnosing things properly.
Thanks for the replay as I montion Im a beginner,
the /var/log/secure show everytime cron job is launched:
Code:
Sep 26 13:37:01 host crond[23327]: PAM unable to resolve symbol: pam_sm_acct_mgmt
Sep 26 13:37:01 host crond[23328]: PAM unable to resolve symbol: pam_sm_acct_mgmt
Sep 26 13:37:01 host crond[23327]: pam_loginuid(crond:session): set_loginuid failed
Sep 26 13:37:01 host crond[23327]: pam_unix(crond:session): session opened for user root by (uid=0)
Sep 26 13:37:01 host crond[23327]: pam_unix(crond:session): session closed for user root
Sep 26 13:37:01 host crond[23328]: pam_loginuid(crond:session): set_loginuid failed
Sep 26 13:37:01 host crond[23328]: pam_unix(crond:session): session opened for user apache by (uid=0)
Sep 26 13:37:01 host crond[23328]: pam_unix(crond:session): session closed for user apache
and the cron log show :
Code:
Sep 25 22:29:01 host crond[1821]: Cannot make/remove an entry for the specified session
Sep 25 22:29:01 host crond[1821]: CRON (root) ERROR: failed to open PAM security session: Success
Sep 25 22:29:01 host crond[1821]: CRON (root) ERROR: cannot set security context
Sep 26 13:37:01 host crond[23328]: pam_unix(crond:session): session opened for user apache by (uid=0)
Sep 26 13:37:01 host crond[23328]: pam_unix(crond:session): session closed for user apache
BTW, please explain what cron jobs Apache is running here?
The cron job is a script to save data (stats) to the DB every one hour.. tried everything I found on google search for three days but nothing fixed the error, please help time press I have to fix this before Saturday :/
Hello guys, good news
I managed to resolve the problem, only by commenting any line with "session required pam_loginuid.so" on the files in /etc/pam.d/
I dont know the exact file or files that resolve the problem, may be the crond I will check later, but now the cronjob run smooth and clean, wish this help future visitors on this page with similar problem.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.