aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore11
-rw-r--r--Makefile1
-rwxr-xr-xdata/scripts/sync-stats2
-rw-r--r--debian/changelog14
-rw-r--r--debian/control32
-rw-r--r--debian/copyright74
l---------debian/missing-sources/system-stats.cpp1
-rwxr-xr-xdebian/rules7
-rw-r--r--debian/shopno-os-log-sync.install4
-rw-r--r--debian/shopno-os-log-sync.lintian-overrides1
-rw-r--r--debian/shopno-os-log-sync.user.service1
-rw-r--r--debian/shopno-os-log-sync@.user.service3
-rw-r--r--debian/shopno-os-log-sync@.user.timer1
-rw-r--r--debian/shopno-os-stats-common.install1
-rw-r--r--debian/shopno-os-stats-common.lintian-overrides1
-rw-r--r--debian/shopno-os-stats-sync.install3
-rw-r--r--debian/shopno-os-stats-sync.service8
-rw-r--r--debian/shopno-os-stats-sync.sysusers1
-rw-r--r--debian/shopno-os-stats-sync.timer9
-rw-r--r--debian/shopno-os-stats-sync.tmpfiles2
-rw-r--r--debian/shopno-os-stats.service11
-rw-r--r--src/system-stats/common.h2
-rw-r--r--src/system-stats/system-stats.cpp2
23 files changed, 181 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
index b4247f1..b30277a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,10 @@
-src/Watcher/__pycache__/*
+/src/Watcher/__pycache__/*
+/system-stats
+/debian/.debhelper/
+/debian/debhelper-build-stamp
+/debian/files
+/debian/*.debhelper
+/debian/*.substvars
+/debian/*/
+/obj/
+!/debian/source
diff --git a/Makefile b/Makefile
index 17ffdf6..7727df9 100644
--- a/Makefile
+++ b/Makefile
@@ -65,5 +65,6 @@ uninstall:
clean:
$(<<) " RM\t" "system-stats$(<<objects>>:obj/%=\\n\\t + %)"
@$(RM) -f $(<<objects>>) system-stats
+ @$(RM) -r obj
.PHONY: all clean install uninstall test
diff --git a/data/scripts/sync-stats b/data/scripts/sync-stats
index 2c4218b..d11846f 100755
--- a/data/scripts/sync-stats
+++ b/data/scripts/sync-stats
@@ -1,6 +1,6 @@
#!/bin/bash
source "${BASH_ARGV0%/*}"/common
-RAW_DATA_PATH="/var/log/stat-monitor"
+RAW_DATA_PATH="/var/log/system-stats"
enmac="$(getaddr "$(getiface "net/e")")"
wlmac="$(getaddr "$(getiface "net/w")")"
diff --git a/debian/changelog b/debian/changelog
index d696c88..b44a47e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,17 @@
+shopno-os-log-sync (2.0.1) shopno; urgency=medium
+
+ [ Vaishnav Deore ]
+ * installation methods changed
+
+ [ Mubashshir ]
+ * scripts: Rename scripts
+ * system-stats: Add system pressure stats logger
+ * Add Makefile to build and install things
+ * system-stats: Add script to sync system stats
+ * debian: Release new revision
+
+ -- Mubashshir <ahm@jadupc.com> Sun, 17 Sep 2023 22:00:26 +0600
+
shopno-os-log-sync (2.0.0+nmu1) shopno; urgency=medium
* Non-maintainer upload.
diff --git a/debian/control b/debian/control
index 6b518c3..0b29e61 100644
--- a/debian/control
+++ b/debian/control
@@ -1,19 +1,39 @@
Source: shopno-os-log-sync
-Section: util
+Section: utils
Priority: optional
Maintainer: Mubashshir <ahm@jadupc.com>
-Build-Depends: debhelper-compat (= 13), dh-exec
+Build-Depends: debhelper-compat (= 13)
Standards-Version: 4.5.0
-Vcs-Git: https://builder.jadupc.com/git/pkgs/shopno-os-log-sync
-Vcs-Browser: https://builder.jadupc.com/git/pkgs/shopno-os-log-sync
+Vcs-Git: https://git.jadupc.com/pkgs/shopno-os-log-sync
+Vcs-Browser: https://git.jadupc.com/pkgs/shopno-os-log-sync
Rules-Requires-Root: no
+
+Package: shopno-os-stats-common
+Architecture: all
+Depends: ${misc:Depends}
+Description: Shopno OS Stats logger - Common files
+ This Package contains the common required files for
+ Shopno OS stats logger.
+
Package: shopno-os-log-sync
Architecture: all
Depends:
python3,
python3-xdg,
xdotool,
- xprintidle
-Description: Shopno OS stats logger
+ xprintidle,
+ shopno-os-stats-common,
+ ${misc:Depends}
+Description: Shopno OS Stats logger - Usage
+ Per-User stats logger for Shopno OS
+
+Package: shopno-os-stats-sync
+Architecture: any
+Depends:
+ shopno-os-stats-common,
+ ${shlibs:Depends},
+ ${misc:Depends}
+Description: Shopno OS Stats logger - System
+ System Stats logger for Shopno OS
# vim: ft=yaml:ts=1:et
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..ebf4fbd
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,74 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Source: https://github.com/Waishnav/Watcher
+Upstream-Name: Watcher
+Upstream-Contact: Waishnav <Waishnav@github.com>
+
+Files:
+ src/Watcher/*
+ src/bin/watcher
+ misc/*
+ CONTRIBUTING.md
+ README.md
+ install
+ uninstall
+ update
+Copyright: 2023 Waishnav
+License: Expat
+
+Files:
+ data/*
+ debian/*
+ src/system-stats/*.cpp
+ src/system-stats/common.h
+ Makefile
+Copyright:
+ 2023 Mubashshir <ahm@jadupc.com>
+ 2023 Saikat <fas@jadupc.com>
+License: GPL-2+
+
+Files:
+ src/system-stats/date.h
+Copyright:
+ 2015-2017 Howard Hinnant
+ 2016 Adrian Colomitchi
+ 2017 Florian Dang
+ 2017 Paul Thompson
+ 2018-2019 Tomasz KamiƄski
+ 2019 Jiangang Zhuang
+License: Expat
+
+License: Expat
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+
+License: GPL-2+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any later
+ version.
+ .
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License along with
+ this package; if not, write to the Free Software Foundation, Inc., 51 Franklin
+ St, Fifth Floor, Boston, MA 02110-1301 USA
+ .
+ On Debian systems, the full text of the GNU General Public License version 2
+ can be found in the file /usr/share/common-licenses/GPL-2.
diff --git a/debian/missing-sources/system-stats.cpp b/debian/missing-sources/system-stats.cpp
new file mode 120000
index 0000000..86d060c
--- /dev/null
+++ b/debian/missing-sources/system-stats.cpp
@@ -0,0 +1 @@
+../../src/system-stats/system-stats.cpp \ No newline at end of file
diff --git a/debian/rules b/debian/rules
index 2d33f6a..58d0b5f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,3 +2,10 @@
%:
dh $@
+
+override_dh_auto_install:
+ dh_auto_install -- PREFIX=/usr SYSCONFDIR=/etc
+
+execute_before_dh_installtmpfiles:
+ @echo " dh_installsysusers"
+ @dh_installsysusers
diff --git a/debian/shopno-os-log-sync.install b/debian/shopno-os-log-sync.install
new file mode 100644
index 0000000..f1c491b
--- /dev/null
+++ b/debian/shopno-os-log-sync.install
@@ -0,0 +1,4 @@
+etc/xdg/autostart/shopno-os-log.desktop
+usr/bin/watcher
+usr/lib/system-stats/sync-logs
+usr/share/Watcher/
diff --git a/debian/shopno-os-log-sync.lintian-overrides b/debian/shopno-os-log-sync.lintian-overrides
new file mode 100644
index 0000000..84f6d22
--- /dev/null
+++ b/debian/shopno-os-log-sync.lintian-overrides
@@ -0,0 +1 @@
+shopno-os-log-sync binary: no-manual-page usr/bin/watcher
diff --git a/debian/shopno-os-log-sync.user.service b/debian/shopno-os-log-sync.user.service
index 15a870f..c96d4dd 100644
--- a/debian/shopno-os-log-sync.user.service
+++ b/debian/shopno-os-log-sync.user.service
@@ -1,5 +1,6 @@
[Unit]
Description=Shopno OS Stats Sync
+ConditionUser=!@system
Requires=shopno-os-log-sync@daily.timer
Requires=shopno-os-log-sync@weekly.timer
diff --git a/debian/shopno-os-log-sync@.user.service b/debian/shopno-os-log-sync@.user.service
index 928dd23..393043b 100644
--- a/debian/shopno-os-log-sync@.user.service
+++ b/debian/shopno-os-log-sync@.user.service
@@ -1,6 +1,7 @@
[Unit]
Description=Sync %I logs
+ConditionUser=!@system
[Service]
Type=oneshot
-ExecStart=/usr/share/Watcher/log-sync %i
+ExecStart=/usr/lib/system-stats/sync-logs %i
diff --git a/debian/shopno-os-log-sync@.user.timer b/debian/shopno-os-log-sync@.user.timer
index ec7bbb3..95efff4 100644
--- a/debian/shopno-os-log-sync@.user.timer
+++ b/debian/shopno-os-log-sync@.user.timer
@@ -1,5 +1,6 @@
[Unit]
Description=Sync usage logs with server %i
+ConditionUser=!@system
[Timer]
OnCalendar=%i
diff --git a/debian/shopno-os-stats-common.install b/debian/shopno-os-stats-common.install
new file mode 100644
index 0000000..5687349
--- /dev/null
+++ b/debian/shopno-os-stats-common.install
@@ -0,0 +1 @@
+usr/lib/system-stats/common
diff --git a/debian/shopno-os-stats-common.lintian-overrides b/debian/shopno-os-stats-common.lintian-overrides
new file mode 100644
index 0000000..c83b9e1
--- /dev/null
+++ b/debian/shopno-os-stats-common.lintian-overrides
@@ -0,0 +1 @@
+shopno-os-stats-common binary: script-not-executable usr/lib/system-stats/common
diff --git a/debian/shopno-os-stats-sync.install b/debian/shopno-os-stats-sync.install
new file mode 100644
index 0000000..bc1c77f
--- /dev/null
+++ b/debian/shopno-os-stats-sync.install
@@ -0,0 +1,3 @@
+usr/lib/system-stats/sync-stats
+usr/lib/system-stats/system-stats
+debian/shopno-os-stats.service lib/systemd/system/
diff --git a/debian/shopno-os-stats-sync.service b/debian/shopno-os-stats-sync.service
new file mode 100644
index 0000000..ee6cbb6
--- /dev/null
+++ b/debian/shopno-os-stats-sync.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Sync hourly system stats
+
+[Service]
+Type=oneshot
+User=system-stats
+Group=system-stats
+ExecStart=/usr/lib/system-stats/sync-stats
diff --git a/debian/shopno-os-stats-sync.sysusers b/debian/shopno-os-stats-sync.sysusers
new file mode 100644
index 0000000..59d96b2
--- /dev/null
+++ b/debian/shopno-os-stats-sync.sysusers
@@ -0,0 +1 @@
+u system-stats - "SystemStats User"
diff --git a/debian/shopno-os-stats-sync.timer b/debian/shopno-os-stats-sync.timer
new file mode 100644
index 0000000..ab62d2b
--- /dev/null
+++ b/debian/shopno-os-stats-sync.timer
@@ -0,0 +1,9 @@
+[Unit]
+Description=Hourly sync system stats with server
+
+[Timer]
+OnCalendar=hourly
+Persistent=true
+
+[Install]
+WantedBy=timers.target
diff --git a/debian/shopno-os-stats-sync.tmpfiles b/debian/shopno-os-stats-sync.tmpfiles
new file mode 100644
index 0000000..a97272b
--- /dev/null
+++ b/debian/shopno-os-stats-sync.tmpfiles
@@ -0,0 +1,2 @@
+d /var/log/system-stats - system-stats system-stats 1w -
+d /run/system-stats - system-stats system-stats - -
diff --git a/debian/shopno-os-stats.service b/debian/shopno-os-stats.service
new file mode 100644
index 0000000..91e3fd9
--- /dev/null
+++ b/debian/shopno-os-stats.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Sync hourly system stats
+
+[Service]
+Type=simple
+User=system-stats
+Group=system-stats
+ExecStart=/usr/lib/system-stats/system-stats
+
+[Install]
+WantedBy=default.target
diff --git a/src/system-stats/common.h b/src/system-stats/common.h
index b3984fb..230690d 100644
--- a/src/system-stats/common.h
+++ b/src/system-stats/common.h
@@ -5,7 +5,7 @@
#include <filesystem>
#define APP_VERSION "2.2"
-#define APP_NAME "stat-monitor"
+#define APP_NAME "system-stats"
using refstream = std::reference_wrapper<std::ostream>;
diff --git a/src/system-stats/system-stats.cpp b/src/system-stats/system-stats.cpp
index 4d2f43e..6a9549c 100644
--- a/src/system-stats/system-stats.cpp
+++ b/src/system-stats/system-stats.cpp
@@ -22,7 +22,7 @@ int main()
stream.get() << dumpReport();
stream.get() << "end\t" << epoch << std::endl;
- std::this_thread::sleep_for(1s);
+ std::this_thread::sleep_for(1min);
}
return 0;
}