Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
fcron problems: fcrondyn ls crashes fcron
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
equaeghe
l33t
l33t


Joined: 22 Feb 2005
Posts: 632

PostPosted: Mon Mar 25, 2013 10:44 am    Post subject: fcron problems: fcrondyn ls crashes fcron Reply with quote

Hi,


My fcron installation has problems. I'll try to tackle one issue at a time:

Whenever I do an ls in the fcrondyn shell, fcrondyn exits after a (partial?) listing and when I then check fcron using '/etc/init.d/fcron status', I get the message that fcron has crashed. This is a perfectly reproducable crash.

How should I fix/analyze this problem?


TIA,

Erik
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon Mar 25, 2013 7:49 pm    Post subject: Reply with quote

equaeghe ...

I can't reproduce this with the stable fcron:

Code:
# equery list fcron
sys-process/fcron-3.1.1
# fcrondyn -i
fcrondyn>ls systab
ID    SCHEDULE         CMD
1     03/25/2013 20:50 test -x /usr/sbin/run-crons && /usr/sbin/run-crons
0     03/25/2013 20:57 /usr/libexec/check_system_crontabs -s 0
5     03/25/2013 20:59 rm -f /var/spool/cron/lastrun/cron.hourly
4     03/26/2013 03:09 rm -f /var/spool/cron/lastrun/cron.daily
3     03/30/2013 04:19 rm -f /var/spool/cron/lastrun/cron.weekly
2     04/01/2013 05:29 rm -f /var/spool/cron/lastrun/cron.monthly

best ... khay
Back to top
View user's profile Send private message
equaeghe
l33t
l33t


Joined: 22 Feb 2005
Posts: 632

PostPosted: Tue Mar 26, 2013 8:49 am    Post subject: Reply with quote

khayyam wrote:
I can't reproduce this with the stable fcron:


I'm also using stable fcron...

Code:
# equery list fcron
 * Searching for fcron ...
[IP-] [  ] sys-process/fcron-3.1.1:0
# /etc/init.d/fcron status
 * status: started                                   
# fcrondyn -x 'ls systab'                                                                           
ID    SCHEDULE         CMD                                                                                     
3     03/31/2013 03:56 /usr/local/bin/backup+mount.sh internal monthly                                         
7     03/31/2013 03:56 /usr/local/bin/backup+mount.sh external monthly                                         
connection closed by fcron                                                                                     
# /etc/init.d/fcron status                                                                         
 * status: crashed
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue Mar 26, 2013 1:14 pm    Post subject: Reply with quote

equaeghe ...

ok, it looks as though your trying to pass parameters to the script, and I suspect there are extraneous characters from the way that fcrondyn outputs it. Also, this doesn't look like the "system crontab" as there is no *.{daily,weekly,monthly}, did you run 'emerge --config sys-process/fcron' on emerging?

It seems the obvious solution would be to remove the old systab, run 'emerge --config sys-process/fcron' and add 'backup-internal.sh' and 'backup-external.sh' (u+x) to /etc/cron.monthly calling '/usr/local/bin/backup+mount.sh' with their respective parameters.

HTH & best ... khay
Back to top
View user's profile Send private message
equaeghe
l33t
l33t


Joined: 22 Feb 2005
Posts: 632

PostPosted: Tue Mar 26, 2013 3:20 pm    Post subject: Reply with quote

khayyam wrote:
ok, it looks as though your trying to pass parameters to the script, and I suspect there are extraneous characters from the way that fcrondyn outputs it. Also, this doesn't look like the "system crontab" as there is no *.{daily,weekly,monthly}, did you run 'emerge --config sys-process/fcron' on emerging?


No, it seems not...

khayyam wrote:
It seems the obvious solution would be to remove the old systab, run 'emerge --config sys-process/fcron' and add 'backup-internal.sh' and 'backup-external.sh' (u+x) to /etc/cron.monthly calling '/usr/local/bin/backup+mount.sh' with their respective parameters.


