diff options
Diffstat (limited to 'linhes/linhes-system')
-rwxr-xr-x | linhes/linhes-system/PKGBUILD | 91 | ||||
-rwxr-xr-x | linhes/linhes-system/balance_storage_groups.py | 2 | ||||
-rwxr-xr-x | linhes/linhes-system/empty_storage_groups.py | 4 | ||||
-rwxr-xr-x | linhes/linhes-system/lh_apply_UI_settings.sh | 26 | ||||
-rw-r--r-- | linhes/linhes-system/lh_mtc.cron | 24 | ||||
-rwxr-xr-x | linhes/linhes-system/lh_myth_status.py | 72 | ||||
-rwxr-xr-x | linhes/linhes-system/lh_notify-send | 19 | ||||
-rwxr-xr-x | linhes/linhes-system/lh_restart_needed.sh | 2 | ||||
-rw-r--r-- | linhes/linhes-system/lh_sqlserver.cnf | 15 | ||||
-rwxr-xr-x | linhes/linhes-system/lh_system_start.sh | 14 | ||||
-rwxr-xr-x | linhes/linhes-system/pacman_orphans.cron | 1 |
11 files changed, 111 insertions, 159 deletions
diff --git a/linhes/linhes-system/PKGBUILD b/linhes/linhes-system/PKGBUILD index 8e5b326..32dc6df 100755 --- a/linhes/linhes-system/PKGBUILD +++ b/linhes/linhes-system/PKGBUILD @@ -1,14 +1,15 @@ pkgname=linhes-system pkgver=9.0.0 -pkgrel=79 +pkgrel=94 arch=('x86_64') #install=$pkgname.install pkgdesc="Everything that makes LinHES a system" license=('GPL2') depends=('cronie' 'dbus-python' 'dvb-firmware' 'expect' 'flatpak' 'firefox' 'glances' 'inetutils' - 'kdialog' 'libnotify' - 'logrotate' 'linhes-templates' 'linhes-theme' 'mlocate' 'ncdu' 'python-dateutil' 'python-pytz' - 'python-tzlocal' 'openssh' 'pacman-contrib' 'rsyslog' 'ttf-overlock' 'wget' 'x11vnc' + 'kdialog' 'kwalletmanager' 'libnotify' + 'logrotate' 'linhes-templates' 'linhes-theme' 'mlocate' 'moreutils' 'ncdu' 'pacman-contrib' + 'plasma-x11-session' 'python-dateutil' 'python-pytz' 'python-tzlocal' 'openssh' + 'rsyslog' 'ttf-overlock' 'wget' 'x11vnc' 'intel-media-driver' 'libva-intel-driver' 'pigz') binfiles="add_storage.py balance_storage_groups.py empty_storage_groups.py remove_storage.py checkXFSfrag.sh enableIRWake.sh idle.py lh_system_start.sh lh_notify-send @@ -20,34 +21,34 @@ binfiles="add_storage.py balance_storage_groups.py empty_storage_groups.py remov create_media_dirs.sh be_check.py myth2mkv myth2mp3 myth2videos udev_link.sh" source=($binfiles - 'lh_mtc.cron' 'paccache.cron' 'flatpak_update.cron' 'xfs_defrag.cron' + 'lh_mtc.cron' 'paccache.cron' 'flatpak_update.cron' 'xfs_defrag.cron' 'pacman_orphans.cron' 'readme_is_xml' 'add_storage.readme' 'LinHES-release' 'lh_log_care.cron' '79-cronie.hook' 'fstrim.hook' 'openssh.hook' 'plex_lib.conf' 'rsyslog.hook' '10-monitor.conf' '81-wol.rules' 'x11vnc.override.conf' 'lh_lighttpd.conf' 'lh_php.ini' 'system-sudo.rules' 'linhes-profile.sh' 'lh_sqlserver.cnf' 'lh_restart_needed.hook' 'lh_system_start.sh.desktop' 'rc6_mce.toml' 'recordings.cron' 'rsyslog.mythtv.conf') sha256sums=('e6eaa2fb4819fa60cb05b4d2e7328d2914af3a73028a735ec4d56e7ece33ecc0' - '1115809a2d80c1ead7cfc5df05e1d6427255912a8303594574b3be23d3d3e4f1' - '97fe9e851c782fa9f85c5b69b110ccff2817dd4fa2a6d9ff6ee225dc558677e4' + '8ae6de3d0ff8e777aeea56f74f38676080142148ac3a32f828462d85c39e7cf7' + 'bf72f364dfd6a694774ae0c998a737bf551057a2b3b427f58418854d3e9c785b' 'ff261f41efec8a9963f9f59100cbe75f015028a2ed3a863ce0cb473f2ebb7b76' '8b54c31b8efde3917f603c5307bebb0a2a00239ad9a983c2f5d8120003256449' 'ae34515e144830f424d3bd3f6b1b446892d62beed20bca6f0fb19b0bbb779f27' '9e52a21e9d0f3f993b819587256a1cd57dca04451d5f2d0fd76667b1d3f860f1' - '3db3620b3430d1e8031596efa9eb50dea7f4c1b837c37929c3743c1eb65ac666' - '6d4fb0ed1a5ed961b3a3884dce093118e50c2981a9cd5837d20abc5a6d4fd8aa' + 'fbd1640106b3d9356452625753a6f1974e0be905b9f4732a1287b3905806cba8' + '1c36e4fdf41c1063e0a127ce4a90fbdef19879c381a87f622d7399ca931560cc' '87875d9e5f5ce18208f419698ce69b6bcbcd08955a57a4a13940e715af58b787' - '93d664f4a46fda05d0f754d19df40cbda120e325b80c07092345b14763993833' + '192bfff1b8d46e0ebb969618847d9993aba3b1b578053c8d701dad9f9e758f86' 'a523388ffdc6f30f2dd2ef4803b21bded8a35bfded499dc66b786adec71840a3' '6ea7f807a29631e33629da14e7ca6481310f0416c5d6f8fb415a76fa90fb9b76' '91bdec992bb2c933e15625c181f2195c402060b879168ebf35944cb064c904b9' '5cacfdd02833e5a3130d765573e772e6bd5030336ba86239c5e4db5ffa36fc69' 'd51253c207d3315997d7122cb774c6d0fc38975c33e66bf416f0b1b95cf86e5b' - '52eef974c7e530d60799ee2b2c67cedc3e0c4d58948f021a609c20cfedd2056e' + 'f3d65c821ccddb5305e4338ce3fa7072d04d0af394d8061234bbac529a6b9abd' 'ebdb3ee0212e0cc72526bb5e50a032573e1894acb7bf75617243b0b49aa1f8f2' 'cd3306991c8b63f5402c0e52405cc1a6581cb3c42af74b7c2f879c8192f95610' 'e371c6a289c68fe200d7da856c20a8c579efa23178f4d62235f7359d7f6e49a1' 'ee9a4df83e463e0c8a2e862680a83cff07a36cf3606faf60f57bc11190ffb1c9' - 'be52026eee470d70dcbf3ab364ef8ec92155b7990f589526928d46873cc72cdf' + 'f051f5111238f6f391108e68071ab02f200cfc6c4d2e34ae98f7a29057dbdf75' 'd2d69b2bf6315bd37ff5f5b2f0cde8ab2fb89bae18f8796dc5208ffc1a9d743e' 'a745356952470a5d718bef1961309ea30e4fa6a2860961cd52e09d6ec11e708e' '1819085bd2c9106482c5f243b95fddf3dae69212330ab76cb493add5c26a45a4' @@ -60,10 +61,11 @@ sha256sums=('e6eaa2fb4819fa60cb05b4d2e7328d2914af3a73028a735ec4d56e7ece33ecc0' 'a961cfdc6f02b12fb445777dd2c144fed96306ca2f430cc8853ae307c759c1ad' 'd8574104b75c6d41284488612ec5583c50a8dab438492fa42c47231add4cfc54' '6bdbf593d3e1348d1a8f7c4c17cb2e893f7e18ae355daf978173e669cfe3be80' - 'b3f02ec3f8cedc98c74b3169049b7b6aa78bd79d558a8bc98d00e064b983965c' + 'bc6b23e799f22fa16cfc37a91a5f06503beb80db3eeb420c766f7b3d41ba8356' '186203d3c0520bb3d611da99d33a7713e9c1563814285f1f101097234f214b2f' 'd8d36a501928d0cc505957d392291fad317b1e895ff99847d90643cf5f622a89' 'cdfc0c836b8194f631f4a9e022c232ff75a13ff1a161a1a011858578bea5f930' + '14c9e1e84a3f9ca182f3d848bd011c57d5332f9106eafcad74fc8cf8f97ef3d3' '5f502b1bc8815d69c802320790745e4526d5817fd8ecc7b00cf8b16078f8d440' '12e424432bdf2d50afe3e632c018fef847e860a35a53525eccbe656b9c4118aa' 'ee745056d018f860572f8363ed5e730ba501394c23cdd6f316719d7141c10050' @@ -80,7 +82,7 @@ sha256sums=('e6eaa2fb4819fa60cb05b4d2e7328d2914af3a73028a735ec4d56e7ece33ecc0' 'dae799f09a076e0f573ea516bc357f56f2fd3aa8e35ec0cf54b6b62282960ee0' 'aa1d831f25317a9cb8d7e9a7d7b6d51c8d03bd5b69f3bec27bea7644ca38fe9a' 'cf884bad5caab9d5901b88b0ef41e3a39ea0b7a4614b8d14707d79941c899cbf' - '3ed91fb5a7894f82fb4895e06d2e3f1df3ac4f82e46c970d4a85aaa4edc24cf1' + '01416dadeb34ca8b18bb7326113672b3888b16a60133d501d48610d23b74d1eb' '197ff4bb3c1cafcb197268cac335f1f75ae26873aca5833d62cc51fade85176c' '0b9868a563036c81f8fdb8ab8bbad51934aca2a07e9d7634e24214791afda8e2' '1b965b5e7eeafdf3815c8f2722587a560693dd780327cca9910dc47fba0f1aef' @@ -88,12 +90,12 @@ sha256sums=('e6eaa2fb4819fa60cb05b4d2e7328d2914af3a73028a735ec4d56e7ece33ecc0' '2b91f6eb8c010a0dce1f41149c0549d067915fba93251c7af7e5328a05977f0c') package() { - cd $srcdir + cd ${srcdir} - install -m755 -D linhes-profile.sh $pkgdir/etc/profile.d/linhes-profile.sh + install -m755 -D linhes-profile.sh ${pkgdir}/etc/profile.d/linhes-profile.sh #bin files - BINDIR=$pkgdir/usr/bin + BINDIR=${pkgdir}/usr/bin for i in $binfiles do item=$i @@ -102,60 +104,61 @@ package() { done #release files - install -Dm644 "$srcdir/LinHES-release" "$pkgdir/etc/LinHES-release" + install -Dm644 "${srcdir}/LinHES-release" "${pkgdir}/etc/LinHES-release" #startup files - install -Dm644 "$srcdir/lh_system_start.sh.desktop" "$pkgdir/etc/skel/.config/autostart/lh_system_start.sh.desktop" + install -Dm644 "${srcdir}/lh_system_start.sh.desktop" "${pkgdir}/etc/skel/.config/autostart/lh_system_start.sh.desktop" #systemd files - install -Dm644 $srcdir/x11vnc.override.conf $pkgdir/etc/systemd/system/x11vnc.service.d/override.conf + install -Dm644 ${srcdir}/x11vnc.override.conf ${pkgdir}/etc/systemd/system/x11vnc.service.d/override.conf #sql files - install -Dm644 $srcdir/lh_sqlserver.cnf $pkgdir/etc/my.cnf.d/lh_sqlserver.cnf + install -Dm644 ${srcdir}/lh_sqlserver.cnf ${pkgdir}/etc/my.cnf.d/lh_sqlserver.cnf #php files - install -Dm644 $srcdir/lh_php.ini $pkgdir/etc/php/conf.d/lh_php.ini + install -Dm644 ${srcdir}/lh_php.ini ${pkgdir}/etc/php/conf.d/lh_php.ini #lighttpd files - install -Dm644 $srcdir/lh_lighttpd.conf $pkgdir/etc/lighttpd/conf.d/lh_lighttpd.conf + install -Dm644 ${srcdir}/lh_lighttpd.conf ${pkgdir}/etc/lighttpd/conf.d/lh_lighttpd.conf #gen_lib_xml.py files install -Dm644 ${srcdir}/plex_lib.conf ${pkgdir}/etc/gen_lib_xml.d/plex_lib.conf #rsyslog files - install -Dm644 $srcdir/rsyslog.mythtv.conf $pkgdir/etc/rsyslog.d/mythtv.conf + install -Dm644 ${srcdir}/rsyslog.mythtv.conf ${pkgdir}/etc/rsyslog.d/mythtv.conf #remote files - install -Dm644 $srcdir/rc6_mce.toml $pkgdir/etc/rc_keymaps/rc6_mce.toml + install -Dm644 ${srcdir}/rc6_mce.toml ${pkgdir}/etc/rc_keymaps/rc6_mce.toml #readme files - install -Dm644 $srcdir/readme_is_xml $pkgdir/etc/gen_is_xml.d/readme_is_xml - install -Dm644 $srcdir/readme_is_xml $pkgdir/etc/gen_lib_xml.d/readme_gen_xml - install -Dm644 $srcdir/readme_is_xml $pkgdir/etc/gen_game_xml.d/readme_gen_xml - install -Dm644 $srcdir/add_storage.readme $pkgdir/etc/storage.d/readme + install -Dm644 ${srcdir}/readme_is_xml ${pkgdir}/etc/gen_is_xml.d/readme_is_xml + install -Dm644 ${srcdir}/readme_is_xml ${pkgdir}/etc/gen_lib_xml.d/readme_gen_xml + install -Dm644 ${srcdir}/readme_is_xml ${pkgdir}/etc/gen_game_xml.d/readme_gen_xml + install -Dm644 ${srcdir}/add_storage.readme ${pkgdir}/etc/storage.d/readme #cron files - install -Dm755 $srcdir/paccache.cron $pkgdir/etc/cron.weekly/paccache - install -Dm755 $srcdir/xfs_defrag.cron $pkgdir/etc/cron.weekly/xfs_defrag - install -Dm755 $srcdir/lh_mtc.cron $pkgdir/etc/cron.hourly/lh_mtc - install -Dm755 $srcdir/flatpak_update.cron $pkgdir/etc/cron.daily/flatpak_update - install -Dm755 $srcdir/lh_log_care.cron $pkgdir/etc/cron.daily/lh_log_care - install -Dm755 $srcdir/recordings.cron $pkgdir/etc/cron.hourly/recordings + install -Dm755 ${srcdir}/paccache.cron ${pkgdir}/etc/cron.weekly/paccache + install -Dm755 ${srcdir}/pacman_orphans.cron ${pkgdir}/etc/cron.weekly/pacman_orphans + install -Dm755 ${srcdir}/xfs_defrag.cron ${pkgdir}/etc/cron.weekly/xfs_defrag + install -Dm755 ${srcdir}/lh_mtc.cron ${pkgdir}/etc/cron.hourly/lh_mtc + install -Dm755 ${srcdir}/flatpak_update.cron ${pkgdir}/etc/cron.daily/flatpak_update + install -Dm755 ${srcdir}/lh_log_care.cron ${pkgdir}/etc/cron.daily/lh_log_care + install -Dm755 ${srcdir}/recordings.cron ${pkgdir}/etc/cron.hourly/recordings #hooks - install -Dm0644 $srcdir/79-cronie.hook "${pkgdir}"/usr/share/libalpm/hooks/79-cronie.hook - install -Dm0644 $srcdir/fstrim.hook "${pkgdir}"/usr/share/libalpm/hooks/fstrim.hook - install -Dm0644 $srcdir/openssh.hook "${pkgdir}"/usr/share/libalpm/hooks/openssh.hook - install -Dm0644 $srcdir/lh_restart_needed.hook "${pkgdir}"/usr/share/libalpm/hooks/lh_restart_needed.hook - install -Dm0644 $srcdir/rsyslog.hook "${pkgdir}"/usr/share/libalpm/hooks/rsyslog.hook + install -Dm0644 ${srcdir}/79-cronie.hook "${pkgdir}"/usr/share/libalpm/hooks/79-cronie.hook + install -Dm0644 ${srcdir}/fstrim.hook "${pkgdir}"/usr/share/libalpm/hooks/fstrim.hook + install -Dm0644 ${srcdir}/openssh.hook "${pkgdir}"/usr/share/libalpm/hooks/openssh.hook + install -Dm0644 ${srcdir}/lh_restart_needed.hook "${pkgdir}"/usr/share/libalpm/hooks/lh_restart_needed.hook + install -Dm0644 ${srcdir}/rsyslog.hook "${pkgdir}"/usr/share/libalpm/hooks/rsyslog.hook #sudo rules - install -Dm0750 "$srcdir/system-sudo.rules" "$pkgdir/etc/sudoers.d/system_sudo" - chmod 750 $pkgdir/etc/sudoers.d/ + install -Dm0440 "${srcdir}/system-sudo.rules" "${pkgdir}/etc/sudoers.d/system_sudo" + chmod 750 ${pkgdir}/etc/sudoers.d/ #udev rules - install -Dm0644 "$srcdir/81-wol.rules" "$pkgdir/etc/udev/rules.d/81-wol.rules" + install -Dm0644 "${srcdir}/81-wol.rules" "${pkgdir}/etc/udev/rules.d/81-wol.rules" #disable dpms - install -Dm0644 "$srcdir/10-monitor.conf" "$pkgdir/etc/X11/xorg.conf.d/10-monitor.conf" + install -Dm0644 "${srcdir}/10-monitor.conf" "${pkgdir}/etc/X11/xorg.conf.d/10-monitor.conf" } diff --git a/linhes/linhes-system/balance_storage_groups.py b/linhes/linhes-system/balance_storage_groups.py index d91da60..8776428 100755 --- a/linhes/linhes-system/balance_storage_groups.py +++ b/linhes/linhes-system/balance_storage_groups.py @@ -89,7 +89,7 @@ if __name__ == '__main__': for dir in SGDIRSdata: mostFull = SGDIRSdata[i] i=i+1 - if len(glob.glob1(mostFull[0],"*.ts")) or len(glob.glob1(mostFull[0],"*.mpg")) or len(glob.glob1(mostFull[0],"*.nuv")): + if len(glob.glob(mostFull[0] + "*.ts")) or len(glob.glob(mostFull[0] + "*.mpg")) or len(glob.glob(mostFull[0] + "*.nuv")): break else: if i == 1: diff --git a/linhes/linhes-system/empty_storage_groups.py b/linhes/linhes-system/empty_storage_groups.py index 708c118..c181242 100755 --- a/linhes/linhes-system/empty_storage_groups.py +++ b/linhes/linhes-system/empty_storage_groups.py @@ -101,7 +101,7 @@ if __name__ == '__main__': print(" " + directory + " - Not Mounted") continue # Check if SG has data files to move - if len(glob.glob1(directory,"*.ts")) or len(glob.glob1(directory,"*.mpg")) or len(glob.glob1(directory,"*.nuv")) or len(glob.glob1(directory,"*.jpg")): + if len(glob.glob(directory + "*.ts")) or len(glob.glob(directory + "*.mpg")) or len(glob.glob(directory + "*.nuv")) or len(glob.glob(directory + "*.jpg")): freePcent = getFreePercentForDir(directory) freeSize = getFreeSpaceForDir(directory) SGDIRSdata.append([directory, freePcent, freeSize]) @@ -114,7 +114,7 @@ if __name__ == '__main__': sys.exit(0) # Exit if no SGs with data found - if SGcnt is 0: + if SGcnt == 0: print("\n'" + SGgrp + "' Storage Group directories have no files to move. Exiting.") sys.exit(0) diff --git a/linhes/linhes-system/lh_apply_UI_settings.sh b/linhes/linhes-system/lh_apply_UI_settings.sh index 2cf98a1..442a15f 100755 --- a/linhes/linhes-system/lh_apply_UI_settings.sh +++ b/linhes/linhes-system/lh_apply_UI_settings.sh @@ -1,18 +1,21 @@ #!/bin/bash -cp /usr/share/linhes/templates/plasma-org.kde.plasma.desktop-appletsrc ~/.config/ -plasma-apply-colorscheme BreezeDark -kwriteconfig5 --group KDE --key SingleClick false -kwriteconfig5 --file ~/.config/kscreenlockerrc --group Daemon --key Autolock false -kwriteconfig5 --file ~/.config/kscreenlockerrc --group Daemon --key LockOnResume false -kwriteconfig5 --file ~/.config/ksmserverrc --group General --key loginMode emptySession -kwriteconfig5 --file ~/.config/powermanagementprofilesrc --group AC --group DPMSControl --key idleTime --delete +if [ ! -f ~/.config/lh_configured ]; then + #cp /usr/share/linhes/templates/plasma-org.kde.plasma.desktop-appletsrc ~/.config/ + sed -i 's/launchers=.*/launchers=applications:systemsettings.desktop,preferred:\/\/filemanager,applications:org.kde.konsole.desktop,preferred:\/\/browser,applications:mythfrontend.desktop/' ~/.config/plasma-org.kde.plasma.desktop-appletsrc + plasma-apply-wallpaperimage /usr/share/linhes/templates/lights-bud-abstract-4k-cq.jpg + plasma-apply-colorscheme BreezeDark +fi + +kwriteconfig6 --group KDE --key SingleClick false +kwriteconfig6 --file ~/.config/kscreenlockerrc --group Daemon --key Autolock false +kwriteconfig6 --file ~/.config/kscreenlockerrc --group Daemon --key LockOnResume false +kwriteconfig6 --file ~/.config/ksmserverrc --group General --key loginMode emptySession +kwriteconfig6 --file ~/.config/powermanagementprofilesrc --group AC --group DPMSControl --key idleTime --delete kwriteconfig6 --file ~/.powerdevilrc --group AC --group Display --key DimDisplayWhenIdle false kwriteconfig6 --file ~/.powerdevilrc --group AC --group Display --key TurnOffDisplayWhenIdle false kwriteconfig6 --file ~/.powerdevilrc --group AC --group SuspendAndShutdown --key AutoSuspendAction 0 -plasma-apply-wallpaperimage /usr/share/linhes/templates/lights-bud-abstract-4k-cq.jpg - #sddm settings if grep -Fxq "User=km" /etc/sddm.conf.d/autologin.conf; then echo "Updating /etc/sddm.conf.d/autologin.conf" @@ -25,11 +28,10 @@ if [ -f "/etc/sddm.conf" ]; then sudo rm /etc/sddm.conf fi -if [ ! -f "/etc/sddm.conf.d/theme.conf" ]; then +if ! grep -Fxq "[General]" /etc/sddm.conf.d/theme.conf; then echo "[General]" | sudo tee /etc/sddm.conf.d/theme.conf echo "Numlock=on" | sudo tee -a /etc/sddm.conf.d/theme.conf - - echo "[Theme]" | sudo tee /etc/sddm.conf.d/theme.conf + echo "[Theme]" | sudo tee -a /etc/sddm.conf.d/theme.conf echo "Current=breeze" | sudo tee -a /etc/sddm.conf.d/theme.conf echo "CursorTheme=breeze_cursors" | sudo tee -a /etc/sddm.conf.d/theme.conf echo "Font=Noto Sans,10,-1,0,400,0,0,0,0,0,0,0,0,0,0,1" | sudo tee -a /etc/sddm.conf.d/theme.conf diff --git a/linhes/linhes-system/lh_mtc.cron b/linhes/linhes-system/lh_mtc.cron index b556d60..75610b5 100644 --- a/linhes/linhes-system/lh_mtc.cron +++ b/linhes/linhes-system/lh_mtc.cron @@ -32,11 +32,8 @@ then if ! grep -q "Finished Optimize" $logFile then - if [ $SystemType = FrontendOnly ] + if [ $SystemType = MasterBackend ] then - echo "Will not run Optimize on Frontend Only systems." | $log - echo "Finished Optimize" | $log - else sudo -u mythtv bash -c "MYTHCONFDIR=/usr/share/mythtv unbuffer lh_mtc.py --optimize | $log" if [ $? = 0 ] then @@ -45,18 +42,27 @@ then echo "Time Exceeded" | $log exit fi + else + echo "Will not run Optimize on Frontend or Desktop Only systems." | $log + echo "Finished Optimize" | $log fi fi if ! grep -q "Finished Backup" $logFile && grep -q "Finished Optimize" $logFile then - sudo -u mythtv bash -c "MYTHCONFDIR=/usr/share/mythtv unbuffer lh_mtc.py --backup | $log" - if [ $? = 0 ] + if [ $SystemType != DesktopOnly ] then - echo "" | $log + sudo -u mythtv bash -c "MYTHCONFDIR=/usr/share/mythtv unbuffer lh_mtc.py --backup | $log" + if [ $? = 0 ] + then + echo "" | $log + else + echo "Time Exceeded" | $log + exit + fi else - echo "Time Exceeded" | $log - exit + echo "Will not run Backup on Desktop Only systems." | $log + echo "Finished Backup" | $log fi fi diff --git a/linhes/linhes-system/lh_myth_status.py b/linhes/linhes-system/lh_myth_status.py index c682d1c..2ed3d42 100755 --- a/linhes/linhes-system/lh_myth_status.py +++ b/linhes/linhes-system/lh_myth_status.py @@ -1,12 +1,9 @@ #!/usr/bin/python #This program is called on login to display the status of mythtv tuners & recording status -#Also will display alerts generated by xymon. If the location of xymon changes, this script needs to be updated. from MythTV import MythBE,MythDB,MythLog import datetime,pytz,re,socket,subprocess,sys,time from dateutil.parser import parse -from tzlocal import get_localzone - import os,glob from socket import gethostname; @@ -41,69 +38,6 @@ def formatTD(td): return_string = '%s%s%s%s' % (day_string, hour_string, minute_string, second_string) return return_string -def print_alerts(): - dir_name = "/home/xymon/var/login_alerts" - out_alert="" - try: - os.chdir(dir_name) - except: - pass - #print " myth_status: Couldn't change dir to %s" %dir_name - - file_list=glob.glob("*") - - if len(file_list) == 0: - #print " myth_status: no alert files found" - pass - else: - for alert_file in file_list: - out_line='' - datahost = '' - dataservice = '' - datacolor = '' - datadown = '' - try: - #print " myth_staus: reading in %s" %alert_file - f=open(alert_file,'r') - lines=f.readlines() - f.close() - except: - #print " myth_status: Couldn't open %s for reading" %alert_file - continue - - for line in lines: - try: - data,value=line.split(":") - except: - continue #exception occured try the next line - - if data == 'HOST': - datahost = value.strip() - elif data == 'SERVICE': - dataservice = value.strip() - elif data == 'COLOR': - datacolor = value.strip() - elif data == 'DOWN': - datadown = value.strip() - sec=int(datadown) - td_sec = datetime.timedelta(seconds=sec) - td_sec_formated = formatTD(td_sec) - - out_line =" %s on %s %s for %s \n" %(dataservice, - datahost,datacolor.upper(), - td_sec_formated) - out_alert += out_line - - print("System Alerts:") - print("--------------") - if len(out_alert) > 0: - print(out_alert) - print(" Go to http://%s and click Health & Maintenance for more information." %gethostname()) - else: - print(" All systems OK") - - return - #------------------------------------------- @@ -112,7 +46,6 @@ class tuner_recording_status: def __init__ (self,num_upcoming): self.now = datetime.datetime.now(pytz.utc) - self.currTZ = get_localzone() self.farout=99999999 self.next_start_diff=datetime.timedelta(self.farout) self.num_upcoming=num_upcoming @@ -186,7 +119,7 @@ class tuner_recording_status: title_chan="%s (%s)" %(i.title, i.channame) # convert timezone to local timezone start_time=parse(str(i.starttime)) - start_time=start_time.astimezone(self.currTZ) + start_time=start_time.astimezone() start_time_out=start_time.strftime("%a %b %d %I:%M%p") self.upcoming_list.append([start_time_out,i.hostname, title_chan]) @@ -234,7 +167,7 @@ class tuner_recording_status: title_chan="%s (%s)" %(i.title, i.channame) # convert timezone to local timezone start_time=parse(str(i.starttime)) - start_time=start_time.astimezone(self.currTZ) + start_time=start_time.astimezone() start_time_out=start_time.strftime("%a %b %d %I:%M%p") out_line=(start_time_out,i.hostname,title_chan) self.conflict_list.append(out_line) @@ -264,7 +197,6 @@ def go(): tuner.print_upcoming_recordings() tuner.print_conflict_list() tuner.print_next_start_time() - #print_alerts() if __name__ == "__main__": diff --git a/linhes/linhes-system/lh_notify-send b/linhes/linhes-system/lh_notify-send index dd98ede..0a11de8 100755 --- a/linhes/linhes-system/lh_notify-send +++ b/linhes/linhes-system/lh_notify-send @@ -1,12 +1,19 @@ #!/bin/bash -#Detect the name of the display in use -display=":$(ls /tmp/.X11-unix/* | sed 's#/tmp/.X11-unix/X##' | head -n 1)" - -#Detect the user using such display -user=$(who | grep '('$display')' | awk '{print $1}' | head -n 1) +#Detect the name of the display in use from 0 to 10 +for i in {0..10}; +do + #Detect the user using such display + user=$(who | grep "(:${i})" | awk '{print $1}' | head -n 1) + if [[ ! -z "$user" ]]; + then + display="DISPLAY=:${i}" + break + fi +done #Detect the id of the user uid=$(id -u $user) -sudo -u $user DISPLAY=$display DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus notify-send "$@" + +sudo -u $user $display DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus notify-send "$@" diff --git a/linhes/linhes-system/lh_restart_needed.sh b/linhes/linhes-system/lh_restart_needed.sh index 2db8a2d..1355ff2 100755 --- a/linhes/linhes-system/lh_restart_needed.sh +++ b/linhes/linhes-system/lh_restart_needed.sh @@ -36,4 +36,4 @@ fi if [[ $rc == 1 ]]; then echo "No reboot needed." fi -exit $rc +exit 0 diff --git a/linhes/linhes-system/lh_sqlserver.cnf b/linhes/linhes-system/lh_sqlserver.cnf index be2d5bd..6475ea2 100644 --- a/linhes/linhes-system/lh_sqlserver.cnf +++ b/linhes/linhes-system/lh_sqlserver.cnf @@ -41,9 +41,10 @@ datadir=/data/srv/mysql skip-external-locking +skip-name-resolve=ON net_buffer_length = 8K -key_buffer_size = 768M +key_buffer_size = 512M max_allowed_packet = 1M tmp_table_size = 256M max_heap_table_size = 256M @@ -55,9 +56,10 @@ thread_cache_size = 8 query_cache_type = 0 query_cache_size = 0 query_cache_limit = 2M -join_buffer_size = 1M -ignore-db-dir = lost+found +join_buffer_size = 2M +ignore_db_dirs = lost+found table_open_cache = 5000 +table_definition_cache = 800 open_files_limit = 10000 # Uncomment the following if you are using InnoDB tables @@ -66,14 +68,13 @@ open_files_limit = 10000 #innodb_log_group_home_dir = /var/lib/mysql # You can set .._buffer_pool_size up to 50 - 80 % # of RAM but beware of setting memory usage too high -#innodb_buffer_pool_size = 16M +innodb_buffer_pool_size = 1500M #innodb_additional_mem_pool_size = 2M # Set .._log_file_size to 25 % of buffer pool size -innodb_log_file_size = 16M -#innodb_log_buffer_size = 8M +innodb_log_file_size = 375M +innodb_log_buffer_size = 32M #innodb_flush_log_at_trx_commit = 1 #innodb_lock_wait_timeout = 50 -innodb_buffer_pool_instances = 1 # This group is only read by MariaDB-10.8 servers. # If you use the same .cnf file for MariaDB of different versions, diff --git a/linhes/linhes-system/lh_system_start.sh b/linhes/linhes-system/lh_system_start.sh index 3cbf5dc..d1bd2b9 100755 --- a/linhes/linhes-system/lh_system_start.sh +++ b/linhes/linhes-system/lh_system_start.sh @@ -55,15 +55,15 @@ function install_lh_apps(){ #check network connection netwait=0 while ! timeout 1 nc -zw1 1.1.1.1 443; do - [ $netwait -gt 12 ] && msg "Could not install apps. Check internet connection. Cancelling Setup." && exit 1 - msg "Waiting for internet connectivity..." + 1 [ $netwait -gt 60 ] && msg "Cancelling Setup" "Could not connect to the internet to complete setup. Check the internet connection and from Konsole run lh_system_start.sh." && exit 1 + msg "Waiting for internet connectivity..." "Connect to the internet to complete setup." ((netwait++)) sleep 5 done msg "Installing apps." konsole -e /bin/bash -i -c "sudo pacman -Syyy --noconfirm archlinux-keyring && sudo pacman -Syyy --noconfirm mythtv mythplugins-mytharchive mythplugins-mythmusic mythplugins-mythweb && flatpak install tv.plex.PlexHTPC --noninteractive --assumeyes && sudo flatpak override tv.plex.PlexHTPC --filesystem=/run/lirc/lircd" status=$? - [ $status -eq 1 ] && msg "Could not install apps. Check internet connection. Cancelling Setup." && exit 1 + [ $status -eq 1 ] && msg "Cancelling Setup" "Could not connect to the internet to complete setup. Check the internet connection and from Konsole run lh_system_start.sh." && exit 1 gen_lib_xml.py } @@ -88,16 +88,16 @@ function localweb_setup(){ function first_configure(){ if [ ! -f ~/.config/lh_configured ]; then msg "New install of LinHES. Starting setup." - install_lh_apps - nanorc_setup - bashrc_setup - x11vnc_setup if [ -f /etc/systemconfig ]; then SystemType=$(grep SystemType= /etc/systemconfig | cut -d '"' -f 2) else SystemType=$(kdialog --title "LinHES System Type" --combobox "Select the LinHES System Type: " "MasterBackend" "FrontendOnly" "DesktopOnly" --default "MasterBackend") echo "SystemType=\"$SystemType\"" | sudo tee /etc/systemconfig fi + install_lh_apps + nanorc_setup + bashrc_setup + x11vnc_setup #apply settings for specific system types msg "Setup as $SystemType" if [ $SystemType = "MasterBackend" ]; then diff --git a/linhes/linhes-system/pacman_orphans.cron b/linhes/linhes-system/pacman_orphans.cron new file mode 100755 index 0000000..6ef9d4c --- /dev/null +++ b/linhes/linhes-system/pacman_orphans.cron @@ -0,0 +1 @@ +pacman -Qdtq | ifne pacman -Rns --noconfirm - |