Skip to content

Commit

Permalink
Fix various issues.
Browse files Browse the repository at this point in the history
Signed-off-by: Volker Theile <volker.theile@openmediavault.org>
  • Loading branch information
votdev committed Sep 10, 2020
1 parent dea4891 commit 566d251
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 68 deletions.
18 changes: 9 additions & 9 deletions administration/general/notifications.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Notifications
#############


Notifications work in the form of email. The backend software used here is postfix [1]_ configured as a MTA. The options allow to configure to send mail via SMTP servers using the standard port or use SSL/TLS. The |webui| allows inputing two delivery addresses. Both are assigned to the root user.
Notifications work in the form of email. The backend software used here is postfix [1]_ configured as a MTA. The options allow to configure to send mail via SMTP servers using the standard port or use SSL/TLS. The |webui| allows inputing two delivery addresses. Both are assigned to the root user.


Configuration
Expand All @@ -28,7 +28,7 @@ Examples 1::

Mail will be delivered to ``mikeadmin@themailco.com`` as it is defined in canonical_recipients. The delivery address can be explicit also::

$ echo "Message body" | mail -s "Test subject" mikeadmin@themailco.com
$ echo "Message body" | mail -s "Test subject" mikeadmin@themailco.com


Examples 2::
Expand All @@ -46,7 +46,7 @@ Events

The server will send notifications for this events:

- Log in from browser (If cookies are allowed, then it just sends once).
- Log in from browser (If cookies are allowed, then it just sends once).
- Use of sudo by a user not in allowed group.
- Summary of locked users by pam_tally2 [2]_. This happens when a user or admin attempts fails to log in for more than three times.
- MD RAID events: degraded, reshape, etc. [D]
Expand All @@ -58,7 +58,7 @@ The server will send notifications for this events:
- Cron-apt: Summary of upgrade packages available. [D]
- SMART: Report of attribute changes. [D]

Options marked with [D] can be disabled selectivly. The rest only when the whole notification backend is disabled.
Options marked with [D] can be disabled selectivly. The rest only when the whole notification backend is disabled.

Gmail
=====
Expand All @@ -79,7 +79,7 @@ Gmail can be used in notifications. If you have 2FA enabled for the account, the
Aliases are allowed. This is good for filtering later in gmail. ``rootthe@gmail.com`` can be ``rootthe+server1@gmail.com`` or ``rootthe+whatever@gmail.com``

.. note::
Gmail requires "access for less secure applications" to be enabled, in order for |omv| to send notifications using ``smtp.gmail.com``. `Enable access for less secure applications <https://myaccount.google.com/lesssecureapps>`_ ::
Gmail requires "access for less secure applications" to be enabled, in order for |omv| to send notifications using ``smtp.gmail.com``. `Enable access for less secure applications <https://myaccount.google.com/lesssecureapps>`_ ::


SSL
Expand Down Expand Up @@ -107,18 +107,18 @@ Also the following positional arguments are passed::
Most modern non mail notifications systems have a documented API, where you can send text using curl payloads with a secret TOKEN. So most common case would be to use MESSAGE_FILE variable only in your script.

Your script's filename must adhere to the following standards:

- Must belong to one or more of the following namespaces:

- The LANANA-assigned namespace (^[a-z0-9]+$)
- The LSB hierarchical and reserved namespaces (^_?([a-z0-9_.]+-)+[a-z0-9]+$)
- The Debian cron script namespace (^[a-zA-Z0-9_-]+$)

- Start with a number like this: :file:`<##>pushnotification`

.. note::
- Do not add an extension to your script in the run-parts directory, otherwise it will get excluded.
- Make sure the script file is executable. In this case also make sure the script is not a symlink to a mounted filesystem with noexec flag.
- Make sure the script file is executable. In this case also make sure the script is not a symlink to a mounted filesystem with `noexec` flag.


.. [1] http://www.postfix.org
Expand Down
4 changes: 2 additions & 2 deletions administration/general/powermanagement.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Power Management
Monitoring
^^^^^^^^^^

Configures cpufrequtils and sets the default options for the governor to be **conservative** by default in x86 architectures if enabled. If architecture is different then governor is set as **ondemand**.
Configures `cpufrequtils` and sets the default options for the governor to be **conservative** by default in x86 architectures if enabled. If architecture is different then governor is set as **ondemand**.

:file:`/etc/default/cpufrequtils`

Expand Down Expand Up @@ -33,7 +33,7 @@ Configures the action to take when pressing the mechanical power button of the s
Scheduled
^^^^^^^^^

Based on cron, is possible to define shutdown, hibernation or suspend times for the server
Based on cron, is possible to define shutdown, hibernation or suspend times for the server.



