Welcome to doinkd (idled the next generation).

This commit is contained in:
Cy Schubert 2010-09-29 03:44:01 +00:00
parent 8b61ac7c6c
commit 3b764e3dad
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=262063
10 changed files with 76 additions and 213 deletions

View file

@ -1,34 +1,34 @@
# New ports collection makefile for: idled
# New ports collection makefile for: doinkd
# Date created: 12 March 1997
# Whom: Andrew <andrew@ugh.net.au>, Iain Templeton <iain@ugh.net.au>
#
# $FreeBSD$
#
PORTNAME= idled
PORTVERSION= 1.16
PORTREVISION= 3
PORTNAME= doinkd
PORTVERSION= 0.01
CATEGORIES= sysutils
MASTER_SITES= http://www.netsw.org/system/tools/process/
MASTER_SITES= SF/idled/${PORTNAME}/${PORTVERSION}/
MAINTAINER= ports@FreeBSD.org
MAINTAINER= cy@FreeBSD.org
COMMENT= A daemon that logs out idle users and those users hogging resources
NO_CDROM= non-profit use and distribution only
CONFLICTS= idled-*
MANCOMPRESSED= yes
MAN5= idled.cf.5
MAN8= idled.8
MAN5= doinkd.cf.5
MAN8= doinkd.8
USE_RC_SUBR= ${PORTNAME}
PLIST_FILES= etc/idled.cf.template libexec/idled
PLIST_FILES= etc/doinkd/doinkd.cf.template sbin/doinkd
PLIST_DIRS= etc/doinkd
.include <bsd.port.pre.mk>
.if ${OSVERSION} > 900006
EXTRA_PATCHES= ${PATCHDIR}/utmpx-Makefile \
${PATCHDIR}/utmpx-idled.h \
${PATCHDIR}/utmpx-idled.c
${PATCHDIR}/utmpx-doinkd.h \
${PATCHDIR}/utmpx-doinkd.c
.else
EXTRA_PATCHES= ${PATCHDIR}/utmp-Makefile
.endif
@ -36,7 +36,10 @@ EXTRA_PATCHES= ${PATCHDIR}/utmp-Makefile
post-extract:
(cd ${WRKSRC}; make clean)
pre-install:
${MKDIR} ${PREFIX}/etc/doinkd
post-install:
@${STRIP_CMD} ${PREFIX}/libexec/idled
@${STRIP_CMD} ${PREFIX}/sbin/doinkd
.include <bsd.port.post.mk>

View file

@ -1,3 +1,3 @@
MD5 (idled-1.16.tar.gz) = a633e9484acb904e1bf0ed43b8383033
SHA256 (idled-1.16.tar.gz) = a80c4a35bbbe2660424e5fa55e2b65b098e6cb02df739bcb7b2a1517318b76ce
SIZE (idled-1.16.tar.gz) = 70864
MD5 (doinkd-0.01.tar.gz) = 091d4048c1007b9f3f4f0a3386b1b2a2
SHA256 (doinkd-0.01.tar.gz) = 17185f5f1024f5421467d5b3380a952eba61e39c97d01b10779fd3092efa5d0c
SIZE (doinkd-0.01.tar.gz) = 57703

View file

@ -1,33 +0,0 @@
#!/bin/sh
#
# $FreeBSD: /tmp/pcvs/ports/sysutils/doinkd/files/Attic/idled.in,v 1.3 2010-03-27 00:14:56 dougb Exp $
#
# PROVIDE: idled
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable idled:
#
# idled_enable="YES"
# idled_flags="<set as needed>"
#
# See idled(8) for flags
#
. /etc/rc.subr
name=idled
rcvar=`set_rcvar`
command=%%PREFIX%%/libexec/idled
required_files=%%PREFIX%%/etc/idled.cf
# set defaults
idled_enable=${idled_enable:-"NO"}
load_rc_config $name
run_rc_command "$1"

View file

