pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/rc.d-boot Initial version of rc.d-boot, a pac...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/85f09c16d884
branches:  trunk
changeset: 316130:85f09c16d884
user:      schmonz <schmonz%pkgsrc.org@localhost>
date:      Wed Dec 05 19:23:04 2018 +0000

description:
Initial version of rc.d-boot, a package that runs all rc.conf-enabled
rc.d scripts at boot time as one "service" in your operating system's
normal boot process. Just Darwin so far. Please pitch in for your
preferred OS!

diffstat:

 pkgtools/rc.d-boot/DESCR                            |   2 +
 pkgtools/rc.d-boot/INSTALL                          |  10 ++++++
 pkgtools/rc.d-boot/Makefile                         |  35 +++++++++++++++++++++
 pkgtools/rc.d-boot/PLIST                            |   3 +
 pkgtools/rc.d-boot/files/org.pkgsrc.rc.d-boot.plist |  23 +++++++++++++
 pkgtools/rc.d-boot/files/rc.d-boot                  |  31 ++++++++++++++++++
 6 files changed, 104 insertions(+), 0 deletions(-)

diffs (128 lines):

diff -r fa9bde6ef168 -r 85f09c16d884 pkgtools/rc.d-boot/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/rc.d-boot/DESCR  Wed Dec 05 19:23:04 2018 +0000
@@ -0,0 +1,2 @@
+This package runs all rc.conf-enabled rc.d scripts at boot time as one
+"service" in your operating system's normal boot process.
diff -r fa9bde6ef168 -r 85f09c16d884 pkgtools/rc.d-boot/INSTALL
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/rc.d-boot/INSTALL        Wed Dec 05 19:23:04 2018 +0000
@@ -0,0 +1,10 @@
+# $NetBSD: INSTALL,v 1.1 2018/12/05 19:23:04 schmonz Exp $
+
+case ${STAGE} in
+
+POST-INSTALL)
+       launchctl load -w /Library/LaunchDaemons/org.pkgsrc.rc.d-boot.plist
+
+       ;;
+
+esac
diff -r fa9bde6ef168 -r 85f09c16d884 pkgtools/rc.d-boot/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/rc.d-boot/Makefile       Wed Dec 05 19:23:04 2018 +0000
@@ -0,0 +1,35 @@
+# $NetBSD: Makefile,v 1.1 2018/12/05 19:23:04 schmonz Exp $
+#
+
+PKGNAME=               rc.d-boot-20181205
+CATEGORIES=            pkgtools
+
+MAINTAINER=            schmonz%NetBSD.org@localhost
+COMMENT=               Run package rc.d scripts at boot on any supported OS
+
+ONLY_FOR_PLATFORM=     Darwin-*-*
+
+DEPENDS+=              rc.subr-[0-9]*:../../pkgtools/rc.subr
+DEPENDS+=              rcorder-[0-9]*:../../pkgtools/rcorder
+
+NO_CHECKSUM=           yes
+NO_BUILD=              yes
+
+SUBST_CLASSES=         paths
+SUBST_STAGE.paths=     pre-configure
+SUBST_FILES.paths=     rc.d-boot org.pkgsrc.rc.d-boot.plist
+SUBST_VARS.paths=      PREFIX RCD_SCRIPTS_DIR
+
+CONF_FILES+=           ${PREFIX}/share/examples/${PKGBASE}/org.pkgsrc.rc.d-boot.plist \
+                       /Library/LaunchDaemons/org.pkgsrc.rc.d-boot.plist
+
+INSTALLATION_DIRS=     sbin share/examples/${PKGBASE}
+
+do-extract:
+       ${CP} -R ${FILESDIR} ${WRKSRC}
+
+do-install:
+       ${INSTALL_DATA} ${WRKSRC}/org.pkgsrc.rc.d-boot.plist ${DESTDIR}${PREFIX}/share/examples/${PKGBASE}/
+       ${INSTALL_SCRIPT} ${WRKSRC}/rc.d-boot ${DESTDIR}${PREFIX}/sbin/
+
+.include "../../mk/bsd.pkg.mk"
diff -r fa9bde6ef168 -r 85f09c16d884 pkgtools/rc.d-boot/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/rc.d-boot/PLIST  Wed Dec 05 19:23:04 2018 +0000
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1 2018/12/05 19:23:04 schmonz Exp $
+sbin/rc.d-boot
+share/examples/rc.d-boot/org.pkgsrc.rc.d-boot.plist
diff -r fa9bde6ef168 -r 85f09c16d884 pkgtools/rc.d-boot/files/org.pkgsrc.rc.d-boot.plist
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/rc.d-boot/files/org.pkgsrc.rc.d-boot.plist       Wed Dec 05 19:23:04 2018 +0000
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
+<plist version="1.0">
+<dict>
+       <key>RunAtLoad</key>
+       <true/>
+       <key>Disabled</key>
+       <false/>
+       <key>Label</key>
+       <string>org.pkgsrc.rc.d-boot</string>
+       <key>ProgramArguments</key>
+       <array>
+               <string>@PREFIX@/sbin/rc.d-boot</string>
+               <string>start</string>
+       </array>
+       <key>OnDemand</key>
+       <false/>
+       <key>KeepAlive</key>
+       <false/>
+       <key>LaunchOnlyOnce</key>
+       <true/>
+</dict>
+</plist>
diff -r fa9bde6ef168 -r 85f09c16d884 pkgtools/rc.d-boot/files/rc.d-boot
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/rc.d-boot/files/rc.d-boot        Wed Dec 05 19:23:04 2018 +0000
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+run_all_rcd_scripts() {
+       action="$1"; shift
+
+       # from NetBSD /etc/rc
+       scripts=$(for rcd in @RCD_SCRIPTS_DIR@; do
+               test -d ${rcd} && echo ${rcd}/*;
+       done)
+
+       files=$(@PREFIX@/sbin/rcorder -s nostart ${scripts})
+
+       for _rc_elem in $files; do
+               $_rc_elem ${action}
+       done
+}
+
+usage() {
+       echo >&2 "usage: $0 <start|stop>"
+       exit 1
+}
+
+main() {
+       [ $# -eq 1 ] || usage
+       action="$1"; shift
+
+       run_all_rcd_scripts "${action}"
+}
+
+main "$@"
+exit $?



Home | Main Index | Thread Index | Old Index