LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-16-2006, 02:33 PM   #1
gogo_hr
LQ Newbie
 
Registered: Dec 2005
Location: Sofia, Bulgaria
Distribution: Slackware 10.2
Posts: 5

Rep: Reputation: 0
cron.pid


Hello! I'm trying to use Monit to monitor my crond (on Slackware-current). It tries to use the standard /var/run/cron.pid. But I don't have such file on my system and the PID of the crond isn't recorded anywhere. I can always use something like that (but much more complex):
pidof crond > /var/run/cron.pid
I can recompile it too. But I want to figure out why doesn't dcron (that's the package for Slackware) have the cron.pid file and avoid recompiling (I think I should outsmart the defines in defs.h). Thanks in advance!
 
Old 02-17-2006, 02:33 PM   #2
tobyl
Member
 
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 768

Rep: Reputation: 64
I don't think recompiling will help as I don't think creating a pidfile is an option.
But maybe you could modify the start script in /etc/rc.d/rc.M by adding your line:

# Start crond (Dillon's crond):
# If you want cron to actually log activity to /var/log/cron, then change
# -l10 to -l8 to increase the logging level.
if [ -x /usr/sbin/crond ]; then
/usr/sbin/crond -l10 >>/var/log/cron 2>&1
pidof crond > /var/run/cron.pid
fi

the pidfile would get stale if cron died unexpectedly, but then presumably Monit would alert you to that?
maybe worth a try anyway

tobyl
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 08:09 AM
/var/run/[XXX].pid - Tcl pid code liguorir Linux - Software 1 05-20-2004 10:32 PM
rm cannot remove /var/run/atd.pid and /var/run/xdm.pid danishmr Linux - Software 1 05-04-2004 08:01 AM
ERROR: Couldn't write pid to pid file lawrencegoodman Linux - Newbie 2 02-13-2004 08:05 PM
dual entries in cron log for cron.daily cpharvey Linux - General 3 02-27-2003 02:30 PM

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

All times are GMT -5. The time now is 12:59 PM.

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