Ok. I re-emerged fcron, did `fcrontab -r -u systab` (after saving its contents, my fcron'ed backup planning, to /root/systab.save), did `emerge --config sys-process/fcron`, `cp systab.save /etc/cron.d/backup`, and `/usr/libexec/check_system_crontabs -s 0`. Now I have:

Code:
# fcrondyn -x ls
ID    USER   SCHEDULE         CMD
21    systab 03/26/2013 16:10 test -x /usr/sbin/run-crons && /usr/sbin/run-crons
12    systab 03/26/2013 16:12 /usr/libexec/check_system_crontabs -s 0
13    systab 03/26/2013 16:14 /usr/local/bin/backup+mount.sh external monthly
14    systab 03/26/2013 16:21 /usr/local/bin/backup+mount.sh external weekly
15    systab 03/26/2013 16:29 /usr/local/bin/backup+mount.sh external daily
16    systab 03/26/2013 16:36 /usr/local/bin/backup+mount.sh external hourly
17    systab 03/26/2013 16:44 /usr/local/bin/backup+mount.sh internal monthly
18    systab 03/26/2013 16:51 /usr/local/bin/backup+mount.sh internal weekly
25    systab 03/26/2013 16:59 rm -f /var/spool/cron/lastrun/cron.hourly
19    systab 03/26/2013 16:59 /usr/local/bin/backup+mount.sh internal daily
20    systab 03/26/2013 17:06 /usr/local/bin/backup+mount.sh internal hourly
24    systab 03/27/2013 03:09 rm -f /var/spool/cron/lastrun/cron.daily
23    systab 03/30/2013 04:19 rm -f /var/spool/cron/lastrun/cron.weekly
22    systab 04/01/2013 05:29 rm -f /var/spool/cron/lastrun/cron.monthly


I'll see whether that works for a couple of days, but I already think you provided me with the winning clue, thanks!
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue Mar 26, 2013 4:50 pm    Post subject: Reply with quote

equaeghe wrote:
Ok. I re-emerged fcron, did `fcrontab -r -u systab` (after saving its contents, my fcron'ed backup planning, to /root/systab.save), did `emerge --config sys-process/fcron`, `cp systab.save /etc/cron.d/backup`, and `/usr/libexec/check_system_crontabs -s 0`.

equaeghe ... by doing this you duplicate the systab, so just run 'emerge --config sys-process/fcron'. This will take the content of /etc/crontab (system crontab) and turn it into systab. The comment in /etc/crontab re running 'crontab /etc/crontab' is confusing, as that file is provided by fcron, and when you emerge fcron it provides postinst info to run 'emerge --config sys-process/fcron'.

So, start from a clean slate:

Code:
# /etc/init.d/fcron stop
# rm /var/spool/fcron/systab*
# emerge --config sys-process/fcron
# /etc/init.d/fcron start

That should provide a systab with only the content of the current /etc/crontab. However, I'd suggest you don't use /etc/crontab for anything other than the default systab (because its not, by default, fcrons 'systab'), edit it to just have those jobs provided with the default config ... *then* ... run backup+mount.sh with the respective parameters from /etc/cron.monthly/ via seperate scripts. The reason being that if you use use /etc/crontab then you will have a situtation where your editing a file that fcron doesn't use.

HTH & best ... khay
Back to top
View user's profile Send private message
equaeghe
l33t
l33t


Joined: 22 Feb 2005
Posts: 632

PostPosted: Tue Mar 26, 2013 7:12 pm    Post subject: Reply with quote

khayyam wrote:
equaeghe wrote:
Ok. I re-emerged fcron, did `fcrontab -r -u systab` (after saving its contents, my fcron'ed backup planning, to /root/systab.save), did `emerge --config sys-process/fcron`, `cp systab.save /etc/cron.d/backup`, and `/usr/libexec/check_system_crontabs -s 0`.

equaeghe ... by doing this you duplicate the systab, so just run 'emerge --config sys-process/fcron'. This will take the content of /etc/crontab (system crontab) and turn it into systab. The comment in /etc/crontab re running 'crontab /etc/crontab' is confusing, as that file is provided by fcron, and when you emerge fcron it provides postinst info to run 'emerge --config sys-process/fcron'.


I'm sorry, but here I must disagree, what I do makes perfect sense and is in line with the use of check_system_crontabs (see this file for info). I do not want to put my backup script in the /etc/cron.{hourly,daily,weekly,monthly} directories, because my definition of hourly, daily, weekly, and monthly is based on my estimate of how much uptime I will have (a 'day' is about 8 hours, etc.). (I am also not sure the scripts in /etc/cron.{hourly,daily,weekly,monthly} are run by uptime or wall time and how they work in light of much downtime). Also note that I do not touch /etc/crontab and that my `fcrondyn -x ls` output is now as it should be.

Cheers,

Erik
Back to top
View user's profile Send private message
luciano
Tux's lil' helper
Tux's lil' helper


Joined: 18 Nov 2004
Posts: 132

PostPosted: Fri Oct 18, 2013 8:45 pm    Post subject: Reply with quote

Hi Erik,

I'm also having the same problem when running 'fcrondyn -x ls', causing the process to crash. I see the following in the system logs:

Code:

Oct 18 21:41:24 [fcron] Client's pid=15352, uid=0, gid=0 username=root_
Oct 18 21:41:24 [kernel] [17082.021254] fcron[15336]: segfault at 10 ip 000000000040ee19 sp 00007fffeb0c1240 error 4 in fcron[400000+17000]
Oct 18 21:41:37 [/etc/init.d/fcron] status: crashed


Did you do anything else besides emerge --configure to fix this problem?
Back to top
View user's profile Send private message
equaeghe
l33t
l33t


Joined: 22 Feb 2005
Posts: 632

PostPosted: Fri Oct 18, 2013 8:49 pm    Post subject: Reply with quote

luciano wrote:
I'm also having the same problem when running 'fcrondyn -x ls', causing the process to crash. [...]
Did you do anything else besides emerge --configure to fix this problem?

Well, I reinstalled my system crontab. I don't exactly remember, but I think I encountered this again... reinstalling the system crontab made it work again. Now it's been a while since I had any trouble. So I still don't really know what was the problem. Good luck.
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1759
Location: PB, Germany

PostPosted: Fri Jan 13, 2017 8:51 am    Post subject: Reply with quote

This is sys-process/fcron-3.2.1-r1.
I still have this issue that any fcrondyn follow by ls makes the fcron service crash.
But my setup is migrated from many years ago, so the setup could have the same issue involved in this old thread.

I still have both crontabs, for user root and systab. In systab I have the generic run-parts stuff. Is this still correct or should I merge all to the root tab?

Code:
# fcrontab -l -u systab 2>/dev/null
!mail(false)

#--------------------------------------------------------------------------------------
# ENTRIES BASED ON ELAPSED SYSTEM UP TIME
#@options,FirstExec,LoadAvg1m,5m,15m,timeout    freq.   command

@nolog,first(5),lavg1(1.2),until(30)            1h      run-parts /etc/cron.hourly
#@first(22h15),lavg1(1.2),until(12h)             1d      run-parts /etc/cron.daily
#@first(1h30),lavg5(1.4),until(2d)               1w      run-parts /etc/cron.weekly
#@first(3h45),lavg15(1.6),until(2d)              1m      run-parts /etc/cron.monthly

#--------------------------------------------------------------------------------------
# ENTRIES BASED ON TIME AND DATE
#&options   min     hrs     day-of-month    month   day-of-week     command

#--------------------------------------------------------------------------------------
# *LY KEYWORDS                  min hours   (days) command
%nightly,lavg1(1.2),until(6h)   *   20-04           run-parts /etc/cron.daily
%weekly,lavg5(1.4),until(2d)    *   20-04           run-parts /etc/cron.weekly
%monthly,lavg15(1.6),until(2d)  *   20-04     *     run-parts /etc/cron.monthly
Code:
# fcrontab -l -u root 2>/dev/null
!mail(false)
   
#--------------------------------------------------------------------------------------
# ENTRIES BASED ON ELAPSED SYSTEM UP TIME
#@options,FirstExec,LoadAvg1m,5m,15m,timeout    freq.   command
   
@nolog,first(10)    1d  /usr/sbin/btrbk -c /etc/btrbk/btrbk.conf run

Code:
# fcrondyn
fcrondyn> ls root
ID   |SCHEDULE        |CMD
4    |2017-01-13 14:57|/usr/sbin/btrbk -c /etc/btrbk/btrbk.conf run
fcrondyn> ls systab
ID   |SCHEDULE        |CMD
0    |2017-01-13 20:00|run-parts /etc/cron.monthly
1    |2017-01-13 20:00|run-parts /etc/cron.weekly
2    |2017-01-13 20:00|run-parts /etc/cron.daily
connection closed by fcron

# service fcron status
 * status: crashed
The root tab can be listed. The listing of the systab crashes and misses the hourly rule. Removing the hourly rule, the 'ls' works without crash.

What is wrong with that hourly rule?
Code:
@nolog,first(5),lavg1(1.2),until(30)            1h      run-parts /etc/cron.hourly

_________________
HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Back to top
View user's profile Send private message
equaeghe
l33t
l33t


Joined: 22 Feb 2005
Posts: 632

PostPosted: Fri Jan 13, 2017 8:58 am    Post subject: Reply with quote

Massimo B. wrote:
This is sys-process/fcron-3.2.1-r1.
I still have this issue that any fcrondyn follow by ls makes the fcron service crash.
But my setup is migrated from many years ago, so the setup could have the same issue

Because this fcron issue persisted, which interfered with my backups, I migrated to systemd, which essentially has its own, less buggy fcron equivalent. So, sorry, but I can't help anymore in this thread.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum