Showing posts with label troubleshooting. Show all posts
Showing posts with label troubleshooting. Show all posts

Monday, February 26, 2018

Troubleshooting Cron (Cron not working)

I had a very curious case on a developmental server where after a couple weeks, I realized the cronjobs were not running. The crontab was fine, the scripts and permissions were fine and could be manually executed. Seems like the issue was cron itself.

It took a bit of digging, and there was this obscure line highlighted in the man page. Much thanks to here for pointing me in the right direction.
https://askubuntu.com/questions/23009/why-crontab-scripts-are-not-working

Two things were wrong here.

1. The crond was stalled. Quietly. Check this first and start it if it's stopped. Even if it's running, consider restarting the service.
service crond status
service crond restart

2. Crontab needs an empty/newline at the end of the file in order to load.
My version of crontab does not match the one in the article (I'm on CentOS 6); but the newline was missing at the end. Oddly enough all the other servers that were fine had this blank/newline. Guess it's pretty important, if not documented/deprecated.

At any rate, cron performs important user functions, so consider checking it from time to time.

--EOF

Thursday, January 2, 2014

Troubleshooting VNC Connection error

So I'm back out to work after a nice vacation, so I should have seen this coming, right?

When attempting to connect to my VNC Server from my client, a nice error message popped up.
Unable to connect to server.
I managed to ssh into the server, but the VNC Server refused to restart:

[myuser@xxxxxx tmp]# service vncserver restart
Shutting down VNC server: 3:myuser                         [FAILED]
Starting VNC server: 3:myuser
Warning: xxx.xxx.xxx:3 is taken because of /tmp/.X3-lock
Remove this file if there is no X server xxx.xxx.xxx.xxx:3
A VNC server is already running as :3                         [FAILED]







Long story short, I had to delete the lockfile and socket in order to be able restart the VNC Server.

0. Login as root/sudo
1. Remove lock file and socket
rm -rf /tmp/.X3-lock
rm -rf /tmp/.X11-unix/X3

2. Restart vnc service
service vncserver restart


Wednesday, January 16, 2013

Issues with CentOS 6 and EPEL

I was running into some issues with the EPEL repo on CentOS 6.x. I had just installed the OS and the EPEL/remi repos and whilst trying to search for a package the same error kept repeating.

Cannot retrieve metalink for repository: epel

and it kept failing each time.

The fix involved editing the EPEL repo and making a simple change from https to http. Why or how this broke is beyond me, but this fix may help someone else.

Assuming you have root or su:

1. Edit the epel repo
nano /etc/yum.repos.d/epel.repo

Find line:
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch

Change to
mirrorlist=http://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch

Save and exit.

2. Clean yum
yum clean all


That did it for me!

Cheers,
noveck