Skip to content

Commit 476ca6a

Browse files
author
Ricardo F
committed
Merge branch 'dev'
2 parents dc03ac2 + 0d61af5 commit 476ca6a

21 files changed

+156
-160
lines changed

CHANGELOG

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
tuptime (5.2.4) unstable; urgency=low
2+
3+
* Move files from /lib to /usr/lib in DEB package
4+
* Replace adduser with sysusers.d in DEB package
5+
* Update documentation
6+
* Minnor code refactoring
7+
8+
-- Ricardo Fraile <r@rfmoz.eu> Sat, 13 Jul 2024 13:21:00 +0100
9+
110
tuptime (5.2.3) unstable; urgency=low
211

312
* Update distribution packages

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
tuptime
22
=======
33

4-
Tuptime is a tool for report the historical and statistical real time of the system, keeping it between restarts. Like uptime command but with more interesting output.
4+
Tuptime reports the historical and statistical real time of the system, preserving it between restarts. Like uptime command, but with more interesting output.
55

66

77
### Sample output

debian/changelog

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
tuptime (5.2.4) unstable; urgency=low
2+
3+
* Move files from /lib to /usr/lib in DEB package
4+
* Replace adduser with sysusers.d in DEB package
5+
* Update documentation
6+
* Minnor code refactoring
7+
8+
-- Ricardo Fraile <r@rfmoz.eu> Sat, 13 Jul 2024 13:21:00 +0100
9+
110
tuptime (5.2.3) unstable; urgency=low
211

312
* Update distribution packages

debian/control

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Multi-Arch: foreign
1313
Pre-Depends: ${misc:Pre-Depends}
1414
Depends: ${misc:Depends}, ${shlibs:Depends}
1515
, python3:any
16-
, adduser
1716
Description: report historical system real time
18-
Tuptime track and report historical and statistical real time of the
19-
system, keeping the uptime and downtime between shutdowns.
17+
Tuptime tracks and reports historical and statistical real time of
18+
the system, preserving the uptime and downtime between shutdowns.

debian/postinst

-24
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,6 @@ case "$1" in
2424
# Rename to underscore if previous exists
2525
getent passwd tuptime >/dev/null && usermod -l _tuptime tuptime
2626
getent group tuptime > /dev/null && groupmod -n _tuptime tuptime
27-
28-
# Create user if not exists
29-
if ! getent passwd _tuptime >/dev/null ; then
30-
echo -n "Adding _tuptime user..."
31-
adduser --quiet --system --group --disabled-password \
32-
--home "/var/lib/tuptime" \
33-
--shell '/usr/sbin/nologin' \
34-
--gecos 'Tuptime execution user,,,' \
35-
--allow-bad-names _tuptime
36-
echo "done"
37-
fi
38-
39-
# Ensure right ownership
40-
if [ -d /var/lib/tuptime ]; then
41-
chown _tuptime:_tuptime /var/lib/tuptime
42-
# When adduser is configured for DIR_MODE=0750,
43-
# the file mode ends up more closed than intended.
44-
chmod 0755 /var/lib/tuptime
45-
if [ -f /var/lib/tuptime/tuptime.db ]; then
46-
chown _tuptime:_tuptime /var/lib/tuptime/tuptime.db
47-
fi
48-
fi
49-
50-
su -s /bin/sh _tuptime -c "tuptime -q"
5127
;;
5228

5329
abort-upgrade|abort-remove|abort-deconfigure)

debian/rules

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
override_dh_installinit:
99
dh_installinit --onlyscripts
10+
# this is needed until dh compat 14
11+
dh_installsysusers
1012

1113
%:
1214
dh $@

debian/tuptime.install

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
src/systemd/tuptime.service lib/systemd/system/
2-
src/systemd/tuptime-sync.service lib/systemd/system/
3-
src/systemd/tuptime-sync.timer lib/systemd/system/
1+
src/systemd/tuptime.service usr/lib/systemd/system/
2+
src/systemd/tuptime-sync.service usr/lib/systemd/system/
3+
src/systemd/tuptime-sync.timer usr/lib/systemd/system/
4+
src/systemd/sysusers.d/tuptime.conf usr/lib/sysusers.d/
45
src/init.d/debian/tuptime etc/init.d/
56
src/tuptime usr/bin/

misc/rpm/rpm-readme.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ Z.- For testing with "dev" branch. Install "git" on step "1" and replace step "2
4141

4242
dnf -y install git
4343
cd ~
44-
git clone -b dev --depth=1 https://github.com/rfmoz/tuptime.git tuptime-5.2.3
44+
git clone -b dev --depth=1 https://github.com/rfmoz/tuptime.git tuptime-5.2.4
4545
rpmdev-setuptree
4646
cd ~/rpmbuild/SPECS/
47-
cp ../../tuptime-5.2.3/misc/rpm/tuptime.spec .
48-
tar -czvf ../SOURCES/5.2.3.tar.gz ../../tuptime-5.2.3
47+
cp ../../tuptime-5.2.4/misc/rpm/tuptime.spec .
48+
tar -czvf ../SOURCES/5.2.4.tar.gz ../../tuptime-5.2.4
4949
rpmbuild -ba --target=noarch tuptime.spec

misc/rpm/tuptime.spec

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Name: tuptime
2-
Version: 5.2.3
3-
Release: 2%{?dist}
2+
Version: 5.2.4
3+
Release: 1%{?dist}
44
Summary: Report historical system real time
55

