diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-process/atop/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-process/atop/files')
-rw-r--r-- | sys-process/atop/files/atop-2.2-build.patch | 27 | ||||
-rw-r--r-- | sys-process/atop/files/atop-2.2-sysmacros.patch | 14 | ||||
-rw-r--r-- | sys-process/atop/files/atop.rc | 15 | ||||
-rw-r--r-- | sys-process/atop/files/atop.rc-r1 | 8 | ||||
-rw-r--r-- | sys-process/atop/files/atop.rc-r2 | 8 | ||||
-rw-r--r-- | sys-process/atop/files/atop.service | 11 | ||||
-rw-r--r-- | sys-process/atop/files/atopacct.rc | 40 | ||||
-rw-r--r-- | sys-process/atop/files/atopacct.service | 14 |
8 files changed, 137 insertions, 0 deletions
diff --git a/sys-process/atop/files/atop-2.2-build.patch b/sys-process/atop/files/atop-2.2-build.patch new file mode 100644 index 000000000000..70840a25330a --- /dev/null +++ b/sys-process/atop/files/atop-2.2-build.patch @@ -0,0 +1,27 @@ +--- atop-2.2-3/Makefile ++++ atop-2.2-3/Makefile +@@ -19,7 +19,7 @@ + PMPATH2 = /usr/lib64/pm-utils/sleep.d + PMPATHD = /usr/lib/systemd/system-sleep + +-CFLAGS += -O2 -I. -Wall # -DHTTPSTATS ++CFLAGS += -I. -Wall # -DHTTPSTATS + OBJMOD0 = version.o + OBJMOD1 = various.o deviate.o procdbase.o + OBJMOD2 = acctproc.o photoproc.o photosyst.o rawlog.o ifprop.o parseable.o +@@ -32,13 +32,13 @@ + all: atop atopsar atopacctd + + atop: atop.o $(ALLMODS) Makefile +- $(CC) atop.o $(ALLMODS) -o atop -lncurses -lz -lm -lrt $(LDFLAGS) ++ $(CC) $(CFLAGS) $(LDFLAGS) atop.o $(ALLMODS) -o atop $(shell ${PKG_CONFIG} --libs ncurses) -lz -lm -lrt + + atopsar: atop + ln -sf atop atopsar + + atopacctd: atopacctd.o netlink.o +- $(CC) atopacctd.o netlink.o -o atopacctd $(LDFLAGS) ++ $(CC) $(CFLAGS) $(LDFLAGS) atopacctd.o netlink.o -o atopacctd + + netlink.o: netlink.c + $(CC) -I. -Wall -c netlink.c diff --git a/sys-process/atop/files/atop-2.2-sysmacros.patch b/sys-process/atop/files/atop-2.2-sysmacros.patch new file mode 100644 index 000000000000..87fd069c8fdb --- /dev/null +++ b/sys-process/atop/files/atop-2.2-sysmacros.patch @@ -0,0 +1,14 @@ +https://bugs.gentoo.org/580372 + +include sys/sysmacros.h for major/minor prototypes + +--- a/photosyst.c ++++ b/photosyst.c +@@ -164,6 +164,7 @@ + #include <signal.h> + #include <string.h> + #include <dirent.h> ++#include <sys/sysmacros.h> + + #include <sys/socket.h> + #include <netinet/in.h> diff --git a/sys-process/atop/files/atop.rc b/sys-process/atop/files/atop.rc new file mode 100644 index 000000000000..f05db6a0e15b --- /dev/null +++ b/sys-process/atop/files/atop.rc @@ -0,0 +1,15 @@ +#!/sbin/openrc-run +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +start() { + ebegin "Starting atop" + start-stop-daemon --start --quiet --exec /etc/atop/atop.daily + eend $? +} + +stop() { + ebegin "Stopping atop" + start-stop-daemon --stop --exec /usr/bin/atop --pidfile /var/run/atop.pid + eend $? +} diff --git a/sys-process/atop/files/atop.rc-r1 b/sys-process/atop/files/atop.rc-r1 new file mode 100644 index 000000000000..c5172283a212 --- /dev/null +++ b/sys-process/atop/files/atop.rc-r1 @@ -0,0 +1,8 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="Resource-specific view of processes" +pidfile="/var/run/atop.pid" +command="/etc/atop/atop.daily" +command_background="true" diff --git a/sys-process/atop/files/atop.rc-r2 b/sys-process/atop/files/atop.rc-r2 new file mode 100644 index 000000000000..ce66821dbdd5 --- /dev/null +++ b/sys-process/atop/files/atop.rc-r2 @@ -0,0 +1,8 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="Resource-specific view of processes" +pidfile="/var/run/atop.pid" +command="/usr/share/atop/atop.daily" +command_background="true" diff --git a/sys-process/atop/files/atop.service b/sys-process/atop/files/atop.service new file mode 100644 index 000000000000..09295b9acd12 --- /dev/null +++ b/sys-process/atop/files/atop.service @@ -0,0 +1,11 @@ +[Unit] +Description=Atop advanced performance monitor +Documentation=man:atop(1) + +[Service] +Type=simple +ExecStart=/etc/atop/atop.daily +KillSignal=SIGUSR2 + +[Install] +WantedBy=multi-user.target diff --git a/sys-process/atop/files/atopacct.rc b/sys-process/atop/files/atopacct.rc new file mode 100644 index 000000000000..c68ca3e6b3a8 --- /dev/null +++ b/sys-process/atop/files/atopacct.rc @@ -0,0 +1,40 @@ +#!/sbin/openrc-run +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="Resource-specific view of processes" +command="/usr/sbin/atopacctd" +lockfile="/var/lock/subsys/atopacctd" + +start_pre() { + # Check if process accounting already in use via psacct + for PACCTFILE in /var/account/pacct /var/log/pacct ; do + if [ -f "${PACCTFILE}" ] ; then + BEFORSIZE=$(stat -c %s "${PACCTFILE}") + AFTERSIZE=$(stat -c %s "${PACCTFILE}") + + # verify if accounting file grows, so is in use + if [ ${BEFORSIZE} -lt ${AFTERSIZE} ] ; then + ewarn "Process accounting already used by psacct!" + return 1 + fi + fi + done + + checkpath -d -q ${lockfile%/*} || return 1 +} + +start() { + ebegin "Starting atopacctd" + start-stop-daemon --start --exec ${command} + touch ${lockfile} + eend $? +} + +stop() { + ebegin "Stopping atopacctd" + start-stop-daemon --stop --exec ${command} + rm ${lockfile} + eend $? +} + diff --git a/sys-process/atop/files/atopacct.service b/sys-process/atop/files/atopacct.service new file mode 100644 index 000000000000..1f51ec41916a --- /dev/null +++ b/sys-process/atop/files/atopacct.service @@ -0,0 +1,14 @@ +[Unit] +Description=Atop process accounting daemon +Documentation=man:atopacctd(8) +Conflicts=psacct.service +After=syslog.target +Before=atop.service + +[Service] +Type=forking +PIDFile=/var/run/atopacctd.pid +ExecStart=/usr/sbin/atopacctd + +[Install] +WantedBy=multi-user.target |