diff options
author | Aaditya Bagga <aaditya_gnulinux@zoho.com> | 2015-05-29 21:54:50 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2015-05-31 10:36:21 +0700 |
commit | 6b4bead1d472c490c8ef595f8a6d09f4d6c47ed4 (patch) | |
tree | 2e59de4605e02dca052a93f12626fff49bbd5bcb /system | |
parent | bde21f861ff90f3f04323d140d244902cb9b520b (diff) |
system/openrc-services: Added (OpenRC services).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r-- | system/openrc-services/README | 3 | ||||
-rw-r--r-- | system/openrc-services/README.Slackware | 15 | ||||
-rw-r--r-- | system/openrc-services/doinst.sh | 38 | ||||
-rw-r--r-- | system/openrc-services/openrc-services.SlackBuild | 104 | ||||
-rw-r--r-- | system/openrc-services/openrc-services.info | 10 | ||||
-rw-r--r-- | system/openrc-services/slack-desc | 19 |
6 files changed, 189 insertions, 0 deletions
diff --git a/system/openrc-services/README b/system/openrc-services/README new file mode 100644 index 0000000000000..273750eb3162b --- /dev/null +++ b/system/openrc-services/README @@ -0,0 +1,3 @@ +Contains various services for OpenRC. + +See README.Slackware for installation instructions. diff --git a/system/openrc-services/README.Slackware b/system/openrc-services/README.Slackware new file mode 100644 index 0000000000000..d90a80209dbef --- /dev/null +++ b/system/openrc-services/README.Slackware @@ -0,0 +1,15 @@ +After installing openrc and openrc-services, on rebooting one is booted to a command line with only a minimum of services enabled. + +Some common services that could be enabled: + +# rc-update add dbus default +# rc-update add sysklogd default +# rc-update add dcron default +# rc-update add alsasound default +# rc-update add consolekit default + +Enabled services for current runlevel can be queried with: +$ rc-status + +Enabled services across all runlevels can be queried with: +$ rc-update diff --git a/system/openrc-services/doinst.sh b/system/openrc-services/doinst.sh new file mode 100644 index 0000000000000..816649e912d63 --- /dev/null +++ b/system/openrc-services/doinst.sh @@ -0,0 +1,38 @@ + +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +openrc_base=(device-mapper dmcrypt lvm mdadm mdraid udev) +openrc_desktop=(acpid alsasound xdm gpm rfcomm wpa_supplicant) +openrc_devel=(git-daemon mysqld postgresql svn) +openrc_misc=(bitlbee cpupower connman ntpd ntp-client sntp rsyslog saned metalog syslog-ng sensord lircd irexec haveged salt-master salt-minion salt-syncdic hdparm clamd boinc atd libvirtd) +openrc_net=(named dhcpd dhcrelay dhcrelay6 iptables ip6tables rpcbind nfs nfsclient openntpd slapd sshd openvpn quota rsyncd samba saslauthd squid transmission-daemon ufw xinetd ypbind ypserv tor NetworkManager httpd syncthing) +openrc_slack=(dcron sendmail sysklogd) +openrc_video=(atieventsd vgl bumblebee) + +for file in "${openrc_base[@]}" "${openrc_desktop[@]}" "${openrc_devel[@]}" "${openrc_misc[@]}" "${openrc_net[@]}" "${openrc_slack[@]}" "${openrc_video[@]}"; do + config "etc/conf.d/${file}.new" +done + +preserve_perms etc/local.d/rcM.start.new diff --git a/system/openrc-services/openrc-services.SlackBuild b/system/openrc-services/openrc-services.SlackBuild new file mode 100644 index 0000000000000..46edb1f645b6a --- /dev/null +++ b/system/openrc-services/openrc-services.SlackBuild @@ -0,0 +1,104 @@ +#!/bin/sh + +# Slackware build script for openrc-services +# Based upon https://github.com/manjaro/packages-openrc + +# Copyright 2015 Aaditya Bagga <aaditya_gnulinux@zoho.com> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=openrc-services +VERSION=${VERSION:-20150529} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +_GITNAM=aadityabagga-$PRGNAM +_GITVER=e34adc20de58 + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $_GITNAM-$_GITVER +[ -e $CWD/$VERSION.tar.gz ] && tar xvf $CWD/$VERSION.tar.gz +[ -e $CWD/$_GITNAM-$_GITVER.tar.gz ] && tar xvf $CWD/$_GITNAM-$_GITVER.tar.gz +cd $_GITNAM-$_GITVER +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +sed -i "s|usr/lib|usr/lib${LIBDIRSUFFIX}|" install_openrc_video.sh + +# Install +sh install.sh "$PKG" + +# Install rcM.start +install -Dm 644 misc/local.d/rcM.start "$PKG/etc/local.d/rcM.start.new" + +# Enable some basic services +install -d "$PKG/etc/runlevels/sysinit" +ln -sf /etc/init.d/udev "$PKG/etc/runlevels/sysinit/udev" +ln -sf /etc/init.d/udev-postmount "$PKG/etc/runlevels/sysinit/udev-postmount" +ln -sf /etc/init.d/kmod-static-nodes "$PKG/etc/runlevels/sysinit/kmod-static-nodes" + +# Backup config files +for file in "$PKG"/etc/conf.d/*; do + mv "$file" "${file}.new" +done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/doinst.sh > $PKG/install/doinst.sh +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/system/openrc-services/openrc-services.info b/system/openrc-services/openrc-services.info new file mode 100644 index 0000000000000..5d7d9dc372bf5 --- /dev/null +++ b/system/openrc-services/openrc-services.info @@ -0,0 +1,10 @@ +PRGNAM="openrc-services" +VERSION="20150529" +HOMEPAGE="https://bitbucket.org/aadityabagga/openrc-services" +DOWNLOAD="https://bitbucket.org/aadityabagga/openrc-services/get/20150529.tar.gz" +MD5SUM="5dcef38224f658aa28215a16b037e690" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="openrc" +MAINTAINER="Aaditya Bagga" +EMAIL="aaditya_gnulinux@zoho.com" diff --git a/system/openrc-services/slack-desc b/system/openrc-services/slack-desc new file mode 100644 index 0000000000000..c41d839e93b15 --- /dev/null +++ b/system/openrc-services/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +openrc-services: openrc-services (OpenRC services) +openrc-services: +openrc-services: Service scripts for OpenRC. +openrc-services: +openrc-services: Various scripts are provided, for packages that are in Slackware +openrc-services: plus slackbuilds.org as well as some other packages. +openrc-services: +openrc-services: +openrc-services: +openrc-services: +openrc-services: |