Project

General

Profile

Actions

Bug #11624

closed

Cronjob saved as rudder-agent.rpmsave duplicating the job

Added by Janos Mattyasovszky over 6 years ago. Updated about 2 years ago.

Status:
Resolved
Priority:
N/A
Assignee:
-
Category:
Packaging
Target version:
Severity:
Minor - inconvenience | misleading | easy workaround
UX impact:
User visibility:
Operational - other Techniques | Technique editor | Rudder settings
Effort required:
Small
Priority:
0
Name check:
Fix check:
Regression:

Description

If someone has local modifications to the rudder cronjob, the update keeps the old version in the same directory:

warning: /etc/cron.d/rudder-agent saved as /etc/cron.d/rudder-agent.rpmsave

Now duplicated:

# ll /etc/cron.d/rudder-agent*
-rw-r--r-- 1 root root 381 Sep  7 12:10 /etc/cron.d/rudder-agent
-rw-r--r-- 1 root root 495 Oct 13 17:41 /etc/cron.d/rudder-agent.rpmsave

It's because the cronjob is declared as %config in the spec file:

https://github.com/Normation/rudder-packages/blob/378bcb3b982be49aa1a249044db4edb8661685e3/rudder-agent/SPECS/rudder-agent.spec#L478

Not sure if this is the best way to do that... Also not sure if cron does actually ignore *.rpmsave files, but I currently don't know for sure.

As soon you change your rudder cron technique and that changes the file on disk, any agent update having a different file for cron than that will duplicate the file and keep the old indefinite, since you also might change that file from within the policy itself:

https://github.com/Normation/rudder-techniques/blame/master/techniques/system/common/1.0/rudder-agent-community-cron

https://github.com/Normation/rudder-techniques/blob/7c1fc1f763ea2bf5ba67df6e8d2d28bd7fcae57d/techniques/system/common/1.0/cron-setup.st#L35

My humble recommendation would be to remove the %config directive, since the resulting on-disk cron file will be replaced by the first received policy anyway, there is no real benefit from keeping local modifications because
  1. If there was no agent installed before, there is no file that needs to be kept
  2. If there was an agent which was never connected to a policy server, it does not really matter, does it?
  3. If there was an agent which was executing policy, it has templated that file anyway, so no local modification was ever kept, all mods need to go to the root server's techniques/system/common/1.0/rudder-agent-community-cron file...

You might even consider removing either that file from the agent's rpm or have a different cronjob being templated, since modifying files that are owned by an rpm causes the headache :-/

Actions #1

Updated by Benoît PECCATTE over 6 years ago

  • User visibility changed from Getting started - demo | first install | level 1 Techniques to Operational - other Techniques | Technique editor | Rudder settings
  • Priority changed from 50 to 32
Actions #2

Updated by Benoît PECCATTE over 6 years ago

  • Effort required set to Small
  • Priority changed from 32 to 36

We could just remove the file during post-install

Actions #3

Updated by Janos Mattyasovszky over 6 years ago

Why keep it in the first place? :)

Actions #4

Updated by Benoît PECCATTE over 6 years ago

  • Priority changed from 36 to 48
Actions #5

Updated by Nicolas CHARLES over 4 years ago

  • Target version set to 5.0.13
  • Priority changed from 48 to 0

This is still the case

Actions #6

Updated by Vincent MEMBRÉ over 4 years ago

  • Target version changed from 5.0.13 to 5.0.14
Actions #7

Updated by Vincent MEMBRÉ over 4 years ago

  • Target version changed from 5.0.14 to 5.0.15
Actions #8

Updated by Vincent MEMBRÉ over 4 years ago

  • Target version changed from 5.0.15 to 5.0.16
Actions #9

Updated by Alexis Mousset about 4 years ago

  • Target version changed from 5.0.16 to 5.0.17
Actions #10

Updated by Vincent MEMBRÉ almost 4 years ago

  • Target version changed from 5.0.17 to 5.0.18
Actions #11

Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 5.0.18 to 5.0.19
Actions #12

Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 5.0.19 to 5.0.20
Actions #13

Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 5.0.20 to 797
Actions #14

Updated by Benoît PECCATTE over 2 years ago

  • Target version changed from 797 to 6.1.14
Actions #15

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 6.1.14 to 6.1.15
Actions #16

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 6.1.15 to 6.1.16
Actions #17

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 6.1.16 to 6.1.17
Actions #18

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 6.1.17 to 6.1.18
Actions #19

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 6.1.18 to 6.1.19
Actions #20

Updated by Alexis Mousset about 2 years ago

  • Status changed from New to Resolved

not a config file since 7.0, closing.

Actions

Also available in: Atom PDF