aboutsummaryrefslogtreecommitdiff
path: root/sysutils/runit-faster/files
diff options
context:
space:
mode:
authorTobias Kortkamp <tobik@FreeBSD.org>2018-03-08 05:16:46 +0000
committerTobias Kortkamp <tobik@FreeBSD.org>2018-03-08 05:16:46 +0000
commit90c819ddbed0c272b3e273b3237ca47927859d44 (patch)
treefe8f6fbde89561b3228311aecabe406c048766fd /sysutils/runit-faster/files
parent2cf26f04eb27529698d69f1d7704f676ec425b09 (diff)
downloadports-90c819ddbed0c272b3e273b3237ca47927859d44.tar.gz
ports-90c819ddbed0c272b3e273b3237ca47927859d44.zip
Notes
Diffstat (limited to 'sysutils/runit-faster/files')
-rw-r--r--sysutils/runit-faster/files/patch-src_chkshsgr.c11
-rw-r--r--sysutils/runit-faster/files/patch-src_pathexec__run.c28
-rw-r--r--sysutils/runit-faster/files/patch-src_prot.c20
-rw-r--r--sysutils/runit-faster/files/patch-src_prot.h15
-rw-r--r--sysutils/runit-faster/files/patch-src_runit.c15
-rw-r--r--sysutils/runit-faster/files/patch-src_svlogd.c10
-rw-r--r--sysutils/runit-faster/files/patch-utmpx90
-rw-r--r--sysutils/runit-faster/files/runsvdir.in38
8 files changed, 227 insertions, 0 deletions
diff --git a/sysutils/runit-faster/files/patch-src_chkshsgr.c b/sysutils/runit-faster/files/patch-src_chkshsgr.c
new file mode 100644
index 000000000000..d88355d58005
--- /dev/null
+++ b/sysutils/runit-faster/files/patch-src_chkshsgr.c
@@ -0,0 +1,11 @@
+--- src/chkshsgr.c.orig 2018-03-05 09:33:03 UTC
++++ src/chkshsgr.c
+@@ -4,7 +4,7 @@
+
+ int main()
+ {
+- short x[4];
++ gid_t x[4];
+
+ x[0] = x[1] = 0;
+ if (getgroups(1,x) == 0) if (setgroups(1,x) == -1) _exit(1);
diff --git a/sysutils/runit-faster/files/patch-src_pathexec__run.c b/sysutils/runit-faster/files/patch-src_pathexec__run.c
new file mode 100644
index 000000000000..6dd033e247bb
--- /dev/null
+++ b/sysutils/runit-faster/files/patch-src_pathexec__run.c
@@ -0,0 +1,28 @@
+--- src/pathexec_run.c.orig 2014-08-10 18:22:35 UTC
++++ src/pathexec_run.c
+@@ -5,6 +5,7 @@
+ #include "str.h"
+ #include "env.h"
+ #include "pathexec.h"
++#include <unistd.h>
+
+ static stralloc tmp;
+
+@@ -15,7 +16,7 @@ void pathexec_run(const char *file,const char * const
+ int savederrno;
+
+ if (file[str_chr(file,'/')]) {
+- execve(file,argv,envp);
++ execve(file,(char *const *)argv,(char *const *)envp);
+ return;
+ }
+
+@@ -32,7 +33,7 @@ void pathexec_run(const char *file,const char * const
+ if (!stralloc_cats(&tmp,file)) return;
+ if (!stralloc_0(&tmp)) return;
+
+- execve(tmp.s,argv,envp);
++ execve(tmp.s,(char *const *)argv,(char * const *)envp);
+ if (errno != error_noent) {
+ savederrno = errno;
+ if ((errno != error_acces) && (errno != error_perm) && (errno != error_isdir)) return;
diff --git a/sysutils/runit-faster/files/patch-src_prot.c b/sysutils/runit-faster/files/patch-src_prot.c
new file mode 100644
index 000000000000..be141c9119b3
--- /dev/null
+++ b/sysutils/runit-faster/files/patch-src_prot.c
@@ -0,0 +1,20 @@
+--- src/prot.c.orig 2018-03-05 09:31:55 UTC
++++ src/prot.c
+@@ -3,7 +3,7 @@
+ #include "hasshsgr.h"
+ #include "prot.h"
+
+-int prot_gid(int gid)
++int prot_gid(gid_t gid)
+ {
+ #ifdef HASSHORTSETGROUPS
+ short x[2];
+@@ -15,7 +15,7 @@ int prot_gid(int gid)
+ return setgid(gid); /* _should_ be redundant, but on some systems it isn't */
+ }
+
+-int prot_uid(int uid)
++int prot_uid(uid_t uid)
+ {
+ return setuid(uid);
+ }
diff --git a/sysutils/runit-faster/files/patch-src_prot.h b/sysutils/runit-faster/files/patch-src_prot.h
new file mode 100644
index 000000000000..298aed099afe
--- /dev/null
+++ b/sysutils/runit-faster/files/patch-src_prot.h
@@ -0,0 +1,15 @@
+--- src/prot.h.orig 2018-03-05 09:38:43 UTC
++++ src/prot.h
+@@ -3,7 +3,10 @@
+ #ifndef PROT_H
+ #define PROT_H
+
+-extern int prot_gid(int);
+-extern int prot_uid(int);
++#include <sys/param.h>
++#include <unistd.h>
++
++extern int prot_gid(gid_t);
++extern int prot_uid(uid_t);
+
+ #endif
diff --git a/sysutils/runit-faster/files/patch-src_runit.c b/sysutils/runit-faster/files/patch-src_runit.c
new file mode 100644
index 000000000000..714547c222f2
--- /dev/null
+++ b/sysutils/runit-faster/files/patch-src_runit.c
@@ -0,0 +1,15 @@
+--- src/runit.c.orig 2018-03-06 14:39:19 UTC
++++ src/runit.c
+@@ -309,10 +309,10 @@ int main (int argc, const char * const *argv, char * c
+ reboot_system(RB_AUTOBOOT);
+ }
+ else {
+-#ifdef RB_POWER_OFF
++#ifdef RB_POWEROFF
+ strerr_warn2(INFO, "power off...", 0);
+ sync();
+- reboot_system(RB_POWER_OFF);
++ reboot_system(RB_POWEROFF);
+ sleep(2);
+ #endif
+ #ifdef RB_HALT_SYSTEM
diff --git a/sysutils/runit-faster/files/patch-src_svlogd.c b/sysutils/runit-faster/files/patch-src_svlogd.c
new file mode 100644
index 000000000000..66e3b2f46987
--- /dev/null
+++ b/sysutils/runit-faster/files/patch-src_svlogd.c
@@ -0,0 +1,10 @@
+--- src/svlogd.c.orig 2014-08-10 18:22:34 UTC
++++ src/svlogd.c
+@@ -430,6 +430,7 @@ unsigned int logdir_open(struct logdir *ld, const char
+ ld->name =(char*)fn;
+ ld->ppid =0;
+ ld->match ='+';
++ ld->udpaddr.sin_family =AF_INET;
+ ld->udpaddr.sin_port =0;
+ ld->udponly =0;
+ while (! stralloc_copys(&ld->prefix, "")) pause_nomem();
diff --git a/sysutils/runit-faster/files/patch-utmpx b/sysutils/runit-faster/files/patch-utmpx
new file mode 100644
index 000000000000..ede6ce74285c
--- /dev/null
+++ b/sysutils/runit-faster/files/patch-utmpx
@@ -0,0 +1,90 @@
+Since init lacks this code in FreeBSD (utx-logout is performed in pam_lastlog)
+we will simply make utmpset.c a noop if utmpx is present.
+
+http://lists.freebsd.org/pipermail/freebsd-ports/2011-May/067872.html
+
+--- src/tryuwtmpx.c.orig 2014-08-10 18:22:35 UTC
++++ src/tryuwtmpx.c
+@@ -1,9 +1,9 @@
+ #include <sys/types.h>
+ #include <utmpx.h>
+
+-struct futmpx ut;
++struct utmpx ut;
+
+ int main(void) {
+- char *s =ut.ut_name;
++ char *s =ut.ut_user;
+ return(0);
+ }
+--- src/utmpset.c.orig 2014-08-10 18:22:35 UTC
++++ src/utmpset.c
+@@ -22,6 +22,11 @@ const char *progname;
+ void usage(void) { strerr_die4x(1, "usage: ", progname, USAGE, "\n"); }
+
+ int utmp_logout(const char *line) {
++
++#ifdef _UW_TMP_UTMPX
++ int ok = 1; /* do_nada(); */
++#else /* _UW_TMP_UTMP */
++
+ int fd;
+ uw_tmp ut;
+ int ok =-1;
+@@ -45,9 +50,13 @@ int utmp_logout(const char *line) {
+ break;
+ }
+ close(fd);
++#endif /* _UW_TMP_UTMPX */
+ return(ok);
+ }
+ int wtmp_logout(const char *line) {
++#ifdef _UW_TMP_UTMPX
++ return 1; /* do_nada(); */
++#else /* _UW_TMP_UTMP */
+ int fd;
+ int len;
+ struct stat st;
+@@ -79,6 +88,7 @@ int wtmp_logout(const char *line) {
+ }
+ close(fd);
+ return(1);
++#endif /* _UW_TMP_UTMPX */
+ }
+
+ int main (int argc, const char * const *argv, const char * const *envp) {
+--- src/uw_tmp.h1.orig 2014-08-10 18:22:35 UTC
++++ src/uw_tmp.h1
+@@ -3,6 +3,8 @@
+
+ /* sysdep: -utmpx */
+
++#ifndef _UW_TMP_UTMP
++#define _UW_TMP_UTMP
+ #ifdef _PATH_UTMP
+ #define UW_TMP_UFILE _PATH_UTMP
+ #define UW_TMP_WFILE _PATH_WTMP
+@@ -17,3 +19,4 @@
+ #endif
+
+ typedef struct utmp uw_tmp;
++#endif /* _UW_TMP_UTMP */
+--- src/uw_tmp.h2.orig 2014-08-10 18:22:35 UTC
++++ src/uw_tmp.h2
+@@ -3,11 +3,12 @@
+
+ /* sysdep: +utmpx */
+
+-#define UW_TMP_UFILE _UTMPX_FILE
+-#define UW_TMP_WFILE _WTMPX_FILE
+-
++#ifndef _UW_TMP_UTMPX
++#define _UW_TMP_UTMPX
+ #ifndef ut_time
+ #define ut_time ut_tv.tv_sec
+ #endif
+
+-typedef struct futmpx uw_tmp;
++typedef struct utmpx uw_tmp;
++
++#endif /* _UW_TMP_UTMPX */
diff --git a/sysutils/runit-faster/files/runsvdir.in b/sysutils/runit-faster/files/runsvdir.in
new file mode 100644
index 000000000000..e2a09fa5e0ec
--- /dev/null
+++ b/sysutils/runit-faster/files/runsvdir.in
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: runsvdir
+# BEFORE: SERVERS
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf to enable `runsvdir':
+#
+# runsvdir_enable="YES"
+# runsvdir_path="/var/service"
+
+. /etc/rc.subr
+
+name=runsvdir
+desc="starts and monitors a collection of runsv(8) processes"
+rcvar=runsvdir_enable
+
+load_rc_config runsvdir
+
+: ${runsvdir_enable:=NO}
+: ${runsvdir_path=/var/service}
+
+command="%%PREFIX%%/sbin/runsvdir"
+start_cmd=runsvdir_start
+stop_postcmd="%%PREFIX%%/sbin/sv exit ${runsvdir_path}/*"
+
+runsvdir_start()
+{
+ /bin/test -d ${runsvdir_path} || /bin/mkdir -p ${runsvdir_path}
+ /usr/bin/env -i \
+ PATH=/command:%%PREFIX%%/sbin:%%PREFIX%%/bin:/sbin:/bin:/usr/sbin:/usr/bin \
+ /usr/sbin/daemon -c -f \
+ ${command} ${runsvdir_path}
+}
+
+run_rc_command $1