1

Initial commit

This commit is contained in:
eleksir
2020-02-24 16:28:05 +03:00
commit 040bd1324e
11 changed files with 336 additions and 0 deletions

6
doc/examples/svc.json Normal file
View File

@@ -0,0 +1,6 @@
{
"mode": "user",
"dir": "/.local/etc/services",
"servicedir": "/.local/etc/service.d",
"timeout": 3
}

37
doc/man/runit-svc.1 Normal file
View File

@@ -0,0 +1,37 @@
.TH "SVC" "1" "24 February 2020"
.SH "NAME"
runit-svc \- sv replacement tool for runit
.SH "SYNOPSIS"
.B svc
SERVICE_NAME start|stop|restart|status|enable|disable
.br
.B svc
list [--all]
.SH "DESCRIPTION"
.PP
Manipulates system or user runit-services.
.SH "OPTIONS"
.TP
\fBsvc list\fR
Show enabled services list for system or user
.TP
\fBsvc list \-\-all\fR
Show all services for system or user
.TP
\fBsvc SERVICE_NAME start|stop|restart|status\fR
Starts, stops, restarts, show status of service
.TP
\fBsvc SERVICE_NAME disable\fR
Disables service. Note that service will be stopped immediately after disabling.
.TP
\fBsvc SERVICE_NAME enable\fR
Enables service. Note that service will be started immediately after enabling.
.TP
.SH "AUTHOR"
.TP
Sergei Fedosoff <eleksir@gmail.com> aka eleksir <eleksir@exs-elm.ru>
.SH "COPYRIGHT"
Copyright \*R 2020 Sergei Fedosoff. License 2 clause BSD:
https://directory.fsf.org/wiki?title=License:FreeBSD
.SH "SEE ALSO"
.B sv (1).

View File

@@ -0,0 +1,69 @@
#!/bin/bash
# Slackware build script for runit-svc
# Copyright 2020 Sergei Fedosoff <eleksir@gmail.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=runit-svc
VERSION=${VERSION:-0.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_EXs}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/EXs}
PKG=${PKG:-$TMP/package-$PRGNAM}
OUTPUT=${OUTPUT:-/tmp}
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
install -Dpm 0755 src/runit-svc $PKG/usr/bin/runit-svc
ln -s /usr/bin/runit-svc $PKG/usr/bin/svc
mkdir -p $PKG/usr/man/man1
gzip -9c doc/man/runit-svc.1 > $PKG/usr/man/man1/svc.1.gz
gzip -9c doc/man/runit-svc.1 > $PKG/usr/man/man1/runit-svc.1.gz
install -Dpm 0644 doc/examples/svc.json $PKG/usr/doc/$PRGNAM-$VERSION/examples/svc.json
install -Dpm 0644 README $PKG/usr/doc/$PRGNAM-$VERSION/README
install -Dpm 0644 LICENSE $PKG/usr/doc/$PRGNAM-$VERSION/LICENSE
install -Dpm 0644 AUTHORS $PKG/usr/doc/$PRGNAM-$VERSION/AUTHORS
install -Dpm 0644 $CWD/$PRGNAM.SlackBuild $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
install -Dpm 0644 $CWD/slack-desc $PKG/install/slack-desc
install -Dpm 0644 $CWD/slack-required $PKG/install/slack-required
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

19
doc/slackbuild/slack-desc Normal file
View File

@@ -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------------------------------------------------------|
runit-svc: runit-svc (runit sv utility replacement)
runit-svc:
runit-svc:
runit-svc:
runit-svc:
runit-svc:
runit-svc:
runit-svc:
runit-svc: Homepage: https://github.com/eleksir/runit-svc
runit-svc:
runit-svc:

View File

@@ -0,0 +1,2 @@
runit
perl