Commit 51491f30 authored by Aaditya Bagga's avatar Aaditya Bagga

update and add some services

updated: iptables, metalog
added: teamviewerd
added but not updated: bitlbee, mpd
parent a4cc5a5e
Pipeline #49983764 passed with stages
in 59 seconds
#!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
pidfile="${PIDFILE:-/run/metalog.pid}"
command="/usr/sbin/metalog"
command_args="--pidfile=${pidfile} --daemonize ${METALOG_OPTS}"
extra_started_commands="buffer unbuffer"
depend() {
need localmount
use clock hostname
after bootmisc
provide logger
}
buffer() {
ebegin "Enabling log buffering"
start-stop-daemon --exec "${command}" --signal USR2 --pidfile "${pidfile}"
eend ${?}
}
unbuffer() {
ebegin "Disabling log buffering"
start-stop-daemon --exec "${command}" --signal USR1 --pidfile "${pidfile}"
eend ${?}
}
[Unit]
Description=Jenkins Daemon
[Service]
EnvironmentFile=/etc/conf.d/jenkins
Type=forking
ExecStart=/usr/bin/java ${JENKINS_JAVA_OPTIONS} -DJENKINS_HOME=${JENKINS_HOME} -jar ${JENKINS_WAR} --daemon --logfile=/var/log/jenkins/jenkins.log --httpPort=${JENKINS_PORT} --debug=${JENKINS_DEBUG_LEVEL} --handlerCountMax=100 --handlerCountMaxIdle=20 --accessLoggerClassName=winstone.accesslog.SimpleAccessLogger --simpleAccessLogger.format=combined --simpleAccessLogger.file=/var/log/jenkins/access_log ${JENKINS_ARGS}
User=jenkins
[Install]
WantedBy=multi-user.target
#!/sbin/openrc-run
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
: CFGFILE=${CFGFILE:=/etc/mpd.conf}
depend() {
need localmount
use net netmount nfsmount alsasound esound pulseaudio
config ${CFGFILE}
}
get_config() {
x=$1
test -e ${CFGFILE} || return 1
sed -n \
-e '/^[ \t]*'${x}'/{s:^[ \t]*'${x}'[ \t]\+"\?\([^#"]\+\)[^"]*"\?$:\1: ; p }' \
${CFGFILE}
}
extra_started_commands='reload'
command=/usr/bin/mpd
command_args=${CFGFILE}
required_files=${CFGFILE}
pidfile=$(get_config pid_file)
description="Music Player Daemon"
reload() {
ebegin "Reloading ${RC_SVCNAME}"
start-stop-daemon --pidfile ${pidfile} --signal HUP
eend $?
}
# /etc/conf.d/ip6tables
# Set wait option for xtables lock in seconds
# DEFAULT: 60
#IPTABLES_LOCK_WAIT_TIME="60"
# Set wait interval option for xtables lock in microseconds
# DEFAULT: 1000
#IPTABLES_LOCK_WAIT_INTERVAL="1000"
# Location in which ip6tables initscript will save set rules on
# service shutdown
IP6TABLES_SAVE="/var/lib/ip6tables/rules-save"
# Options to pass to ip6tables-save and ip6tables-restore
SAVE_RESTORE_OPTIONS="-c"
# Save state on stopping ip6tables
SAVE_ON_STOP="yes"
# If you need to log ip6tables messages as soon as ip6tables starts,
# AND your logger does NOT depend on the network, then you may wish
# to uncomment the next line.
# If your logger depends on the network, and you uncomment this line
# you will create an unresolvable circular dependency during startup.
# After commenting or uncommenting this line, you must run 'rc-update -u'.
#rc_use="logger"
# /etc/conf.d/iptables
# Set wait option for xtables lock in seconds
# DEFAULT: 60
#IPTABLES_LOCK_WAIT_TIME="60"
# Set wait interval option for xtables lock in microseconds
# DEFAULT: 1000
#IPTABLES_LOCK_WAIT_INTERVAL="1000"
# Location in which iptables initscript will save set rules on
# service shutdown
IPTABLES_SAVE="/var/lib/iptables/rules-save"
# Options to pass to iptables-save and iptables-restore
SAVE_RESTORE_OPTIONS="-c"
# Save state on stopping iptables
SAVE_ON_STOP="yes"
# If you need to log iptables messages as soon as iptables starts,
# AND your logger does NOT depend on the network, then you may wish
# to uncomment the next line.
# If your logger depends on the network, and you uncomment this line
# you will create an unresolvable circular dependency during startup.
# After commenting or uncommenting this line, you must run 'rc-update -u'.
#rc_use="logger"
#!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
extra_commands="check save panic"
extra_started_commands="reload"
iptables_lock_wait_time=${IPTABLES_LOCK_WAIT_TIME:-"60"}
iptables_lock_wait_interval=${IPTABLES_LOCK_WAIT_INTERVAL:-"1000"}
iptables_name=${SVCNAME}
case ${iptables_name} in
iptables|ip6tables) ;;
*) iptables_name="iptables" ;;
esac
iptables_bin="/sbin/${iptables_name}"
case ${iptables_name} in
iptables) iptables_proc="/proc/net/ip_tables_names"
iptables_save=${IPTABLES_SAVE};;
ip6tables) iptables_proc="/proc/net/ip6_tables_names"
iptables_save=${IP6TABLES_SAVE};;
esac
depend() {
need localmount #434774
before net
}
set_table_policy() {
local has_errors=0 chains table=$1 policy=$2
case ${table} in
nat) chains="PREROUTING POSTROUTING OUTPUT";;
mangle) chains="PREROUTING INPUT FORWARD OUTPUT POSTROUTING";;
filter) chains="INPUT FORWARD OUTPUT";;
*) chains="";;
esac
local chain
for chain in ${chains} ; do
${iptables_bin} --wait ${iptables_lock_wait_time} --wait-interval ${iptables_lock_wait_interval} -t ${table} -P ${chain} ${policy}
[ $? -ne 0 ] && has_errors=1
done
return ${has_errors}
}
checkkernel() {
if [ ! -e ${iptables_proc} ] ; then
eerror "Your kernel lacks ${iptables_name} support, please load"
eerror "appropriate modules and try again."
return 1
fi
return 0
}
checkconfig() {
if [ -z "${iptables_save}" -o ! -f "${iptables_save}" ] ; then
eerror "Not starting ${iptables_name}. First create some rules then run:"
eerror "/etc/init.d/${iptables_name} save"
return 1
fi
return 0
}
start_pre() {
checkconfig || return 1
}
start() {
ebegin "Loading ${iptables_name} state and starting firewall"
${iptables_bin}-restore --wait ${iptables_lock_wait_time} --wait-interval ${iptables_lock_wait_interval} ${SAVE_RESTORE_OPTIONS} < "${iptables_save}"
eend $?
}
stop_pre() {
checkkernel || return 1
}
stop() {
if [ "${SAVE_ON_STOP}" = "yes" ] ; then
save || return 1
fi
ebegin "Stopping firewall"
local has_errors=0 a
for a in $(cat ${iptables_proc}) ; do
set_table_policy $a ACCEPT
[ $? -ne 0 ] && has_errors=1
${iptables_bin} --wait ${iptables_lock_wait_time} --wait-interval ${iptables_lock_wait_interval} -F -t $a
[ $? -ne 0 ] && has_errors=1
${iptables_bin} --wait ${iptables_lock_wait_time} --wait-interval ${iptables_lock_wait_interval} -X -t $a
[ $? -ne 0 ] && has_errors=1
done
eend ${has_errors}
}
reload() {
checkkernel || return 1
checkrules || return 1
ebegin "Flushing firewall"
local has_errors=0 a
for a in $(cat ${iptables_proc}) ; do
${iptables_bin} --wait ${iptables_lock_wait_time} --wait-interval ${iptables_lock_wait_interval} -F -t $a
[ $? -ne 0 ] && has_errors=1
${iptables_bin} --wait ${iptables_lock_wait_time} --wait-interval ${iptables_lock_wait_interval} -X -t $a
[ $? -ne 0 ] && has_errors=1
done
eend ${has_errors}
start
}
checkrules() {
ebegin "Checking rules"
${iptables_bin}-restore --test ${SAVE_RESTORE_OPTIONS} < "${iptables_save}"
eend $?
}
check() {
# Short name for users of init.d script.
checkrules
}
save() {
ebegin "Saving ${iptables_name} state"
checkpath -q -d "$(dirname "${iptables_save}")"
checkpath -q -m 0600 -f "${iptables_save}"
${iptables_bin}-save ${SAVE_RESTORE_OPTIONS} > "${iptables_save}"
eend $?
}
panic() {
# use iptables autoload capability to load at least all required
# modules and filter table
${iptables_bin} --wait ${iptables_lock_wait_time} --wait-interval ${iptables_lock_wait_interval} -S >/dev/null
if [ $? -ne 0 ] ; then
eerror "${iptables_bin} failed to load"
return 1
fi
if service_started ${iptables_name}; then
rc-service ${iptables_name} stop
fi
local has_errors=0 a
ebegin "Dropping all packets"
for a in $(cat ${iptables_proc}) ; do
${iptables_bin} --wait ${iptables_lock_wait_time} --wait-interval ${iptables_lock_wait_interval} -F -t $a
[ $? -ne 0 ] && has_errors=1
${iptables_bin} --wait ${iptables_lock_wait_time} --wait-interval ${iptables_lock_wait_interval} -X -t $a
[ $? -ne 0 ] && has_errors=1
if [ "${a}" != "nat" ]; then
# The "nat" table is not intended for filtering, the use of DROP is therefore inhibited.
set_table_policy $a DROP
[ $? -ne 0 ] && has_errors=1
fi
done
eend ${has_errors}
}
#%PAM-1.0
# $Id$
auth required pam_env.so
auth sufficient pam_winbind.so
auth sufficient pam_unix.so likeauth nullok use_first_pass
auth required pam_deny.so
account sufficient pam_winbind.so
account required pam_unix.so
password required pam_cracklib.so retry=3
password sufficient pam_unix.so nullok use_authtok md5 shadow
password required pam_deny.so
session required pam_mkhomedir.so skel=/etc/skel/ umask=0022
session required pam_limits.so
session required pam_unix.so
# Bitlbee options (see /usr/sbin/bitlbee -h)
BITLBEE_OPTS=""
# Specify the network services that correspond to "DaemonInterface" and
# "ClientInterface" settings in bitlbee.conf. For example, if bound to 0.0.0.0,
# this should be set to "net.lo" which provides the loopback interface.
rc_need="net.lo"
#!/sbin/openrc-run
# Copyright 1999-2019 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
command="/usr/sbin/bitlbee"
pidfile="/run/${RC_SVCNAME}.pid"
command_args="-D -P ${pidfile} -u bitlbee ${BITLBEE_OPTS}"
#!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
command="/opt/teamviewer14/tv_bin/teamviewerd"
command_args="-d"
description="Starts the TeamViewer remote control daemon"
pidfile="/var/run/teamviewerd.pid"
# /etc/conf.d/distccd: config file for /etc/init.d/distccd
DISTCCD_OPTS=""
# this is the distccd executable
DISTCCD_EXEC="/usr/bin/distccd"
# set this option to run distccd with extra parameters
# Default port is 3632. For most people the default is okay.
DISTCCD_OPTS="${DISTCCD_OPTS} --port 3632"
# Logging
# You can change some logging options here:
# --log-file FILE
# --log-level LEVEL [critical,error,warning, notice, info, debug]
#
# Leaving --log-file blank will log to syslog
# example: --log-file /dev/null --log-level warning
# example: --log-level critical
DISTCCD_OPTS="${DISTCCD_OPTS} --log-level critical"
# SECURITY NOTICE:
# It is HIGHLY recommended that you use the --listen option
# for increased security. You can specify an IP to permit connections
# from or a CIDR mask
# --listen accepts only a single IP
# --allow is now mandatory as of distcc-2.18.
# example: --allow 192.168.0.0/24
# example: --allow 192.168.0.5 --allow 192.168.0.150
# example: --listen 192.168.0.2
DISTCCD_OPTS="${DISTCCD_OPTS} --allow 192.168.0.0/24"
#DISTCCD_OPTS="${DISTCCD_OPTS} --listen 192.168.0.2"
# set this for niceness
# Default is 15
DISTCCD_OPTS="${DISTCCD_OPTS} -N 15"
#!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
depend() {
need net
use avahi-daemon ypbind
}
command="${DISTCCD_EXEC:-usr/bin/distccd}"
command_args="--user distcc --daemon --no-detach ${DISTCCD_OPTS}"
command_background="true"
pidfile="/run/${RC_SVCNAME}.pid"
#!/bin/sh
if [ -z "$XDG_VTNR" ]; then
exec /usr/bin/X -nolisten tcp "$@"
else
exec /usr/bin/X -nolisten tcp -keeptty "$@" "vt$XDG_VTNR"
fi
......@@ -15,7 +15,7 @@ _Csane=${_gentoo_uri}/media-gfx/sane-backends/files/saned.confd
_Isane=${_gentoo_uri}/media-gfx/sane-backends/files/saned.initd
_Ifuse=${_gentoo_uri}/sys-fs/fuse/files/fuse.init
_Cmeta=${_gentoo_uri}/app-admin/metalog/files/metalog.confd
_Imeta=${_gentoo_uri}/app-admin/metalog/files/metalog.initd
_Imeta=${_gentoo_uri}/app-admin/metalog/files/metalog.initd-r1
_Csyslog=${_gentoo_uri}/app-admin/syslog-ng/files/3.7/syslog-ng.confd
_Isyslog=${_gentoo_uri}/app-admin/syslog-ng/files/3.7/syslog-ng.rc6
_Clirc1=${_gentoo_uri}/app-misc/lirc/files/lircd.conf.4
......
......@@ -18,9 +18,10 @@ _Idhcp1=${_gentoo_uri}/net-misc/dhcp/files/dhcpd.init5
_Idhcp2=${_gentoo_uri}/net-misc/dhcp/files/dhcrelay.init3
_Chost=${_gentoo_uri}/net-wireless/hostapd/files/hostapd-conf.d
_Ihost=${_gentoo_uri}/net-wireless/hostapd/files/hostapd-init.d
_Cip1=${_gentoo_uri}/net-firewall/iptables/files/iptables-1.4.13.confd
_Cip2=${_gentoo_uri}/net-firewall/iptables/files/ip6tables-1.4.13.confd
_Iip=${_gentoo_uri}/net-firewall/iptables/files/iptables-1.4.13-r1.init
_Cipt=${_gentoo_uri}/net-firewall/iptables/files/iptables-r1.confd
_Iipt=${_gentoo_uri}/net-firewall/iptables/files/iptables-r2.init
_Cip6t=${_gentoo_uri}/net-firewall/iptables/files/ip6tables-r1.confd
_Iip6t=${_gentoo_uri}/net-firewall/iptables/files/iptables-r2.init
#_Ikrb1=app-crypt/mit-krb5/files/mit-krb5kadmind.initd-r1
#_Ikrb2=app-crypt/mit-krb5/files/mit-krb5kdc.initd-r1
#_Ikrb3=app-crypt/mit-krb5/files/mit-krb5kpropd.initd-r1
......@@ -78,6 +79,7 @@ _Cdnsmasq=${_gentoo_uri}/net-dns/dnsmasq/files/dnsmasq.confd-r1
_Idnsmasq=${_gentoo_uri}/net-dns/dnsmasq/files/dnsmasq-init-r3
_Csyncthing=${_gentoo_uri}/net-p2p/syncthing/files/syncthing.confd
_Isyncthing=${_gentoo_uri}/net-p2p/syncthing/files/syncthing.initd
_Iteamvd=${_gentoo_uri}/net-misc/teamviewer/files/teamviewerd13.init
_Ctftphpa=${_gentoo_uri}/net-ftp/tftp-hpa/files/in.tftpd.confd-0.44
_Itftphpa=${_gentoo_uri}/net-ftp/tftp-hpa/files/in.tftpd.rc6
......@@ -95,10 +97,10 @@ install -Dm755 "${_Idhcp2}" "${DESTDIR}/${SYSCONFDIR}/init.d/dhcrelay"
install -Dm755 "${_Idhcp2}" "${DESTDIR}/${SYSCONFDIR}/init.d/dhcrelay6"
install -Dm644 "${_Chost}" "${DESTDIR}/${SYSCONFDIR}/conf.d/hostapd"
install -Dm755 "${_Ihost}" "${DESTDIR}/${SYSCONFDIR}/init.d/hostapd"
install -Dm644 "${_Cip1}" "${DESTDIR}/${SYSCONFDIR}/conf.d/iptables"
install -Dm755 "${_Iip}" "${DESTDIR}/${SYSCONFDIR}/init.d/iptables"
install -Dm644 "${_Cip2}" "${DESTDIR}/${SYSCONFDIR}/conf.d/ip6tables"
install -Dm755 "${_Iip}" "${DESTDIR}/${SYSCONFDIR}/init.d/ip6tables"
install -Dm644 "${_Cipt}" "${DESTDIR}/${SYSCONFDIR}/conf.d/iptables"
install -Dm755 "${_Iipt}" "${DESTDIR}/${SYSCONFDIR}/init.d/iptables"
install -Dm644 "${_Cip6t}" "${DESTDIR}/${SYSCONFDIR}/conf.d/ip6tables"
install -Dm755 "${_Iip6t}" "${DESTDIR}/${SYSCONFDIR}/init.d/ip6tables"
#install -Dm755 "${_gentoo_uri}/${_Ikrb1}" "${DESTDIR}/${SYSCONFDIR}/init.d/krb5kadmind"
#install -Dm755 "${_gentoo_uri}/${_Ikrb2}" "${DESTDIR}/${SYSCONFDIR}/init.d/krb5kdc"
#install -Dm755 "${_gentoo_uri}/${_Ikrb3}" "${DESTDIR}/${SYSCONFDIR}/init.d/krb5kpropd"
......@@ -155,11 +157,12 @@ install -Dm644 "${_Cdnsmasq}" "${DESTDIR}/${SYSCONFDIR}/conf.d/dnsmasq"
install -Dm755 "${_Idnsmasq}" "${DESTDIR}/${SYSCONFDIR}/init.d/dnsmasq"
install -Dm644 "${_Csyncthing}" "${DESTDIR}/${SYSCONFDIR}/conf.d/syncthing"
install -Dm755 "${_Isyncthing}" "${DESTDIR}/${SYSCONFDIR}/init.d/syncthing"
install -Dm755 "${_Iteamvd}" "${DESTDIR}/${SYSCONFDIR}/init.d/teamviewerd"
install -Dm644 "${_Ctftphpa}" "${DESTDIR}/${SYSCONFDIR}/conf.d/tftpd-hpa"
install -Dm755 "${_Itftphpa}" "${DESTDIR}/${SYSCONFDIR}/init.d/tftpd-hpa"
install -Dm644 "misc/gentoo-apache/init/apache2.confd" "${DESTDIR}/${SYSCONFDIR}/conf.d/httpd"
install -Dm755 "misc/gentoo-apache/init/apache2.initd" "${DESTDIR}/${SYSCONFDIR}/init.d/httpd"
install -Dm755 "misc/init.d/wicd.initd" "${DESTDIR}/${SYSCONFDIR}/init.d/wicd"
install -Dm644 "${_Ctftphpa}" "${DESTDIR}/${SYSCONFDIR}/conf.d/tftpd-hpa"
install -Dm755 "${_Itftphpa}" "${DESTDIR}/${SYSCONFDIR}/init.d/tftpd-hpa"
# comments
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment