Repository: rucio/rucio

Issue:
Enhance deamon documentation
Motivation
----------
Enhance deamon documentation

Modification
------------



Discussion:

Resolving patch:
diff --git a/lib/rucio/clis/daemons/reaper/dark.py b/lib/rucio/clis/daemons/reaper/dark.py
--- a/lib/rucio/clis/daemons/reaper/dark.py
+++ b/lib/rucio/clis/daemons/reaper/dark.py
@@ -14,6 +14,7 @@
 #
 # Authors:
 # - Vincent Garonne, <vgaronne@gmail.com>, 2016-2018
+# - Hannes Hansen, <hannes.jakob.hansen@cern.ch>, 2018
 
 """
 Reaper is a daemon to manage file on disk but not in Rucio(dark data) deletion
@@ -29,7 +30,7 @@ def get_parser():
     """
     Returns the argparse parser.
     """
-    parser = argparse.ArgumentParser()
+    parser = argparse.ArgumentParser(description="The Dark-Reaper daemon is responsible for the deletion of quarantined replicas.")
     parser.add_argument("--run-once", action="store_true", default=False, help='One iteration only')
     parser.add_argument("--all-rses", action="store_true", default=False, help='Select RSEs from the quarantined queues')
     parser.add_argument("--total-workers", action="store", default=1, type=int, help='Total number of workers per process')
diff --git a/lib/rucio/clis/daemons/reaper/reaper.py b/lib/rucio/clis/daemons/reaper/reaper.py
--- a/lib/rucio/clis/daemons/reaper/reaper.py
+++ b/lib/rucio/clis/daemons/reaper/reaper.py
@@ -15,6 +15,7 @@
 # Authors:
 # - Vincent Garonne, <vgaronne@gmail.com>, 2012-2018
 # - Wen Guan, <wguan.icedew@gmail.com>, 2014
+# - Hannes Hansen, <hannes.jakob.hansen@cern.ch>, 2018
 
 """
 Reaper is a daemon to manage file deletion
@@ -30,7 +31,34 @@ def get_parser():
     """
     Returns the argparse parser.
     """
-    parser = argparse.ArgumentParser()
+    parser = argparse.ArgumentParser(description="The Reaper daemon is responsible for replica deletion. It deletes them by checking if there are replicas that are not locked and have a tombstone to indicate that they can be deleted.", epilog='''
+Upload a file and prepare the rules and replicas for deletion by using the judge-cleaner daemon::
+
+  $ rucio upload --rse MOCK --scope mock --name file filename.txt
+  $ rucio add-rule mock:file 1 MOCK2 --lifetime 1
+  $ rucio-judge-cleaner --run-once
+
+Check if the replica was created::
+
+  $ rucio list-file-replica mock:file
+  +---------+--------+------------+-----------+---------------------------------------------------------+
+  | SCOPE   | NAME   | FILESIZE   | ADLER32   | RSE: REPLICA                                            |
+  |---------+--------+------------+-----------+---------------------------------------------------------|
+  | mock    | file   | 1.542 kB   | 1268ee71  | MOCK: file://localhost:0/tmp/rucio_rse/mock/15/58/file  |
+  +---------+--------+------------+-----------+---------------------------------------------------------+
+
+Run the daemon::
+
+  $ rucio-reaper --run-once
+
+Check if the replica exists::
+
+  $ rucio list-file-replica mock:file
+  +---------+--------+------------+-----------+---------------------------------------------------------+
+  | SCOPE   | NAME   | FILESIZE   | ADLER32   | RSE: REPLICA                                            |
+  |---------+--------+------------+-----------+---------------------------------------------------------|
+  +---------+--------+------------+-----------+---------------------------------------------------------+
+ ''')
     parser.add_argument("--run-once", action="store_true", default=False, help='One iteration only')
     parser.add_argument("--total-workers", action="store", default=1, type=int, help='Total number of workers per process')
     parser.add_argument("--threads-per-worker", action="store", default=None, type=int, help='Total number of threads created by each worker')


Test patch: