Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HotSync: cron sync and avoid execution on slave host #6328

Closed
federicoballarini opened this issue Nov 9, 2020 · 3 comments
Closed

HotSync: cron sync and avoid execution on slave host #6328

federicoballarini opened this issue Nov 9, 2020 · 3 comments
Labels
bug A defect of the software forge The package belongs to NethForge verified All test cases were verified successfully

Comments

@federicoballarini
Copy link
Member

federicoballarini commented Nov 9, 2020

Steps to reproduce

  • Log into a slave hotsync machine with freepbx installed
  • Run this command: run-parts /etc/cron.hourly/

Expected behavior

No errors.

Actual behavior

[root@fw2 ~]# run-parts /etc/cron.hourly/
/etc/cron.hourly/daily_cdr_cleanup:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Components

nethserver-hotsync

See also

This happens because mysql is not running (correct), so we don't have to check and clean cdr.


@gsanchietti @Stell0 is correct that this file is called "daily_cdr_cleanup" but it is into cron.hourly folder?

@federicoballarini federicoballarini added bug A defect of the software forge The package belongs to NethForge labels Nov 9, 2020
@federicoballarini federicoballarini self-assigned this Nov 9, 2020
@federicoballarini
Copy link
Member Author

federicoballarini commented Nov 16, 2020

I'm going to add sync cron file, to avoid differences (in previous package some cron were deleted) and to sync also custom crons inserted in cron.daily, cron.weekly, cron.hourly, cron.monthly. Cron.d files are regenerated with nethserver-actions so is not necessary to sync them.
Then on slave machine the idea is to remove execution permissions, and readd these on promote action.

@federicoballarini federicoballarini changed the title Cron hourly error on hotsync slave machine Hotsync: cron sync and avoid execution on slave host Nov 16, 2020
@federicoballarini federicoballarini changed the title Hotsync: cron sync and avoid execution on slave host HotSync: cron sync and avoid execution on slave host Nov 16, 2020
federicoballarini added a commit to NethServer/nethserver-hotsync that referenced this issue Nov 16, 2020
@federicoballarini federicoballarini added the testing Packages are available from testing repositories label Nov 16, 2020
@federicoballarini federicoballarini removed their assignment Nov 16, 2020
@federicoballarini
Copy link
Member Author

Test case: OK

[root@fw ~]# hotsync
===== Report for configuration backup =====
Backup started at 2020-11-16 16:33:51
Event pre-backup-config: SUCCESS
Action backup-config-execute: SUCCESS
Event post-backup-config: SUCCESS
Backup status: SUCCESS
Backup ended at 2020-11-16 16:34:03
Time elapsed: 0 hours, 0 minutes, 12 seconds


[root@fw2 ~]# ls -l /etc/cron.hourly/
total 20
-rw-r--r--. 1 root root 392 Aug  9  2019 0anacron
-rw-r--r--  1 root root 362 Apr  2  2020 0yum-hourly.cron
-rw-r--r--  1 root root 922 Nov  6 17:27 daily_cdr_cleanup
-rw-r--r--  1 root root 173 Aug  4 21:40 hylafax+
-rw-r--r--  1 root root 344 Sep  3  2019 jobs.deny


[root@fw2 ~]# run-parts /etc/cron.hourly/

@federicoballarini federicoballarini added verified All test cases were verified successfully and removed testing Packages are available from testing repositories labels Nov 16, 2020
federicoballarini added a commit to NethServer/nethserver-hotsync that referenced this issue Nov 26, 2020
- HotSync: cron sync and avoid execution on slave host - Bug NethServer/dev#6328
- HotSync: permissions are not fixed after master sync - Bug NethServer/dev#6335
@nethbot
Copy link
Member

nethbot commented Nov 26, 2020

in 7.9.2009/nethforge:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect of the software forge The package belongs to NethForge verified All test cases were verified successfully
Projects
None yet
Development

No branches or pull requests

2 participants