@ -1,5 +1,5 @@
--- ./Makefile.orig 1996-05-16 18:05:28.000000000 -0400
+++ ./Makefile 2009-07-15 01:05:40.560278401 -0400
--- Makefile.orig 2006-05-30 00:19:28.000000000 -0700
+++ Makefile 2010-08-27 12:42:08.661284827 -0700
@@ -2,8 +2,8 @@
#
@ -11,7 +11,16 @@
INCLUDE =
######################################################################
@@ -166,26 +166,26 @@
@@ -81,7 +81,7 @@
######################################################################
# UnixWare 7 -- SVR5 MP
#DEFS = -DSYSV -DHAVE_PROC_FS -DUTMPPID -DHAVE_SETSID -DHAVE_UTMPX -DUTMPHOST -DUNIXWARE
-DEFS = -DSYSV -DPS_HACK -DRUDE_KILL -DHAVE_SETSID -DHAVE_UTMPX -DUTMPHOST -DUNIXWARE
+DEFS = -DPS_HACK -DRUDE_KILL -DHAVE_SETSID -DUTMPHOST
SPECLIBS =
INSTTYPE = install4
@@ -193,26 +193,22 @@
# You will need to delete parse.c before compiling! You can either
# do so by hand, or do a 'make clean' followed by the normal 'make'.
#DEFS += -O -m486
@ -22,20 +31,17 @@
-#INSTTYPE = install1a
+INSTTYPE = install1a
#
-#DEST = /usr/local/libexec
-#CFDEST = /usr/local/libexec
-#DEST = /usr/local/sbin
-#CFDEST = /etc/doinkd
-#MDEST = /usr/local/man
-#LOGDEST = /var/log
+DEST = ${PREFIX}/libexec
+CFDEST = ${PREFIX}/etc
+MDEST = ${PREFIX}/man
+LOGDEST = /var/log
#
-#
-#OWNER = root
-#CFOWNER = root
-#MOWNER = man
+OWNER = root
+CFOWNER = root
+DEST = ${PREFIX}/sbin
+CFDEST = ${PREFIX}/etc/doinkd
+MDEST = ${PREFIX}/man
+MOWNER = man
#
-#GROUP = daemon
@ -47,53 +53,12 @@
-#CFMODE = 664
-#MMODE = 444
+MODE = 750
+CFMODE = 644
+CFMODE = 664
+MMODE = 444
######################################################################
######################################################################
@@ -215,25 +215,25 @@
# SVR4 -- Solaris 2.x
# Use install3 for /usr/sbin/install
# and install1 for /usr/ucb/install
-DEFS += -DSYSV -DHAVE_PROC_FS -DUTMPPID -DHAVE_SETSID -DHAVE_UTMPX -DUTMPHOST -DRUDEKILL
-SPECLIBS =
-INSTTYPE = install3
+#DEFS += -DSYSV -DHAVE_PROC_FS -DUTMPPID -DHAVE_SETSID -DHAVE_UTMPX -DUTMPHOST -DRUDEKILL
+#SPECLIBS =
+#INSTTYPE = install3
-DEST = /usr/local/bin
-CFDEST = /usr/local/lib
-MDEST = /usr/local/man
-LOGDEST = /var/log
+#DEST = /usr/local/bin
+#CFDEST = /usr/local/lib
+#MDEST = /usr/local/man
+#LOGDEST = /var/log
-OWNER = root
-CFOWNER = root
-MOWNER = root
+#OWNER = root
+#CFOWNER = root
+#MOWNER = root
-GROUP = root
-CFGROUP = root
+#GROUP = root
+#CFGROUP = root
-MODE = 750
-CFMODE = 664
-MMODE = 644
+#MODE = 750
+#CFMODE = 664
+#MMODE = 644
######################################################################
######################################################################
@@ -428,7 +428,7 @@
@@ -456,7 +452,7 @@
# HERE are the big CFLAGS
# Add -g if you want debugging
# Add -O or whatever variant for optimization

View file

