FreeBSD Bugzilla – Attachment 241090 Details for
Bug 270433
sysutils/tuptime: installation upgrade with '_tuptime' UID/GID
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to create _tuptime UID/GID, cron exec. and rc.d script.
tuptime-5.2.2-portupgrade.diff (text/plain), 3.91 KB, created by
Ricardo Fraile
on 2023-03-24 16:42:17 UTC
(
hide
)
Description:
Patch to create _tuptime UID/GID, cron exec. and rc.d script.
Filename:
MIME Type:
Creator:
Ricardo Fraile
Created:
2023-03-24 16:42:17 UTC
Size:
3.91 KB
patch
obsolete
>diff --git a/GIDs b/GIDs >index 3813fa67b7ec..30122f81000b 100644 >--- a/GIDs >+++ b/GIDs >@@ -768,7 +768,7 @@ dotlrn:*:821: > selenium:*:824: > polw:*:825: > statsd:*:826: >-# free: 827 >+_tuptime:*:827: > # free: 828 > # free: 829 > # free: 830 >diff --git a/UIDs b/UIDs >index 1421025df405..359fb798b03d 100644 >--- a/UIDs >+++ b/UIDs >@@ -773,7 +773,7 @@ titus-keys:*:823:65533::0:0:Titus Keyserver User:/nonexistent:/usr/sbin/nologin > selenium:*:824:824::0:0:Selenium Daemon User:/usr/local/selenium:/bin/sh > polw:*:825:825::0:0:Policyd-weight Cache Owner:/nonexistent:/sbin/nologin > statsd:*:826:826::0:0:Statsd Daemon:/nonexistent:/sbin/nologin >-# free: 827 >+_tuptime:*:827:827::0:0:Tuptime:/var/lib/tuptime:/usr/sbin/nologin > # free: 828 > # free: 829 > # free: 830 >diff --git a/sysutils/tuptime/Makefile b/sysutils/tuptime/Makefile >index e3fc4c40045c..ea07d6bf8074 100644 >--- a/sysutils/tuptime/Makefile >+++ b/sysutils/tuptime/Makefile >@@ -21,11 +21,24 @@ NO_ARCH= yes > NO_BUILD= yes > SUB_FILES= pkg-message > >-PLIST_FILES= bin/tuptime \ >+USERS= _tuptime >+GROUPS= _tuptime >+ >+PLIST_FILES= bin/tuptime \ >+ "@rmtry /var/lib/tuptime/tuptime.db" \ >+ "@dir /var/lib" \ >+ "@dir(${USERS},${GROUPS},755) /var/lib/tuptime" \ >+ "@dir etc/cron.d" \ >+ "etc/cron.d/tuptime" \ > man/man1/tuptime.1.gz > > do-install: > ${INSTALL_SCRIPT} ${WRKSRC}/src/tuptime ${STAGEDIR}${PREFIX}/bin/tuptime > ${INSTALL_MAN} ${WRKSRC}/src/man/tuptime.1 ${STAGEDIR}${MANPREFIX}/man/man1 > >+post-install: >+ ${MKDIR} ${STAGEDIR}/var/lib/tuptime >+ ${MKDIR} ${STAGEDIR}${LOCALBASE}/etc/cron.d >+ ${INSTALL_DATA} ${FILESDIR}/cron ${STAGEDIR}${LOCALBASE}/etc/cron.d/tuptime >+ > .include <bsd.port.mk> >diff --git a/sysutils/tuptime/files/cron b/sysutils/tuptime/files/cron >new file mode 100644 >index 000000000000..833de2151cab >--- /dev/null >+++ b/sysutils/tuptime/files/cron >@@ -0,0 +1 @@ >+*/5 * * * * _tuptime (grep '^tuptime_enable="YES"' /etc/rc.conf) && /usr/local/bin/tuptime -q >diff --git a/sysutils/tuptime/files/pkg-message.in b/sysutils/tuptime/files/pkg-message.in >index 4b7aad1c04c7..15b3e98f048d 100644 >--- a/sysutils/tuptime/files/pkg-message.in >+++ b/sysutils/tuptime/files/pkg-message.in >@@ -1,16 +1,17 @@ > [ > { type: install > message: <<EOM >+##################################################################### >+ > tuptime requires execution at startup and shutdown on rc.d, please >-add it to /etc/rc.conf and start: >+enable it on "/etc/rc.conf" and start: > >- sysrc tuptime_enable=YES >+ sysrc tuptime_enable="YES" > service tuptime start > >-tuptime requires a scheduled execution on cron, please add to >-/etc/crontab: >+that also enables "%%LOCALBASE%%/etc/cron.d/tuptime" execution. > >- */5 * * * * root %%PREFIX%%/bin/tuptime -q > /dev/null >+##################################################################### > EOM > } > ] >diff --git a/sysutils/tuptime/files/tuptime.in b/sysutils/tuptime/files/tuptime.in >index e3badf86f97c..1450ed64542c 100644 >--- a/sysutils/tuptime/files/tuptime.in >+++ b/sysutils/tuptime/files/tuptime.in >@@ -4,11 +4,13 @@ > # REQUIRE: DAEMON > # KEYWORD: nojail shutdown > >+tuptime_enable=${tuptime_enable:-"NO"} >+ > . /etc/rc.subr > > name="tuptime" > rcvar=tuptime_enable >-tuptime_user="tuptime" >+tuptime_user="_tuptime" > > start_cmd="${name}_start" > stop_cmd="${name}_stop" >@@ -20,11 +22,7 @@ tuptime_start() > echo "Starting $name." > command_args="-q" > >- if /usr/sbin/pw usershow "${tuptime_user}" >/dev/null 2>&1; then >- su -m ${tuptime_user} -c "$name $command_args" >- else >- $name $command_args >- fi >+ su -m ${tuptime_user} -c "$name $command_args" 2> /dev/null || $name $command_args 2> /dev/null > } > > tuptime_stop() >@@ -32,11 +30,7 @@ tuptime_stop() > echo "Stopping $name." > command_args="-qg" > >- if /usr/sbin/pw usershow "${tuptime_user}" >/dev/null 2>&1; then >- su -m ${tuptime_user} -c "$name $command_args" >- else >- $name $command_args >- fi >+ su -m ${tuptime_user} -c "$name $command_args" 2> /dev/null || $name $command_args 2> /dev/null > } > > load_rc_config $name
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 270433
: 241090