Project

General

Profile

Actions

User story #4211

closed

The fstab technique should mount file system

Added by Dennis Cabooter over 10 years ago. Updated about 2 years ago.

Status:
Rejected
Priority:
3
Assignee:
-
Category:
Techniques
UX impact:
Suggestion strength:
User visibility:
Effort required:
Name check:
Fix check:
Regression:

Description

The fstab technique doesn't mount file systems. Now I have to do a "mount -a" manually on all nodes which use the technique.

Actions #1

Updated by Matthieu CERDA over 10 years ago

  • Category set to Techniques
  • Status changed from New to Discussion
  • Assignee set to Matthieu CERDA
  • Priority changed from N/A to 3

Hello Dennis.

This Technique is only intended to edit fstab files by design. However, do you think that adding an option to mount automatically the added filesystems would be cool ?

Actions #2

Updated by Dennis Cabooter over 10 years ago

To be honest, to add fstab entries without mounting them is pretty useless, isn't it? Why add a file system to fstab if you don't want to mount it. However, it should be optional.

Actions #3

Updated by Jonathan CLARKE about 10 years ago

  • Tracker changed from Bug to User story
  • Status changed from Discussion to 8
  • Assignee deleted (Matthieu CERDA)
  • Target version set to Ideas (not version specific)

This was not intended in the design. This technique was created to ensure that fstab was compliant (options, especially).

I'll reclassify it as a user story, but I'm afraid it's not something we have time to work on at the moment.

Actions #4

Updated by Jonathan CLARKE about 10 years ago

  • Subject changed from The fstab technique doesn't mount file systems to The fstab technique should mount file systems
Actions #5

Updated by Dennis Cabooter about 10 years ago

It would only be one check box to trigger /sbin/mount -a optionally.

Actions #6

Updated by Jonathan CLARKE about 10 years ago

Dennis Cabooter wrote:

It would only be one check box to trigger /sbin/mount -a optionally.

I know, and I would love to accept a patch if you can write one for us? :)

Actions #7

Updated by Dennis Cabooter about 10 years ago

Can't promise if can make it to a correct patch, but I'm definatly willing to try. :-)

Actions #8

Updated by Dennis Cabooter about 10 years ago

Ok, the XML part was quitte easy to do. I made it so that one can choose to create a mountpoint and/or mount a mountpoint per fstab entry. I've looked into the CFEngine part of other techniques and for me it's very hard to understand how to add these two options into the CFEngine part of the technique. I'm sure willing to do the work, but I will need some support/help from a technique guru. Please understand that the documentation about writing techniques is not very much. And I do know some CFEngine3 syntax, but there's more, like declaring variables in the first place and logging in the end.

Here's my proposal about the XML file:

--- 2.0/metadata.xml    2014-01-15 13:56:59.000000000 +0100
+++ 2.1/metadata.xml    2014-03-06 09:44:28.000000000 +0100
@@ -408,6 +408,36 @@
           <DEFAULT>2</DEFAULT>
         </CONSTRAINT>
       </SELECT1>
+      <SELECT1>
+        <NAME>FSTAB_CREATE_MP</NAME>
+        <DESCRIPTION>Should the mountpoint be created</DESCRIPTION>
+        <ITEM>
+          <LABEL>Yes</LABEL>
+          <VALUE>1</VALUE>
+        </ITEM>
+        <ITEM>
+          <LABEL>No</LABEL>
+          <VALUE>0</VALUE>
+        </ITEM>
+        <CONSTRAINT>
+          <DEFAULT>0</DEFAULT>
+        </CONSTRAINT>
+      </SELECT1>
+      <SELECT1>
+        <NAME>FSTAB_MOUNT_MP</NAME>
+        <DESCRIPTION>Should the mountpoint be mounted</DESCRIPTION>
+        <ITEM>
+          <LABEL>Yes</LABEL>
+          <VALUE>1</VALUE>
+        </ITEM>
+        <ITEM>
+          <LABEL>No</LABEL>
+          <VALUE>0</VALUE>
+        </ITEM>
+        <CONSTRAINT>
+          <DEFAULT>0</DEFAULT>
+        </CONSTRAINT>
+      </SELECT1>
     </SECTION>
   </SECTIONS>
 </TECHNIQUE>
Actions #9

Updated by Nicolas CHARLES about 10 years ago

Dennis,

if I were you, I would create a section for mounting the mount point, with a component name (i let the choice up to you, and I'll name it "COMPONENT NAME" for the rest of this message), as it is clearly another action than simply editing the file, and it would really ease everything.

then, for the CFEngine part, you would need to have a classes: promises, with something like

 &FSTAB_CREATE_MP:{create_mountpoint |"create_mountpoint_&i&" not => strcmp("&create_mountpoint&", "1");
}&
 &FSTAB_MOUNT_MP:{mount_mountpoint |"mount_mountpoint_&i&" not => strcmp("&mount_mountpoint&", "1");
}&

then to create the mountpoint, you'd need to add a promise in the promise of type file

    "${fstab[${fstab_index}][destination]}/." 
      create => "true",
      ifvarclass => "create_mountpoint_${fstab_index}",
      classes => rudder_common_classes("create_mountpoint_${fstab_index}");

Note - i'm not sure of which permissions this folder should have

and make reports based on this, you could use the rudder_common_reports_generic bundle

methods:
  "reports on mountpoint creation" usebundle => rudder_common_reports_generic("fstabConfiguration", "create_mountpoint_${fstab_index}", "${fstab[${fstab_index}][uuid]", "COMPONENT NAME", "None", "Created the mount point"),
  ifvarclass => "create_mountpoint_${fstab_index}";

  "no action needed" usebundle => rudder_common_report("fstabConfiguration", "result_success", "${fstab[${fstab_index}][uuid]", "COMPONENT NAME", "None", "Created the mount point"),
  ifvarclass => "!create_mountpoint_${fstab_index}";

Please note that I'm not sure what you would like to do for mounting. You have two choices:
  1. mount all if anything change (so the checkbox will be a bit misleading)
  2. check at every run if the selected mount point are mounted with /bin/mount | grep mountpoint , and if not mount it (resource intensive)
Actions #10

Updated by Benoît PECCATTE about 9 years ago

  • Status changed from 8 to New
Actions #11

Updated by Anonymous over 5 years ago

  • Tracker changed from User story to Architecture
  • Subject changed from The fstab technique should mount file systems to Personalessay for students
  • Description updated (diff)
  • Category changed from Techniques to Server components
  • Status changed from New to Rejected
  • Assignee set to Dennis Cabooter
  • Target version changed from Ideas (not version specific) to 4.3.5
Actions #12

Updated by Vincent MEMBRÉ over 5 years ago

  • Tracker changed from Architecture to User story
  • Subject changed from Personalessay for students to The fstab technique should mount file system
  • Description updated (diff)
  • Category changed from Server components to Techniques
  • Status changed from Rejected to New
  • Target version changed from 4.3.5 to Ideas (not version specific)

Fixed back the issue, anonymous are prevented again from doing any modifications

Actions #13

Updated by Anonymous over 2 years ago

  • Assignee deleted (Dennis Cabooter)
Actions #14

Updated by Alexis Mousset about 2 years ago

This won’t be added to that technique, please use the technique editor for that. If you are missing some capabilities in it, please open a ticket for that need.

Actions #15

Updated by Alexis Mousset about 2 years ago

  • Status changed from New to Rejected
Actions

Also available in: Atom PDF