Date: Thu, 8 Mar 2018 05:16:46 +0000 (UTC) From: Tobias Kortkamp <tobik@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r463865 - in head/sysutils: . runit-faster runit-faster/files Message-ID: <201803080516.w285GkkK095229@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tobik Date: Thu Mar 8 05:16:46 2018 New Revision: 463865 URL: https://svnweb.freebsd.org/changeset/ports/463865 Log: New port: sysutils/runit-faster Runit is a daemontools replacement with the following features: - Service supervision - Clean process state - Reliable logging facility - Fast system bootup and shutdown - Packaging friendly - Small code size This very experimental port comes with a complete suite of configuration files and services to replace init(8) and rc(8) with runit for initializing your system. Heavily inspired by Void Linux' init scripts. For usage instructions visit: https://people.freebsd.org/~tobik/runit-faster.html Some fixes applied to sysutils/runit: - Fix most compiler warnings - Fix bug where runit will only halt the system instead of powering it off - Pet rclint for runsvdir - Pet portlint and regenerate patches Added: head/sysutils/runit-faster/ - copied from r463545, head/sysutils/runit/ head/sysutils/runit-faster/files/patch-src_chkshsgr.c (contents, props changed) head/sysutils/runit-faster/files/patch-src_pathexec__run.c (contents, props changed) head/sysutils/runit-faster/files/patch-src_prot.c (contents, props changed) head/sysutils/runit-faster/files/patch-src_prot.h (contents, props changed) head/sysutils/runit-faster/pkg-message - copied, changed from r463545, head/sysutils/runit/files/pkg-message.in Deleted: head/sysutils/runit-faster/files/patch-etc_freebsd_finish head/sysutils/runit-faster/files/patch-etc_freebsd_run head/sysutils/runit-faster/files/patch-etc_freebsd_whichtty head/sysutils/runit-faster/files/patch-src_runit-init.c head/sysutils/runit-faster/files/pkg-message.in Modified: head/sysutils/Makefile head/sysutils/runit-faster/Makefile head/sysutils/runit-faster/distinfo head/sysutils/runit-faster/files/patch-src_runit.c head/sysutils/runit-faster/files/patch-src_svlogd.c head/sysutils/runit-faster/files/patch-utmpx head/sysutils/runit-faster/files/runsvdir.in head/sysutils/runit-faster/pkg-descr head/sysutils/runit-faster/pkg-plist Modified: head/sysutils/Makefile ============================================================================== --- head/sysutils/Makefile Thu Mar 8 04:43:03 2018 (r463864) +++ head/sysutils/Makefile Thu Mar 8 05:16:46 2018 (r463865) @@ -1078,6 +1078,7 @@ SUBDIR += rubygem-yell SUBDIR += rundeck SUBDIR += runit + SUBDIR += runit-faster SUBDIR += runwhen SUBDIR += s6 SUBDIR += s6-rc Modified: head/sysutils/runit-faster/Makefile ============================================================================== --- head/sysutils/runit/Makefile Sun Mar 4 00:56:31 2018 (r463545) +++ head/sysutils/runit-faster/Makefile Thu Mar 8 05:16:46 2018 (r463865) @@ -2,66 +2,96 @@ # $FreeBSD$ PORTNAME= runit -PORTVERSION= 2.1.2 -PORTREVISION= 3 +DISTVERSION= 2.1.2-0.1.13 +RUNITVERSION= ${DISTVERSION:C/(.*)-(.*)/\1/} +CONFVERSION= ${DISTVERSION:C/(.*)-(.*)/\2/} CATEGORIES= sysutils -MASTER_SITES= http://smarden.org/${PORTNAME}/ \ - http://www.bayofrum.net/dist/${PORTNAME}/ +MASTER_SITES= http://smarden.org/runit/ \ + http://www.bayofrum.net/dist/runit/ \ + LOCAL/tobik:config \ + https://pkg.tobik.me/distfiles/:config +PKGNAMESUFFIX= -faster +DISTFILES= runit-${RUNITVERSION}${EXTRACT_SUFX} \ + freebsd-runit-${CONFVERSION}${EXTRACT_SUFX}:config -MAINTAINER= crees@FreeBSD.org -COMMENT= Service supervision tools compatible with DJB daemontools +MAINTAINER= tobik@FreeBSD.org +COMMENT= Runit based init replacement for ${OPSYS} LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/package/COPYING +RUN_DEPENDS= snooze:sysutils/snooze + +CONFLICTS_INSTALL= runit + +PLIST_SUB= RUNITDIR=${RUNITDIR} USE_RC_SUBR= runsvdir -WRKSRC= ${WRKDIR}/admin/${DISTNAME} +WRKSRC= ${WRKDIR}/admin/runit-${RUNITVERSION} -SERVICE_DIR?= /var/service -SUB_FILES= pkg-message -SUB_LIST= SERVICE_DIR="${SERVICE_DIR}" -PORTDOCS= * +OPTIONS_DEFINE= DOCS ROOT -DOCS= package/CHANGES package/README \ - package/THANKS doc/*.html -CONFIG= etc/freebsd/1 etc/2 etc/freebsd/3 etc/freebsd/ctrlaltdel \ - etc/freebsd/getty-ttyv4/run etc/freebsd/getty-ttyv4/finish \ - etc/freebsd/getty-ttyv4/whichtty +ROOT_DESC= Install bootstrap files into /etc/runit and /sbin -OPTIONS_DEFINE= DOCS +PORTDOCS= * +ROOT_VARS= RUNITDIR=/etc/runit SBINDIR=/sbin +ROOT_VARS_OFF= RUNITDIR=${PREFIX}/etc/runit SBINDIR=${PREFIX}/sbin + post-patch: - ${REINPLACE_CMD} -i '' 's!/service/!${SERVICE_DIR}!' \ - ${PATCH_WRKSRC}/man/* ${PATCH_WRKSRC}/src/sv.c - ${REINPLACE_CMD} -i '' '\|^PATH=|s|$$|:${PREFIX}/bin:${PREFIX}/sbin|' \ - ${PATCH_WRKSRC}/etc/freebsd/3 - ${FIND} ${PATCH_WRKSRC} -name '*.orig' -delete + @${REINPLACE_CMD} -e 's,/service/,/var/service,' \ + -e 's,/etc/runit,${RUNITDIR},' \ + -e 's,/sbin/runit,${SBINDIR}/runit,' \ + ${WRKSRC}/man/* ${WRKSRC}/doc/*.html \ + ${WRKSRC}/src/sv.c \ + ${WRKSRC}/src/runsvchdir.c \ + ${WRKSRC}/src/runit.c \ + ${WRKSRC}/src/runit.h do-configure: - ${ECHO_CMD} "${CC} ${CFLAGS}" > ${WRKSRC}/src/conf-cc - ${ECHO_CMD} "${CC}" > ${WRKSRC}/src/conf-ld - ${ECHO_CMD} '#define PREFIX "${PREFIX}"' >> ${WRKSRC}/src/runit.h + @${ECHO_CMD} "${CC} ${CFLAGS}" > ${WRKSRC}/src/conf-cc + @${ECHO_CMD} "${CC}" > ${WRKSRC}/src/conf-ld do-build: - cd ${WRKSRC} && package/compile && package/check - @${MKDIR} ${WRKDIR}/etc/getty-ttyv4 -.for file in ${CONFIG} - @${SED} -e 's!/etc/runit!${ETCDIR}!g' \ - -e 's!/service!${SERVICE_DIR}!g' \ - -e 's!/usr/local!${PREFIX}!g' \ - ${WRKSRC}/${file} > ${WRKDIR}/${file:S!freebsd/!!}.sample -.endfor + @cd ${WRKSRC} && package/compile do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/command/* ${STAGEDIR}${PREFIX}/sbin - ${INSTALL_MAN} ${WRKSRC}/man/* ${STAGEDIR}${PREFIX}/man/man8/ - @${MKDIR} ${STAGEDIR}${ETCDIR}/getty-ttyv4 - ${INSTALL_SCRIPT} ${WRKDIR}/etc/[123c]* ${STAGEDIR}${ETCDIR} - ${INSTALL_SCRIPT} ${WRKDIR}/etc/getty-ttyv4/* \ - ${STAGEDIR}${ETCDIR}/getty-ttyv4 + @${MKDIR} ${STAGEDIR}${RUNITDIR} ${STAGEDIR}${SBINDIR} + ${INSTALL_PROGRAM} ${WRKSRC}/command/* ${STAGEDIR}${SBINDIR} + ${INSTALL_MAN} ${WRKSRC}/man/*.8 ${STAGEDIR}${PREFIX}/man/man8 + @${DO_MAKE_BUILD} -C ${WRKDIR}/freebsd-runit-${CONFVERSION} \ + DESTDIR=${STAGEDIR} \ + LOCALBASE=${LOCALBASE} \ + PREFIX=${PREFIX} \ + RUNITDIR=${RUNITDIR} \ + SVDIR=${PREFIX}/etc/sv \ + install +# Point runit to the run directory (a necessity to let runit work on +# read-only root filesystems) and make sure rebooting and powering off +# can work correctly. + @${LN} -s /var/run/runit/reboot ${STAGEDIR}${RUNITDIR}/reboot + @${LN} -s /var/run/runit/stopit ${STAGEDIR}${RUNITDIR}/stopit do-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} - ${INSTALL_DATA} ${DOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR} + cd ${WRKSRC} && ${INSTALL_DATA} \ + package/CHANGES package/README package/THANKS doc/*.html \ + ${STAGEDIR}${DOCSDIR} + +post-install: +# Micromanaging pkg-plist is no fun here... Generate it on the fly +# instead. + @${FIND} -s ${STAGEDIR}${RUNITDIR} ${STAGEDIR}${PREFIX}/etc/sv ${STAGEDIR}${SBINDIR} \ + -not -type d | ${SORT} | ${SED} \ + -e 's,^${STAGEDIR},,' \ + -e 's,^${PREFIX}/,,' \ + >> ${TMPPLIST} + @${FIND} -s ${STAGEDIR}${RUNITDIR} ${STAGEDIR}${PREFIX}/etc/sv ${STAGEDIR}${SBINDIR} \ + -type d | ${SORT} | ${SED} \ + -e 's,^${STAGEDIR},,' \ + -e 's,^${PREFIX}/,,' \ + -e 's,^,@dir ,' >> ${TMPPLIST} + +do-test: + @cd ${WRKSRC} && package/check .include <bsd.port.mk> Modified: head/sysutils/runit-faster/distinfo ============================================================================== --- head/sysutils/runit/distinfo Sun Mar 4 00:56:31 2018 (r463545) +++ head/sysutils/runit-faster/distinfo Thu Mar 8 05:16:46 2018 (r463865) @@ -1,2 +1,5 @@ +TIMESTAMP = 1520485557 SHA256 (runit-2.1.2.tar.gz) = 6fd0160cb0cf1207de4e66754b6d39750cff14bb0aa66ab49490992c0c47ba18 SIZE (runit-2.1.2.tar.gz) = 110916 +SHA256 (freebsd-runit-0.1.13.tar.gz) = d7c7dd66f5fdd06ebf80c5348cf05796a3e0abddacc456e6955da33b88ac1fab +SIZE (freebsd-runit-0.1.13.tar.gz) = 14164 Added: head/sysutils/runit-faster/files/patch-src_chkshsgr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/runit-faster/files/patch-src_chkshsgr.c Thu Mar 8 05:16:46 2018 (r463865) @@ -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); Added: head/sysutils/runit-faster/files/patch-src_pathexec__run.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/runit-faster/files/patch-src_pathexec__run.c Thu Mar 8 05:16:46 2018 (r463865) @@ -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; Added: head/sysutils/runit-faster/files/patch-src_prot.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/runit-faster/files/patch-src_prot.c Thu Mar 8 05:16:46 2018 (r463865) @@ -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); + } Added: head/sysutils/runit-faster/files/patch-src_prot.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/runit-faster/files/patch-src_prot.h Thu Mar 8 05:16:46 2018 (r463865) @@ -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 Modified: head/sysutils/runit-faster/files/patch-src_runit.c ============================================================================== --- head/sysutils/runit/files/patch-src_runit.c Sun Mar 4 00:56:31 2018 (r463545) +++ head/sysutils/runit-faster/files/patch-src_runit.c Thu Mar 8 05:16:46 2018 (r463865) @@ -1,49 +1,15 @@ -Should the user neglect to add the symlink, rather than stick them in a -reboot loop give a warning. - ---- src/runit.c.orig 2016-08-10 21:03:05 UTC +--- src/runit.c.orig 2018-03-06 14:39:19 UTC +++ src/runit.c -@@ -22,10 +22,13 @@ - #define WARNING "- runit: warning: " - #define FATAL "- runit: fatal: " - --const char * const stage[3] ={ -+const char * const stage[] ={ - "/etc/runit/1", - "/etc/runit/2", -- "/etc/runit/3" }; -+ "/etc/runit/3", -+ PREFIX "/etc/runit/1", -+ PREFIX "/etc/runit/2", -+ PREFIX "/etc/runit/3" }; - - int selfpipe[2]; - int sigc =0; -@@ -134,6 +137,13 @@ int main (int argc, const char * const * - - strerr_warn3(INFO, "enter stage: ", stage[st], 0); - execve(*prog, (char *const *)prog, envp); -+ /* Try with PREFIX */ -+ prog[0] = stage[st+3]; -+ strerr_warn3(INFO, -+ "Trying in " PREFIX "; not found in /etc: ", stage[st], 0); -+ strerr_warn3(INFO, -+ "Must run ln -s " PREFIX "/etc/runit /etc/ to work!", stage[st], 0); -+ execve(*prog, (char *const *)prog, envp); - strerr_die4sys(0, FATAL, "unable to start child: ", stage[st], ": "); - } - -@@ -229,6 +239,13 @@ int main (int argc, const char * const * - /* child */ - strerr_warn3(INFO, "enter stage: ", prog[0], 0); - execve(*prog, (char *const *) prog, envp); -+ /* Try with PREFIX */ -+ prog[0] = stage[st+3]; -+ strerr_warn3(INFO, -+ "Trying in " PREFIX "; not found: ", stage[st], 0); -+ strerr_warn3(INFO, -+ "Must run ln -s " PREFIX "/etc/runit /etc/ to work!", stage[st], 0); -+ execve(*prog, (char *const *) prog, envp); - strerr_die4sys(0, FATAL, "unable to start child: ", prog[0], ": "); - } - if (wait_pid(&wstat, pid2) == -1) +@@ -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 Modified: head/sysutils/runit-faster/files/patch-src_svlogd.c ============================================================================== --- head/sysutils/runit/files/patch-src_svlogd.c Sun Mar 4 00:56:31 2018 (r463545) +++ head/sysutils/runit-faster/files/patch-src_svlogd.c Thu Mar 8 05:16:46 2018 (r463865) @@ -1,6 +1,6 @@ --- src/svlogd.c.orig 2014-08-10 18:22:34 UTC +++ src/svlogd.c -@@ -430,6 +430,7 @@ unsigned int logdir_open(struct logdir * +@@ -430,6 +430,7 @@ unsigned int logdir_open(struct logdir *ld, const char ld->name =(char*)fn; ld->ppid =0; ld->match ='+'; Modified: head/sysutils/runit-faster/files/patch-utmpx ============================================================================== --- head/sysutils/runit/files/patch-utmpx Sun Mar 4 00:56:31 2018 (r463545) +++ head/sysutils/runit-faster/files/patch-utmpx Thu Mar 8 05:16:46 2018 (r463865) @@ -3,9 +3,8 @@ we will simply make utmpset.c a noop if utmpx is prese http://lists.freebsd.org/pipermail/freebsd-ports/2011-May/067872.html -diff -ruN ../runit-2.0.0.orig/src/tryuwtmpx.c ./src/tryuwtmpx.c ---- ../runit-2.0.0.orig/src/tryuwtmpx.c 2008-06-15 21:53:26.000000000 +0100 -+++ ./src/tryuwtmpx.c 2011-05-21 21:47:36.834727936 +0100 +--- 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> @@ -18,10 +17,9 @@ diff -ruN ../runit-2.0.0.orig/src/tryuwtmpx.c ./src/tr + char *s =ut.ut_user; return(0); } -diff -ruN ../runit-2.0.0.orig/src/utmpset.c ./src/utmpset.c ---- ../runit-2.0.0.orig/src/utmpset.c 2008-06-15 21:53:26.000000000 +0100 -+++ ./src/utmpset.c 2011-05-24 19:11:50.186633061 +0100 -@@ -22,6 +22,11 @@ +--- 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) { @@ -33,7 +31,7 @@ diff -ruN ../runit-2.0.0.orig/src/utmpset.c ./src/utmp int fd; uw_tmp ut; int ok =-1; -@@ -45,9 +50,13 @@ +@@ -45,9 +50,13 @@ int utmp_logout(const char *line) { break; } close(fd); @@ -47,7 +45,7 @@ diff -ruN ../runit-2.0.0.orig/src/utmpset.c ./src/utmp int fd; int len; struct stat st; -@@ -79,6 +88,7 @@ +@@ -79,6 +88,7 @@ int wtmp_logout(const char *line) { } close(fd); return(1); @@ -55,9 +53,8 @@ diff -ruN ../runit-2.0.0.orig/src/utmpset.c ./src/utmp } int main (int argc, const char * const *argv, const char * const *envp) { -diff -ruN ../runit-2.0.0.orig/src/uw_tmp.h1 ./src/uw_tmp.h1 ---- ../runit-2.0.0.orig/src/uw_tmp.h1 2008-06-15 21:53:26.000000000 +0100 -+++ ./src/uw_tmp.h1 2011-05-24 19:12:55.575957224 +0100 +--- src/uw_tmp.h1.orig 2014-08-10 18:22:35 UTC ++++ src/uw_tmp.h1 @@ -3,6 +3,8 @@ /* sysdep: -utmpx */ @@ -72,9 +69,8 @@ diff -ruN ../runit-2.0.0.orig/src/uw_tmp.h1 ./src/uw_t typedef struct utmp uw_tmp; +#endif /* _UW_TMP_UTMP */ -diff -ruN ../runit-2.0.0.orig/src/uw_tmp.h2 ./src/uw_tmp.h2 ---- ../runit-2.0.0.orig/src/uw_tmp.h2 2008-06-15 21:53:26.000000000 +0100 -+++ ./src/uw_tmp.h2 2011-05-24 19:13:16.542222974 +0100 +--- src/uw_tmp.h2.orig 2014-08-10 18:22:35 UTC ++++ src/uw_tmp.h2 @@ -3,11 +3,12 @@ /* sysdep: +utmpx */ Modified: head/sysutils/runit-faster/files/runsvdir.in ============================================================================== --- head/sysutils/runit/files/runsvdir.in Sun Mar 4 00:56:31 2018 (r463545) +++ head/sysutils/runit-faster/files/runsvdir.in Thu Mar 8 05:16:46 2018 (r463865) @@ -2,25 +2,25 @@ # # $FreeBSD$ # -# PROVIDE: /service +# PROVIDE: runsvdir # BEFORE: SERVERS # KEYWORD: shutdown - +# # Add the following lines to /etc/rc.conf to enable `runsvdir': # -#runsvdir_enable="YES" (default: NO) -#runsvdir_path="/service" (default: %%SERVICE_DIR%%) -# +# 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=%%SERVICE_DIR%%} +: ${runsvdir_path=/var/service} command="%%PREFIX%%/sbin/runsvdir" start_cmd=runsvdir_start Modified: head/sysutils/runit-faster/pkg-descr ============================================================================== --- head/sysutils/runit/pkg-descr Sun Mar 4 00:56:31 2018 (r463545) +++ head/sysutils/runit-faster/pkg-descr Thu Mar 8 05:16:46 2018 (r463865) @@ -1,11 +1,15 @@ -runit is daemontools replacement: -- service supervision -- clean process state -- reliable logging facility -- fast system bootup and shutdown -- packaging friendly -- small code size +Runit is a daemontools replacement with the following features: -It can optionally replace init(8) as process 1. +- Service supervision +- Clean process state +- Reliable logging facility +- Fast system bootup and shutdown +- Packaging friendly +- Small code size + +This very experimental port comes with a complete suite of +configuration files and services to replace init(8) and rc(8) with +runit for initializing your system. Heavily inspired by Void Linux' +init scripts. WWW: http://smarden.org/runit/ Copied and modified: head/sysutils/runit-faster/pkg-message (from r463545, head/sysutils/runit/files/pkg-message.in) ============================================================================== --- head/sysutils/runit/files/pkg-message.in Sun Mar 4 00:56:31 2018 (r463545, copy source) +++ head/sysutils/runit-faster/pkg-message Thu Mar 8 05:16:46 2018 (r463865) @@ -1,43 +1,2 @@ -Using runit with FreeBSD init: - -# mkdir %%SERVICE_DIR%% -# cp -R %%PREFIX%%/etc/runit /etc/runit -# echo runsvdir_enable=yes >> /etc/rc.conf - -runit is very easily used instead of init on FreeBSD, but the port maintainer -suggests the following alternative method (as opposed to the website method): - -1. Copy all of the etc files from %%PREFIX%%/etc/runit to /etc/runit; - -# cp -R %%PREFIX%%/etc/runit /etc/runit - -2. Copy runit-init AND runit into /sbin; - -# cp /usr/local/sbin/runit* /sbin - -3. Create service directories, enable ttyv4 and disable it in ttys: - -# mkdir %%SERVICE_DIR%% -# cp -R /etc/runit/getty-ttyv4 %%SERVICE_DIR%% -# sed 's/^ttyv4/#&/' /etc/ttys - -(The getty-ttyvx directory will getty on whichever vtty x is on, for example - # cp -R %%SERVICE_DIR%%/getty-ttyv4 %%SERVICE_DIR%%/getty-ttyv3 - will result in a tty on ttyv3 as well) - -4. Don't replace FreeBSD init in place, tell loader to use runit instead: - -# echo 'init_path="/sbin/runit-init:/sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init"' >> /boot/loader.conf - -5. Reboot! - -Note: On FreeBSD, runit-init works in %%PREFIX%%/sbin, but - *only* if %%PREFIX%%/sbin is on the same filesystem as /; check with: - -# df %%PREFIX%%/sbin/runit | sed -ne 's,.* /,/,p' # If this does not return "/" - - If the output is "/", you may skip step 2 and modify step 4: - -# echo 'init_path="%%PREFIX%%/sbin/runit-init:/sbin/init:/sbin/oninit:/sbin/init.bak:/rescue/init"' >> /boot/loader.conf - - making upgrades easier. +Please see https://people.freebsd.org/~tobik/runit-faster.html for +usage intstructions. Modified: head/sysutils/runit-faster/pkg-plist ============================================================================== --- head/sysutils/runit/pkg-plist Sun Mar 4 00:56:31 2018 (r463545) +++ head/sysutils/runit-faster/pkg-plist Thu Mar 8 05:16:46 2018 (r463865) @@ -1,10 +1,3 @@ -@sample %%ETCDIR%%/1.sample -@sample %%ETCDIR%%/2.sample -@sample %%ETCDIR%%/3.sample -@sample %%ETCDIR%%/ctrlaltdel.sample -@sample %%ETCDIR%%/getty-ttyv4/run.sample -@sample %%ETCDIR%%/getty-ttyv4/finish.sample -@sample %%ETCDIR%%/getty-ttyv4/whichtty.sample man/man8/chpst.8.gz man/man8/runit-init.8.gz man/man8/runit.8.gz @@ -14,12 +7,7 @@ man/man8/runsvdir.8.gz man/man8/sv.8.gz man/man8/svlogd.8.gz man/man8/utmpset.8.gz -sbin/chpst -sbin/runit -sbin/runit-init -sbin/runsv -sbin/runsvchdir -sbin/runsvdir -sbin/sv -sbin/svlogd -sbin/utmpset +@postexec [ ! -e %%RUNITDIR%%/runsvdir/current ] && cd %%RUNITDIR%%/runsvdir && ln -s default current +@postunexec rm -f %%RUNITDIR%%/runsvdir/current +@postexec ln -sf /var/run/runit/runsvdir/current /var/service +@postunexec rm -f /var/service
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803080516.w285GkkK095229>