LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 11-17-2017, 04:41 PM   #16
LouW
LQ Newbie
 
Registered: Nov 2017
Posts: 10

Original Poster
Rep: Reputation: Disabled

Quote:
Originally Posted by scasey View Post
"Restart" of a cron isn't necessary, but have you run the command in the cron from the command line to see if it does what you want?

Reviewing the thread I see that you've never stated which version you're using. Others (including me) presumed it was 7, but you've never verified. systemctl is version 7 only. If you're not running CentOS 7, then changing to systemctl syntax will not work...go back to the service syntax.

BUT, you really need to figure out why tomcat is not working. What do the tomcat and/or http logs contain?
Its CentOS Linux 7.2.1511

I know I have to get that figured out. My current theory is its related to article processing and/or mysql - the problem is nothing has changed in months and all of a sudden 3 weeks ago this problem came up.

The hack fix is just to keep sites live while I get this figured out...
 
Old 11-18-2017, 03:52 PM   #17
LouW
LQ Newbie
 
Registered: Nov 2017
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
That'd be vi or vim -- yes it's "unique" -- I don't use it, personally, except for when doing crontab -e
man vi (or search for vi/vim cheat sheet).

I'd also recommend using systemctl instead of service:
Code:
*/30 * * * * root /bin/systemctl restart tomcat.service
in /etc/crontab as michaelk already said.
I was just lookinh at cron log and see this every 30 minutes

(/bin/systemctl) ERROR (getpwnam() failed)

any suggestions?
 
Old 11-20-2017, 08:03 AM   #18
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
I think you missed my second post. Please have a look at it.
 
Old 11-20-2017, 08:16 AM   #19
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,759

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
My fault it should be
Code:
*/30 * * * * root /usr/bin/systemctl restart tomcat.service
 
Old 11-20-2017, 08:53 AM   #20
LouW
LQ Newbie
 
Registered: Nov 2017
Posts: 10

Original Poster
Rep: Reputation: Disabled
Cool I will try that!

TY!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Cron directories: /var/spool/cron/cron.GfqqGO Woodsman Slackware 4 05-11-2011 02:37 PM
cron.hourly cron.weekly cron.monthly and 0anacron. Are they necessary? glore2002 Debian 2 09-30-2009 08:57 PM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change? JZL240I-U SUSE / openSUSE 11 01-04-2007 01:57 AM
Can any one plz explain why/what for cron.d, cron.daily, cron.weekly etc are there. mavinashbabu Linux - Newbie 4 09-21-2006 01:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 06:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration