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

openmediavault-rrdtoolgraph in cronjob even no omv is installed #2994

Closed
0x9394 opened this issue Jul 19, 2019 · 4 comments
Closed

openmediavault-rrdtoolgraph in cronjob even no omv is installed #2994

0x9394 opened this issue Jul 19, 2019 · 4 comments
Labels
Milestone

Comments

@0x9394
Copy link

0x9394 commented Jul 19, 2019

Creating a bug report/issue

openmediavault-rrdtoolgraph in cronjob even no omv is installed. (never run omv or install command)

Required Information

  • DietPi version | cat /DietPi/dietpi/.version
#!/bin/bash
G_DIETPI_VERSION_CORE=6
G_DIETPI_VERSION_SUB=25
G_DIETPI_VERSION_RC=3
G_GITBRANCH='master'
G_GITOWNER='Fourdee'
  • Distro version | echo $G_DISTRO_NAME or cat /etc/debian_version
    9.9
  • Kernel version | uname -a
    Linux DietPi 4.14.0 v94 #82 SMP Fri Dec 8 14:33:14 CST 2017 aarch64 GNU/Linux
  • SBC device | echo $G_HW_MODEL_DESCRIPTION or (EG: RPi3)
    NanoPi NEO 2 (aarch64)

Additional Information (if applicable)

  • Can this issue be replicated on a fresh installation of DietPi?
    Yes, have nano pi neo2 SBC, both have same job.

Steps to reproduce

root@DietPi:/etc/cron.d# cat openmediavault-rrdtoolgraph 
# Create graphs every 15 minutes
# m h dom mon dow user    command
*/15 * * * * root /usr/sbin/omv-mkgraph >/dev/null 2>&1

Expected behaviour

  • remove openmediavault-rrdtoolgraph from /etc/cron.d/ in source image, coz omv is not pre-installed & is not supported in dietpi.
    I'v remove it manuualy.

Actual behaviour

root@DietPi:/etc/cron.d# cat openmediavault-rrdtoolgraph 
# Create graphs every 15 minutes
# m h dom mon dow user    command
*/15 * * * * root /usr/sbin/omv-mkgraph >/dev/null 2>&1
root@DietPi:/etc/cron.d# journalctl | grep omv
Jul 16 21:30:01 DietPi CRON[2612]: (root) CMD (/usr/sbin/omv-mkgraph >/dev/null 2>&1)
Jul 16 21:45:01 DietPi CRON[3310]: (root) CMD (/usr/sbin/omv-mkgraph >/dev/null 2>&1)
Jul 16 22:00:01 DietPi CRON[4015]: (root) CMD (/usr/sbin/omv-mkgraph >/dev/null 2>&1)
Jul 16 22:15:01 DietPi CRON[4748]: (root) CMD (/usr/sbin/omv-mkgraph >/dev/null 2>&1)
Jul 16 22:30:01 DietPi CRON[5445]: (root) CMD (/usr/sbin/omv-mkgraph >/dev/null 2>&1)

Extra details

  • ...
@MichaIng
Copy link
Owner

@kt1024
Many thanks for your report.

Looks like a missed leftover from the pre-image we used. I will add a patch with v6.26 to remove this cron job if the related binary is not available.

@MichaIng
Copy link
Owner

MichaIng commented Jul 21, 2019

Okay resolved:

  • For new images:
    # - OMV: https://github.com/MichaIng/DietPi/issues/2994
    rm -f /etc/cron.*/openmediavault*
    rm -f /usr/sbin/omv-*
  • For existing systems:

    DietPi/dietpi/patch_file

    Lines 2085 to 2087 in bd2f262

    # Remove possible OpenMediaVault leftovers, that are not part of current OMV packages, thus save to remove: https://github.com/MichaIng/DietPi/issues/2994
    [[ -f '/etc/cron.d/openmediavault-rrdtoolgraph' ]] && rm /etc/cron.d/openmediavault-rrdtoolgraph
    [[ -f '/usr/sbin/omv-mkgraph' ]] && rm /usr/sbin/omv-mkgraph
  • Changelog:
    - General | Removed an obsolete OpenMediaVault cron job and binary that was leftover on at least one of our images (NanoPi NEO2) and is not part of the current OMV packages, thus save to remove in every case. Many thanks to @kt1024 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2994

The reason why they are not removed is that they are not part of the current OMV packages anymore: https://packages.openmediavault.org/public/pool/main/o/openmediavault/openmediavault_5.0.4-1_all.deb

  • The binary got renamed and the cron job probably replaced by a web UI trigger, as it was responsible to update a web UI graphic.
  • No idea why those were not removed by upgrading the packages or left on the image at all, however v6.26 will solve it on all images.

Very good find, many thanks for reporting 👍!

@MichaIng MichaIng added the Solution available 🥂 Definite solution has been done label Jul 21, 2019
@MichaIng MichaIng added this to the v6.26 milestone Jul 21, 2019
@0x9394
Copy link
Author

0x9394 commented Jul 24, 2019

found 2 user may be should not be created by default, in /etc/passwd

openmediavault-webgui:x:999:997:openmediavault WebGUI Management:/home/openmediavault-webgui:/usr/sbin/nologin admin:x:998:100:openmediavault WebGUI Administrator:/home/admin:/usr/sbin/nologin

@MichaIng
Copy link
Owner

MichaIng commented Jul 24, 2019

@kt1024
Another good spot, they will be removed as well.

Long story short, OMV images are no good basis for DietPi, I guess it is hard so find some since FriendlyELEC ships the Ubuntu-based FriendlyCore. Perhaps OMV is included in their NAS image (http://download.friendlyarm.com/nanopineo2), not sure. Just found ARMbian as another alternative, which comes with Buster + Linux 4.19.

I found some other related users and groups. To remove them all:

getent passwd openmediavault-webgui &> /dev/null && userdel -f openmediavault-webgui # OMV (NanoPi NEO2)
getent passwd admin &> /dev/null && userdel -f admin # OMV (NanoPi NEO2)
getent passwd fa &> /dev/null && userdel -f fa # OMV (NanoPi NEO2)
getent passwd colord &> /dev/null && userdel -f colord # OMV (NanoPi NEO2)
getent passwd saned &> /dev/null && userdel -f saned # OMV (NanoPi NEO2)
getent group openmediavault-config &> /dev/null && groupdel openmediavault-config # OMV (NanoPi NEO2)
getent group openmediavault-engined &> /dev/null && groupdel openmediavault-engined # OMV (NanoPi NEO2)
getent group openmediavault-webgui &> /dev/null && groupdel openmediavault-webgui # OMV (NanoPi NEO2)

and a directory:

[[ -d '/etc/openmediavault' ]] && rm -R /etc/openmediavault

Added removal of above to preparation script: 12e55c9

MichaIng added a commit that referenced this issue Jul 24, 2019
+ DietPi-PREP | Remove additional users, groups and dirs, found on current NanoPi NEO2 image with OMV remains: #2994 (comment)
@MichaIng MichaIng closed this as completed Sep 2, 2019
@MichaIng MichaIng mentioned this issue Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants