summaryrefslogtreecommitdiffstats
path: root/core/modules/hardware-stats
diff options
context:
space:
mode:
authorSimon Rettberg2019-02-28 12:31:05 +0100
committerSimon Rettberg2019-02-28 12:31:05 +0100
commit9d618470521325b11ac21a96104876136f96df45 (patch)
treec27af3eab2cbdef3a79e1c73b0352cdb449182e6 /core/modules/hardware-stats
parent[beamergui] Remove old unused script (diff)
downloadmltk-9d618470521325b11ac21a96104876136f96df45.tar.gz
mltk-9d618470521325b11ac21a96104876136f96df45.tar.xz
mltk-9d618470521325b11ac21a96104876136f96df45.zip
[hardware-stats] Fiddle with service file again
Diffstat (limited to 'core/modules/hardware-stats')
-rw-r--r--core/modules/hardware-stats/data/etc/systemd/system/shutdown-usage-log.service4
-rwxr-xr-xcore/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats2
2 files changed, 5 insertions, 1 deletions
diff --git a/core/modules/hardware-stats/data/etc/systemd/system/shutdown-usage-log.service b/core/modules/hardware-stats/data/etc/systemd/system/shutdown-usage-log.service
index e91c6db6..7143a597 100644
--- a/core/modules/hardware-stats/data/etc/systemd/system/shutdown-usage-log.service
+++ b/core/modules/hardware-stats/data/etc/systemd/system/shutdown-usage-log.service
@@ -2,11 +2,13 @@
Description=Tell server we're shutting down
DefaultDependencies=no
Before=shutdown.target
+Requires=network-online.target
After=-.mount network-online.target
RefuseManualStart=yes
[Service]
Type=oneshot
-ExecStart=/opt/openslx/scripts/shutdown-system_usage_update
+ExecStartPre=/opt/openslx/scripts/shutdown-system_usage_update
+ExecStart=/bin/true
RemainAfterExit=yes
diff --git a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
index 76adb3d4..55c9dfa8 100755
--- a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
+++ b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
@@ -361,6 +361,8 @@ if curl --retry 4 --retry-connrefused \
touch "/etc/cron.d" # Sometimes, aufs doesn't update the mtime of dirs when creating files,
# so cron would not rescan the cron directory
cleanup
+ # Trigger right now so resource usage gets updated
+ /opt/openslx/scripts/cron-system_usage_update
exit 0
else
echo "Failed..."