26 changes: 13 additions & 13 deletions administration/storage/disks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ Be aware that when attaching disks via USB (a docking station, cage, adapter, et

.. code-block:: json
{
"response":{
{
"response":{
"total":3,
"data":[
{
"data":[
{
"devicename":"mmcblk1",
"devicefile":"/dev/mmcblk1",
"devicelinks":[
"devicelinks":[
"/dev/disk/by-id/mmc-SL16G_0x0091d901",
"/dev/disk/by-path/platform-ff500000.dwmmc"
],
Expand All @@ -26,10 +26,10 @@ Be aware that when attaching disks via USB (a docking station, cage, adapter, et
"israid":false,
"isroot":true
},
{
{
"devicename":"sda",
"devicefile":"/dev/sda",
"devicelinks":[
"devicelinks":[
"/dev/disk/by-path/platform-xhci-hcd.8.auto-usb-0:1:1.0-scsi-0:0:0:0",
"/dev/disk/by-id/usb-USB_3.0_HDD_Docking_Station_2017101701E0-0:0"
],
Expand All @@ -41,10 +41,10 @@ Be aware that when attaching disks via USB (a docking station, cage, adapter, et
"israid":false,
"isroot":false
},
{
{
"devicename":"sdb",
"devicefile":"/dev/sdb",
"devicelinks":[
"devicelinks":[
"/dev/disk/by-id/usb-USB_3.0_HDD_Docking_Station_2017101701E0-0:1",
"/dev/disk/by-path/platform-xhci-hcd.8.auto-usb-0:1:1.0-scsi-0:0:0:1"
],
Expand Down Expand Up @@ -79,18 +79,18 @@ All the above options are configured using hdparm [1]_. The APM values from the
seven steps with a small description to make it easier for the user to select. If you want to experiment with intermediate values then
you can edit :file:`/etc/openmediavault/config.xml` find this xpath ``/storage/hdparm``, change the values for the disk, finally run::

$ omv-mkconf hdparm
$ omv-salt deploy run hdparm

Reboot, check if APM has been set with::

$ hdparm -I /dev/sdX

When setting a spindown time make sure APM is set bellow 128, otherwise it will not work. The web framework does
When setting a spindown time make sure APM is set bellow 128, otherwise it will not work. The web framework does
not narrow the APM options if spin down time is set, or disables the spindown menu when a value higher than 128 is selected.

.. note::
For changes to be permanent, settings are stored in this file :file:`/etc/hdparm.conf`, however those settings are
applied using a ``UDEV ADD+`` that executes :file:`/lib/udev/hdparm` which parses that file. For changes to be applied
For changes to be permanent, settings are stored in this file :file:`/etc/hdparm.conf`, however those settings are
applied using a ``UDEV ADD+`` that executes :file:`/lib/udev/hdparm` which parses that file. For changes to be applied
inmediatly server needs to be suspended/resumed or rebooted.

Wipe
Expand Down
26 changes: 13 additions & 13 deletions administration/storage/filesystems.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ Filesystems
Overview
The filesystem section of the |omv| |webui| is where you integrate disk volumes to be part of the server. Drives/filesystems that are not mounted through the |webui| are not registered in the backend database, this means you cannot use volumes to create shared folders if they were not mounted properly. *This is very important*, users that come from an existing debian installation with filesystems already present in their fstab file will see that no volumes will be available for creating shared folders even if they are mounted. For the disks to be properly integrated it is better to delete all fstab lines except rootfs and swap, reboot your server and start mounting the disks through the |webui|.

The mount process acts like many other services in |omv|, first it writes a database entry in config.xml, this entry contains essential information:
The mount process acts like many other services in |omv|, first it writes a database entry in ``config.xml``, this entry contains essential information:

- UUID of the mounted entry inside config.xml <uuid>
- Predictable device path of the filesystem <fsname>
- Target mount directory <dir>
- Filesystem options <opts>
- Filesystem type (EXT3, EXT4, etc.) <type>
- UUID of the database object `<uuid>`
- Predictable device path of the filesystem `<fsname>`
- Target mount directory `<dir>`
- Filesystem options `<opts>`
- Filesystem type (EXT3, EXT4, etc.) `<type>`

You can inspect a mntent entry in config.xml it should look like this:
You can inspect a `mntent` entry in ``config.xml`` it should look like this:

.. code-block:: xml
Expand All @@ -22,27 +22,27 @@ Overview
<fsname>/dev/disk/by-label/VOLUME1</fsname>
<dir>/srv/dev-disk-by-label-VOLUME1</dir>
<type>ext4</type>
<opts>defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl</opts>
<opts>defaults,nofail,user_xattr,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl</opts>
<freq>0</freq>
<passno>2</passno>
<hidden>0</hidden>
</mntent>
With the mntent entry in config.xml, mkconf fstab script writes the appropiate line in ``/etc/fstab``. You can identify entries in ``/etc/fstab`` created by the |webui| by looking at «openmediavault» tags. It is important to mention to not alter the information in between these tags. If you delete or modify a fstab option (noexec or quota for example) the next time you mount a new disk into the server, the mkconf will pipe the original value there again. If you need persistent change use :doc:`environmental variables </various/fs_env_vars>`. Finally the backend will proceed to mount the filesystem. After this the volume is ready for creating shared folders.
With the `mntent` entry in ``config.xml``, :command:``omv-salt deploy run fstab` script writes the appropriate line in ``/etc/fstab``. You can identify entries in ``/etc/fstab`` created by the |webui| by looking at «openmediavault» tags. It is important to mention to not alter the information in between these tags. If you delete or modify a fstab option (`noexec` or `quota` for example) the next time you mount a new disk into the server, :command:`omv-salt deploy run fstab` will deploy the original value there again. If you need persistent change use :doc:`environmental variables </various/fs_env_vars>`. Finally the backend will proceed to mount the filesystem. After this the volume is ready for creating shared folders.

Resize
The resize button is used for expanding filesystems. This can ocurr if you decide to resize a disk partition or you have grown a RAID array by adding one or more disks.
The resize button is used for expanding filesystems. This can occur if you decide to resize a disk partition or you have grown a RAID array by adding one or more disks.

.. warning::
Filesystems greater than 16TB in ext4
The default mkfs.ext4 of Debian Wheezy does not use the 64bit flag for filesystems under 16TB, this is a serious problem since RAID arrays without that flag won't be able to expand and there is no workaround more than reformat.
Version 1.8 introduced the flag as default for newly created ext4 filesystems, independant of the size. However the current resize2fs tool in Debian Wheezy cannot handle the flag for expanding the size. To overcome this a newer version of e2fsprogs is necessary. For avoiding recompiling the package, you can boot systemrescuecd and perform the expansion using gparted.
The default :command:`mkfs.ext4` of Debian Wheezy does not use the 64bit flag for filesystems under 16TB, this is a serious problem since RAID arrays without that flag won't be able to expand and there is no workaround more than reformat.
Version 1.8 introduced the flag as default for newly created ext4 filesystems, independent of the size. However the current :command:`resize2fs` tool in Debian Wheezy cannot handle the flag for expanding the size. To overcome this a newer version of e2fsprogs is necessary. For avoiding recompiling the package, you can boot systemrescuecd and perform the expansion using gparted.

Delete
The delete button actually deletes filesystems, using :command:`wipefs -a`. This will flush filesystem, raid or partition-table signatures (magic strings). Be careful using this. The button is disabled until the filesystem is actually unmounted.

Unmount
Disabled until you have deleted all shared folders asociated with that volume. Unmount will remove the entry from config.xml and /etc/fstab.
Disabled until you have deleted all shared folders associated with that volume. Unmount will remove the entry from ``config.xml`` and ``/etc/fstab``.

Supported Filesystems
|omv| supports the following filesystems that can be mounted through the |webui|:
Expand Down
2 changes: 1 addition & 1 deletion administration/storage/raid.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
RAID
####

|omv| uses linux software RAID driver (MD) and the mdadm utility to create arrays [1]_. Arrays created in any other linux distro should be recognized inmmediatly by the server. In most cases you can skip to the filesystem array and proceed to mount to integrate the filesystem into the database.
|omv| uses linux software RAID driver (MD) and the mdadm utility to create arrays [1]_. Arrays created in any other linux distro should be recognized immediately by the server. In most cases you can skip to the filesystem array and proceed to mount to integrate the filesystem into the database.

Overview
--------
Expand Down
4 changes: 2 additions & 2 deletions administration/storage/smart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Smartmontools is configured in this file :file:`/etc/smartd.conf`.

The information button displays several tabs which provide friendly parsed information about the drive. The last tab has all the information in raw text.

The grid columns shows different identification values for the drive, the last one (Status) reports a green icon if drive is in good condition or red if drive needs some attention, if you hover on the icon a tooltup that will report more details. The code that reports the red icon is based on this function `here <https://github.com/openmediavault/openmediavault/blob/9ddc8b66f3f666987157a0e7b84d57e7c10f9ba4/deb/openmediavault/usr/share/php/openmediavault/system/storage/smartinformation.inc#L93-L98>`_ and `here <https://github.com/openmediavault/openmediavault/blob/9ddc8b66f3f666987157a0e7b84d57e7c10f9ba4/deb/openmediavault/usr/share/php/openmediavault/system/storage/smartinformation.inc#L235-L262>`_, so basically the red icon will be triggered only on attributes with the prefailure (P) flag when:
The grid columns shows different identification values for the drive, the last one (Status) reports a green icon if drive is in good condition or red if drive needs some attention, if you hover on the icon a tooltip that will report more details. The code that reports the red icon is based on this function `here <https://github.com/openmediavault/openmediavault/blob/9ddc8b66f3f666987157a0e7b84d57e7c10f9ba4/deb/openmediavault/usr/share/php/openmediavault/system/storage/smartinformation.inc#L93-L98>`_ and `here <https://github.com/openmediavault/openmediavault/blob/9ddc8b66f3f666987157a0e7b84d57e7c10f9ba4/deb/openmediavault/usr/share/php/openmediavault/system/storage/smartinformation.inc#L235-L262>`_, so basically the red icon will be triggered only on attributes with the prefailure (P) flag when:

- Any attribute (P) current value is equal or less than threshold --> Bad attribute now

Expand All @@ -46,7 +46,7 @@ Gives an option to select four different scheduled tests:

These tests and what they do are explained `here <https://www.smartmontools.org/wiki/TocDoc#SMARTTesting>`_ and `here <https://www.thomas-krenn.com/en/wiki/SMART_tests_with_smartctl#Long_Test>`_.

SMART only realloactes a bad sector on write. A manual method to force reallocating the pending(s) sector(s) is decribed `here <https://www.thomas-krenn.com/en/wiki/Analyzing_a_Faulty_Hard_Disk_using_Smartctl>`_.
SMART only reallocates a bad sector on write. A manual method to force reallocating the pending(s) sector(s) is described `here <https://www.thomas-krenn.com/en/wiki/Analyzing_a_Faulty_Hard_Disk_using_Smartctl>`_.

.. [1] https://www.backblaze.com/blog/what-smart-stats-indicate-hard-drive-failures/
.. [2] https://www.smartmontools.org/
Expand Down
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,4 @@
# Adding Custom CSS or JavaScript.
# http://docs.readthedocs.io/en/latest/guides/adding-custom-css.html
def setup(app):
app.add_stylesheet('openmediavault.css')
app.add_css_file('openmediavault.css')
12 changes: 6 additions & 6 deletions development/internaltools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Most users tend to access/modify the database by using nano::

$ nano /etc/openmediavault/config.xml

This is a problem as sometimes a wrong pressed key can add strange chars out of the xml tags and make the database unreadable by the backend.
This is a problem as sometimes a wrong pressed key can add strange chars out of the xml tags and make the database unreadable by the backend.

omv-confdbadm is a tool written in python for retrieving, storing or deleting values from/to the database. This tool combined with jq [1]_ provides an easier method for interacting with the database using Shell/BASH.

Expand Down Expand Up @@ -104,14 +104,14 @@ Output returns:
}
**Write:** This tool can also modify values in the database.
**Write:** This tool can also modify values in the database.

Add the noexec flag to this filesystem object ``567c2bd4-3d82-45b2-b34b-a6d38e680ed3``, we need to pass the whole json object as argument::
Add the `noexec` flag to this filesystem object ``567c2bd4-3d82-45b2-b34b-a6d38e680ed3``, we need to pass the whole json object as argument::

# omv-confdbadm update conf.system.filesystem.mountpoint '{"freq":0,"hidden":false,"passno":2,"opts":"defaults,noexec,noauto,user_xattr,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl","dir":"/media/dev-disk-by-label-ironwolf_3TB_1","uuid":"567c2bd4-3d82-45b2-b34b-a6d38e680ed3","fsname":"/dev/disk/by-label/ironwolf_3TB_1","type":"ext4"}'


Remove a filesystem from the database, this time we pass only the corresponing uuid of the object::
Remove a filesystem from the database, this time we pass only the corresponding uuid of the object::

# omv-confdbadm delete --uuid 567c2bd4-3d82-45b2-b34b-a6d38e680ed3 conf.system.filesystem.mountpoint

Expand All @@ -123,7 +123,7 @@ This tool can execute rpc commands. This is identical of what the web frontend u

**Example 1:** Get all mounted filesystems, including rootfs::

# omv-rpc -u admin 'FileSystemMgmt' 'enumerateMountedFilesystems' '{"includeroot": true}'
# omv-rpc -u admin 'FileSystemMgmt' 'enumerateMountedFilesystems' '{"includeroot": true}'

Output returns:

Expand Down Expand Up @@ -259,7 +259,7 @@ helper-functions (Shell)


|omv| ships with this file :file:`/usr/share/openmediavault/scripts/helper-functions` that contains several POSIX shell functions. These are intended to make it easier for developers to create mkconf or postinst/postrm scripts. To test them just run in terminal::

$ source /usr/share/openmediavault/scripts/helper-functions

Type ``omv_``, press tab key to autocomplete, this will show all functions and a small description in the name.
Expand Down

0 comments on commit 566d251

Please sign in to comment.