@ -1,5 +1,5 @@
--- Makefile.orig 1996-05-16 15:05:28.000000000 -0700
+++ Makefile 2010-01-25 16:08:20.000000000 -0800
--- Makefile.orig 2006-05-30 00:19:28.000000000 -0700
+++ Makefile 2010-08-27 12:42:08.661284827 -0700
@@ -2,8 +2,8 @@
#
@ -11,31 +11,37 @@
INCLUDE =
######################################################################
@@ -166,26 +166,26 @@
@@ -81,7 +81,7 @@
######################################################################
# UnixWare 7 -- SVR5 MP
#DEFS = -DSYSV -DHAVE_PROC_FS -DUTMPPID -DHAVE_SETSID -DHAVE_UTMPX -DUTMPHOST -DUNIXWARE
-DEFS = -DSYSV -DPS_HACK -DRUDE_KILL -DHAVE_SETSID -DHAVE_UTMPX -DUTMPHOST -DUNIXWARE
+DEFS = -DPS_HACK -DRUDE_KILL -DHAVE_SETSID -DUTMPHOST
SPECLIBS =
INSTTYPE = install4
@@ -193,26 +193,22 @@
# You will need to delete parse.c before compiling! You can either
# do so by hand, or do a 'make clean' followed by the normal 'make'.
#DEFS += -O -m486
-#DEFS += -DBSD_OS2 -DHAVE_SETSID -DHAVE_YYRESTART -DPS_HACK
+DEFS += -DBSD_OS2 -DHAVE_SETSID -DHAVE_YYRESTART -DPS_HACK -DHAVE_UTMPX -DSYSV
+DEFS += -DBSD_OS2 -DHAVE_SETSID -DHAVE_YYRESTART -DPS_HACK
#DEFS += -DPROC_SEARCH_1
#SPECLIBS = -lkvm
-#INSTTYPE = install1a
+INSTTYPE = install1a
#
-#DEST = /usr/local/libexec
-#CFDEST = /usr/local/libexec
-#DEST = /usr/local/sbin
-#CFDEST = /etc/doinkd
-#MDEST = /usr/local/man
-#LOGDEST = /var/log
+DEST = ${PREFIX}/libexec
+CFDEST = ${PREFIX}/etc
+MDEST = ${PREFIX}/man
+LOGDEST = /var/log
#
-#
-#OWNER = root
-#CFOWNER = root
-#MOWNER = man
+OWNER = root
+CFOWNER = root
+DEST = ${PREFIX}/sbin
+CFDEST = ${PREFIX}/etc/doinkd
+MDEST = ${PREFIX}/man
+MOWNER = man
#
-#GROUP = daemon
@ -47,59 +53,17 @@
-#CFMODE = 664
-#MMODE = 444
+MODE = 750
+CFMODE = 644
+CFMODE = 664
+MMODE = 444
######################################################################
######################################################################
@@ -215,25 +215,25 @@
# SVR4 -- Solaris 2.x
# Use install3 for /usr/sbin/install
# and install1 for /usr/ucb/install
-DEFS += -DSYSV -DHAVE_PROC_FS -DUTMPPID -DHAVE_SETSID -DHAVE_UTMPX -DUTMPHOST -DRUDEKILL
-SPECLIBS =
-INSTTYPE = install3
-
-DEST = /usr/local/bin
-CFDEST = /usr/local/lib
-MDEST = /usr/local/man
-LOGDEST = /var/log
+#DEFS += -DSYSV -DHAVE_PROC_FS -DUTMPPID -DHAVE_SETSID -DHAVE_UTMPX -DUTMPHOST -DRUDEKILL
+#SPECLIBS =
+#INSTTYPE = install3
-OWNER = root
-CFOWNER = root
-MOWNER = root
+#DEST = /usr/local/bin
+#CFDEST = /usr/local/lib
+#MDEST = /usr/local/man
+#LOGDEST = /var/log
+
+#OWNER = root
+#CFOWNER = root
+#MOWNER = root
-GROUP = root
-CFGROUP = root
+#GROUP = root
+#CFGROUP = root
-MODE = 750
-CFMODE = 664
-MMODE = 644
+#MODE = 750
+#CFMODE = 664
+#MMODE = 644
######################################################################
######################################################################
@@ -428,7 +428,7 @@
@@ -456,7 +452,7 @@
# HERE are the big CFLAGS
# Add -g if you want debugging
# Add -O or whatever variant for optimization
-CFLAGS = ${DEFS} ${DEBUG} -DCONFIG=\"${CONFIG}\" -DLOGFILE=\"${LOGFILE}\" ${INCLUDE}
+CFLAGS+= ${DEFS} ${DEBUG} -DCONFIG=\"${CONFIG}\" -DLOGFILE=\"${LOGFILE}\" ${INCLUDE}
+CFLAGS+= ${DEFS} ${DEBUG} -DCONFIG=\"${CONFIG}\" -DLOGFILE=\"${LOGFILE}\" ${INCLUDE} -DHAVE_UTMPX -DSYSV
# For HP's ANSI C compiler (use -g instead of +O3 for debugging)
# CFLAGS = +O3 -Aa -D_HPUX_SOURCE ${DEFS} ${DEBUG} -DCONFIG=\"${CONFIG}\" -DLOGFILE=\"${LOGFILE}\" ${INCLUDE}

