summaryrefslogtreecommitdiffstats
path: root/smgl
diff options
context:
space:
mode:
authorIsmael Luceno2020-08-11 22:24:37 +0200
committerIsmael Luceno2020-08-11 22:27:18 +0200
commitd74e9d92edaa8498ce5bc70cbad11ec6811ea45b (patch)
tree32c33bc1b5c9672d99adffb14010389d2281bb98 /smgl
parente3fe3ce408ef8468d37034991f279321667fafbc (diff)
runit: new spell, A UNIX init scheme with service supervision
Diffstat (limited to 'smgl')
-rwxr-xr-xsmgl/runit/BUILD1
-rwxr-xr-xsmgl/runit/DETAILS19
-rw-r--r--smgl/runit/HISTORY3
-rwxr-xr-xsmgl/runit/INSTALL6
-rwxr-xr-xsmgl/runit/PRE_BUILD3
-rw-r--r--smgl/runit/patches/svlogd.patch13
-rw-r--r--smgl/runit/patches/utmpset-time_t.patch56
7 files changed, 101 insertions, 0 deletions
diff --git a/smgl/runit/BUILD b/smgl/runit/BUILD
new file mode 100755
index 0000000000..1482010c7e
--- /dev/null
+++ b/smgl/runit/BUILD
@@ -0,0 +1 @@
+${MAKE:-make} -j "$MAKE_NJOBS" -C src
diff --git a/smgl/runit/DETAILS b/smgl/runit/DETAILS
new file mode 100755
index 0000000000..bfb5c830b1
--- /dev/null
+++ b/smgl/runit/DETAILS
@@ -0,0 +1,19 @@
+ SPELL=runit
+ VERSION=2.1.2
+ SOURCE="$SPELL-$VERSION.tar.gz"
+ SOURCE_URL[0]="http://smarden.org/$SPELL/$SOURCE"
+ SOURCE_HASH=sha512:a18773ebf1aa22305dd89ed67363165b9fcf86c192b2be4e268d08005dd82d51265160c637abe072f2f2e378c4b315a75bd3d3e602c3e75bdd451a3b0190f8cf
+SOURCE_DIRECTORY="$BUILD_DIRECTORY/admin/$SPELL-$VERSION"
+ WEB_SITE="http://smarden.org/runit/"
+ LICENSE[0]="BSD-3-Clause"
+ ENTERED=20200811
+ KEYWORDS=""
+ SHORT="A UNIX init scheme with service supervision"
+cat << EOF
+runit is a collection of tools to provide system-wide service supervision and
+to manage services. Contrary to sysv init, it not only cares about starting
+and stopping services, but also supervises the service daemons while they
+are running. Amongst other things, it provides a reliable interface to send
+signals to service daemons without the need for pid-files, and a log facility
+with automatic log file rotation and disk space limits.
+EOF
diff --git a/smgl/runit/HISTORY b/smgl/runit/HISTORY
new file mode 100644
index 0000000000..5998138101
--- /dev/null
+++ b/smgl/runit/HISTORY
@@ -0,0 +1,3 @@
+2020-08-11 Ismael Luceno <ismael@sourcemage.org>
+ * BUILD, DETAILS, INSTALL, PRE_BUILD, patches/svlogd.patch,
+ patches/utmpset-time_t.patch: spell created
diff --git a/smgl/runit/INSTALL b/smgl/runit/INSTALL
new file mode 100755
index 0000000000..5c767cbc5a
--- /dev/null
+++ b/smgl/runit/INSTALL
@@ -0,0 +1,6 @@
+progs=(chpst runit runit-init runsv runsvchdir runsvdir sv svlogd utmpset) &&
+manuals=("${progs[@]/%/.8}") &&
+cd src &&
+install -v -D -m555 "${progs[@]}" "$INSTALL_ROOT"/sbin/ &&
+cd ../man &&
+install -v -D -m644 "${manuals[@]}" "$INSTALL_ROOT"/usr/share/man/man8/
diff --git a/smgl/runit/PRE_BUILD b/smgl/runit/PRE_BUILD
new file mode 100755
index 0000000000..c230ad14bf
--- /dev/null
+++ b/smgl/runit/PRE_BUILD
@@ -0,0 +1,3 @@
+default_pre_build &&
+cd "$SOURCE_DIRECTORY" &&
+apply_patch_dir patches
diff --git a/smgl/runit/patches/svlogd.patch b/smgl/runit/patches/svlogd.patch
new file mode 100644
index 0000000000..2166821100
--- /dev/null
+++ b/smgl/runit/patches/svlogd.patch
@@ -0,0 +1,13 @@
+Initialize all fields of sockaddr_in.
+http://skarnet.org/cgi-bin/archive.cgi?2:mss:1163:201602:gpiglpbjdemlioaeabbn
+
+--- runit-2.1.2/src/svlogd.c 2014-08-10 15:22:34.000000000 -0300
++++ runit-2.1.2/src/svlogd.c 2016-02-04 22:53:52.910965361 -0300
+@@ -430,6 +430,7 @@
+ 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/smgl/runit/patches/utmpset-time_t.patch b/smgl/runit/patches/utmpset-time_t.patch
new file mode 100644
index 0000000000..fabf853900
--- /dev/null
+++ b/smgl/runit/patches/utmpset-time_t.patch
@@ -0,0 +1,56 @@
+From 20a0afcd367666efc17c59cf121a0d991ff1bd09 Mon Sep 17 00:00:00 2001
+From: Gerrit Pape <pape@smarden.org>
+Date: Thu, 31 Jul 2014 12:25:49 +0000
+Subject: [PATCH] utmpset.c: mixes "int32_t *" and "time_t *"
+
+Don't pass int32_t to time(), thx Lorenzo Beretta,
+https://bugs.debian.org/754849
+---
+ runit-2.1.2/src/utmpset.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/runit-2.1.2/src/utmpset.c b/runit-2.1.2/src/utmpset.c
+index eea41a5..2e8a525 100644
+--- runit-2.1.2/src/utmpset.c
++++ runit-2.1.2/src/utmpset.c
+@@ -24,6 +24,7 @@ void usage(void) { strerr_die4x(1, "usage: ", progname, USAGE, "\n"); }
+ int utmp_logout(const char *line) {
+ int fd;
+ uw_tmp ut;
++ time_t t;
+ int ok =-1;
+
+ if ((fd =open(UW_TMP_UFILE, O_RDWR, 0)) < 0)
+@@ -35,7 +36,8 @@ int utmp_logout(const char *line) {
+ if (!ut.ut_name[0] || (str_diff(ut.ut_line, line) != 0)) continue;
+ memset(ut.ut_name, 0, sizeof ut.ut_name);
+ memset(ut.ut_host, 0, sizeof ut.ut_host);
+- if (time(&ut.ut_time) == -1) break;
++ if (time(&t) == -1) break;
++ ut.ut_time = t;
+ #ifdef DEAD_PROCESS
+ ut.ut_type =DEAD_PROCESS;
+ #endif
+@@ -52,6 +54,7 @@ int wtmp_logout(const char *line) {
+ int len;
+ struct stat st;
+ uw_tmp ut;
++ time_t t;
+
+ if ((fd = open_append(UW_TMP_WFILE)) == -1)
+ strerr_die4sys(111, FATAL, "unable to open ", UW_TMP_WFILE, ": ");
+@@ -65,10 +68,11 @@ int wtmp_logout(const char *line) {
+ memset(&ut, 0, sizeof(uw_tmp));
+ if ((len =str_len(line)) > sizeof ut.ut_line) len =sizeof ut.ut_line -2;
+ byte_copy(ut.ut_line, len, line);
+- if (time(&ut.ut_time) == -1) {
++ if (time(&t) == -1) {
+ close(fd);
+ return(-1);
+ }
++ ut.ut_time = t;
+ #ifdef DEAD_PROCESS
+ ut.ut_type =DEAD_PROCESS;
+ #endif
+--
+2.0.1