66
License: GPL-2.0-or-later
@@ -25,8 +25,8 @@ Requires(pre): shadow-utils
2525

2626

2727
%description
28-
Tuptime track and report historical and statistical real time of the
29-
system, keeping the uptime and downtime between shutdowns.
28+
Tuptime tracks and reports historical and statistical real time of
29+
the system, preserving the uptime and downtime between shutdowns.
3030

3131

3232
%prep
@@ -102,6 +102,9 @@ su -s /bin/sh _tuptime -c "(umask 0022 && /usr/bin/tuptime -q)"
102102

103103

104104
%changelog
105+
* Fri Jul 13 2024 Ricardo Fraile <rfraile@rfraile.eu> 5.2.4-1
106+
- New release
107+
105108
* Fri Jan 05 2024 Ricardo Fraile <rfraile@rfraile.eu> 5.2.3-1
106109
- New release
107110

misc/scripts/README.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ tuptime_join.py
1010
Join two tuptime db files into an other one.
1111

1212
tuptime_modify.py
13-
Modify registers keeping nearest values in sync.
13+
Modify registers preserving nearest values in sync.
1414
Allow change 'end status', 'startup timestamp' and 'shutdown timestamp'.
1515

1616

misc/scripts/tuptime_modify.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
'''
55
This script modify the "Startup Timestamp", "Shutdown Timestamp" and
6-
"End Status" on Tuptime database keeping the other values around in sync.
6+
"End Status" on Tuptime database preserving the other values around in sync.
77
88
Increase 60 secs the startup datetime on register number 1:
99
tuptime_modify.py -c startup -r 1 -s 60

src/init.d/debian/tuptime

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
# tuptime - Report the historical and statistical real time of the system, keeping it between restarts.
2+
# tuptime - Report historical and statistical real time of the system, preserving it between restarts.
33
# Author Ricardo Fraile - 2020
44

55
# This program is free software: you can redistribute it and/or modify

src/init.d/redhat/tuptime

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
# tuptime - Historical and statistical real time of the system.
44
#
55
# chkconfig: 12345 25 90
6-
# description: Report the historical and statistical real time \
7-
# of the system, keeping it between restarts.
6+
# description: Report historical and statistical real time \
7+
# of the system, preserving it between restarts.
88

99
### BEGIN INIT INFO
1010
# Provides: tuptime
1111
# Required-Start: $local_fs $time
1212
# Required-Stop: $local_fs $time
1313
# Short-Description: start and stop tuptime
14-
# Description: Report the historical and statistical real time
15-
# of the system, keeping it between restarts.
14+
# Description: Report historical and statistical real time
15+
# of the system, preserving it between restarts.
1616
### END INIT INFO
1717

1818
# Source function library.

src/man/tuptime.1

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
'\" t
2-
.TH TUPTIME 1 "Jan 2024" "5.2.3" "General Commands Manual"
2+
.TH TUPTIME 1 "Jan 2024" "5.2.4" "General Commands Manual"
33

44
.SH NAME
5-
tuptime \- Report historical and statistical real time of the system, keeping it between restarts. Total uptime.
5+
tuptime \- Report historical and statistical real time of the system, preserving it between restarts. Total uptime.
66

77
.SH SYNOPSIS
88
tuptime [\-h] [\-A STARTUP] [\-b] [\-c] [\-d DATETIME_FMT] [\-e DECIMALS] [\-E STARTUP] [\-f FILE] [\-g] [\-i] [\-k] [\-l] [\-n] [\-o TYPE] [\-p] [\-q] [\-r] [\-s] [\-S STARTUP] [\-t] [\-\-tat TIMESTAMP] [\-\-tsince TIMESTAMP] [\-\-tuntil TIMESTAMP] [\-U STARTUP] [\-v] [\-V]
99

1010
.SH DESCRIPTION
1111
.RS
1212
.RE
13-
Tuptime report historical and statistical real time of
14-
the system, keeping it between restarts. Indeed, it can:
13+
Tuptime reports historical and statistical real time of
14+
the system, preserving it between restarts. Indeed, it can:
1515
.RS
1616
- Count system startups
1717
.RS
@@ -245,7 +245,7 @@ Ricardo Fraile <r@rfmoz.eu>
245245

246246
.SH "COPYRIGHT"
247247
.PP
248-
Copyright (C) 2023 by Ricardo F. All Rights Reserved.
248+
Copyright (C) 2024 by Ricardo F. All Rights Reserved.
249249

250250
This product is distributed in the hope that it will be useful, but
251251
WITHOUT any warranty; without even the implied warranty of

src/systemd/sysusers.d/tuptime.conf

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
u _tuptime - "Tuptime execution user" /var/lib/tuptime
2+
3+
# Note:
4+
# systemd-sysusers doesn't create home directories. Use in combination with
5+
# StateDirectory=tuptime under [Service] in tuptime.service unit.
6+
# https://lists.freedesktop.org/archives/systemd-devel/2018-February/040348.html

src/systemd/tuptime-sync.service

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Description=Tuptime scheduled sync service
33
Documentation=man:tuptime(1) file:///usr/share/doc/tuptime/tuptime-manual.txt.gz
44
Requires=tuptime.service
5+
After=tuptime.service
56
#ConditionPathExists=!/etc/cron.d/tuptime
67

78
[Service]

src/systemd/tuptime-tmpfiles.conf

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
d /var/lib/tuptime 0755 _tuptime _tuptime

src/systemd/tuptime.sysusers

-10
This file was deleted.

0 commit comments

Comments
 (0)