View file

@ -1,5 +1,5 @@
--- idled.c.orig 2010-01-25 16:06:48.000000000 -0800
+++ idled.c 2010-01-25 16:09:39.000000000 -0800
--- doinkd.c.orig 2010-01-25 16:06:48.000000000 -0800
+++ doinkd.c 2010-01-25 16:09:39.000000000 -0800
@@ -335,7 +335,7 @@
if (strcmp(utmpbuf.ut_line,XDM_DEV) == 0)
{

View file

@ -1,5 +1,5 @@
--- idled.h.orig 2010-01-25 16:07:42.000000000 -0800
+++ idled.h 2010-01-25 16:07:50.000000000 -0800
--- doinkd.h.orig 2010-01-25 16:07:42.000000000 -0800
+++ doinkd.h 2010-01-25 16:07:50.000000000 -0800
@@ -1,7 +1,6 @@
#include <sys/types.h>
#include <stdio.h>

View file

@ -1,33 +0,0 @@
--- idled.c.orig 2010-01-25 16:06:48.000000000 -0800
+++ idled.c 2010-01-25 16:09:39.000000000 -0800
@@ -335,7 +335,7 @@
if (strcmp(utmpbuf.ut_line,XDM_DEV) == 0)
{
/* This is the console. Is there a real name attached? */
- if (strlen(utmpbuf.ut_name) > 0)
+ if (strlen(utmpbuf.ut_user) > 0)
isConsole = TRUE; /* Yes, use it */
else
strcpy(console_user,""); /* No, clear the console user */
@@ -349,10 +349,10 @@
#endif /* SYSV */
{
user = &users[utmptr];
- (void) strncpy (tmpname, utmpbuf.ut_name, NAMELEN);
+ (void) strncpy (tmpname, utmpbuf.ut_user, NAMELEN);
tmpname[NAMELEN] = 0;
- if (!strcmp (user->uid, tmpname) && user->time_on == utmpbuf.ut_xtime)
+ if (!strcmp (user->uid, tmpname) && user->time_on == utmpbuf.ut_tv.tv_sec)
{
if (new)
setlimits (utmptr);
@@ -402,7 +402,7 @@
logfile ("Error: could not get info on supposed user %s.",user->uid);
else
getgroups_func (pswd->pw_name, user->groups, pswd->pw_gid);
- user->time_on = utmpbuf.ut_xtime;
+ user->time_on = utmpbuf.ut_tv.tv_sec;
setlimits (utmptr);
user->next = tempus;
chk_session_refuse(user);

View file

@ -1,10 +0,0 @@
--- idled.h.orig 2010-01-25 16:07:42.000000000 -0800
+++ idled.h 2010-01-25 16:07:50.000000000 -0800
@@ -1,7 +1,6 @@
#include <sys/types.h>
#include <stdio.h>
#include <sys/param.h>
-#include <utmp.h>
#define qelem qelem_sys /* Work around to use our own qelem below */
#include <stdlib.h>

View file

@ -1,4 +1,11 @@
This is a port of idled by Michael P. Crider. Idled is a daemon that runs on a
machine to keep an eye on current users. If users have been idle for too long,
or have been logged on for too long, or have logged in too many times, it will
warn them and log them out appropriately.
This is the doinkd - user activity monitor project ("idled")
This project was registered on SourceForge.net on May 25, 2006, and is
described by the project team as follows:
The idle daemon (doinkd) monitors user activity and logs them off when
predefined rules are met. These include session time, multiple logins,
tty, idletime and group limits. Similar to the Unix idleout command,
but much more configurable. Formerly idled.
http://idled.sourceforge.net/