diff options
author | Jason A. Donenfeld <zx2c4@gentoo.org> | 2017-03-17 14:49:18 +0100 |
---|---|---|
committer | Jason A. Donenfeld <zx2c4@gentoo.org> | 2017-03-17 14:56:14 +0100 |
commit | 7f68c86d93d5f69d775bceb3941b3a3b46672eb1 (patch) | |
tree | b461a335b70f8d07bda55ab1e3cc54fbd568a097 /net-vpn/badvpn/files | |
parent | dev-ruby/nexpose: Initial version (diff) | |
download | gentoo-7f68c86d93d5f69d775bceb3941b3a3b46672eb1.tar.gz gentoo-7f68c86d93d5f69d775bceb3941b3a3b46672eb1.tar.bz2 gentoo-7f68c86d93d5f69d775bceb3941b3a3b46672eb1.zip |
Move VPN packages into net-vpn/
Diffstat (limited to 'net-vpn/badvpn/files')
-rw-r--r-- | net-vpn/badvpn/files/badvpn-1.999.127-ncd.init | 24 | ||||
-rw-r--r-- | net-vpn/badvpn/files/badvpn-ncd.conf | 11 | ||||
-rw-r--r-- | net-vpn/badvpn/files/badvpn-ncd.init | 48 | ||||
-rw-r--r-- | net-vpn/badvpn/files/badvpn-ncd.service | 11 | ||||
-rw-r--r-- | net-vpn/badvpn/files/badvpn-server.conf | 11 | ||||
-rw-r--r-- | net-vpn/badvpn/files/badvpn-server.init | 48 |
6 files changed, 153 insertions, 0 deletions
diff --git a/net-vpn/badvpn/files/badvpn-1.999.127-ncd.init b/net-vpn/badvpn/files/badvpn-1.999.127-ncd.init new file mode 100644 index 000000000000..69f7ba45992a --- /dev/null +++ b/net-vpn/badvpn/files/badvpn-1.999.127-ncd.init @@ -0,0 +1,24 @@ +#!/sbin/openrc-run +# Copyright 1999-2013 Gentoo Foundation +# Released under the 3-clause BSD license. + +command="${ncd_exec:-"/usr/bin/badvpn-ncd"}" +command_args="${ncd_args} --config-file ${ncd_config:-/etc/ncd.conf}" +command_background="YES" +description="Network Configuration Daemon" +pidfile="/var/run/${RC_SVCNAME}.pid" + +depend() { + need localmount + after bootmisc + before netmount +} + +start_pre() { + if yesno "${ncd_syslog:-NO}"; then + command_args="${command_args} + --logger syslog + --syslog-ident \"${ncd_syslog_ident:-${RC_SVCNAME}}\" + --channel-loglevel ncd_log_msg info" + fi +} diff --git a/net-vpn/badvpn/files/badvpn-ncd.conf b/net-vpn/badvpn/files/badvpn-ncd.conf new file mode 100644 index 000000000000..ad34c66f7ca3 --- /dev/null +++ b/net-vpn/badvpn/files/badvpn-ncd.conf @@ -0,0 +1,11 @@ +# NCD program file. +#ncd_config="/etc/ncd.conf" + +# enable or disable syslog. +#ncd_syslog="NO" + +# Syslog identification. +#ncd_syslog_ident="ncd" + +# Additional arguments. +#ncd_args="" diff --git a/net-vpn/badvpn/files/badvpn-ncd.init b/net-vpn/badvpn/files/badvpn-ncd.init new file mode 100644 index 000000000000..e408075128a4 --- /dev/null +++ b/net-vpn/badvpn/files/badvpn-ncd.init @@ -0,0 +1,48 @@ +#!/sbin/openrc-run +# Copyright 1999-2012 Gentoo Foundation +# Released under the 3-clause BSD license. + +command="${ncd_exec:-"/usr/bin/badvpn-ncd"}" +command_args="${ncd_args} --config-file ${ncd_config:-/etc/ncd.conf}" +command_background="YES" +description="Network Configuration Daemon" +pidfile="/var/run/${RC_SVCNAME}.pid" + +depend() { + need localmount + after bootmisc + before netmount + if yesno "${ncd_syslog:-NO}"; then + use logger + fi +} + +start_pre() { + if yesno "${ncd_syslog:-NO}"; then + command_args="${command_args} + --logger syslog + --syslog-ident \"${ncd_syslog_ident:-${RC_SVCNAME}}\"" + fi +} + +start() +{ + [ -n "$command" ] || return 0 + local _background= + ebegin "Starting ${name:-$RC_SVCNAME}" + if yesno "${command_background}"; then + if [ -z "${pidfile}" ]; then + eend 1 "command_background option used but no pidfile specified" + return 1 + fi + _background="--background --make-pidfile" + fi + eval start-stop-daemon --start \ + --exec $command \ + ${procname:+--name} $procname \ + ${pidfile:+--pidfile} $pidfile \ + $_background $start_stop_daemon_args \ + -- $command_args + eend $? "Failed to start $RC_SVCNAME" + return $? +} diff --git a/net-vpn/badvpn/files/badvpn-ncd.service b/net-vpn/badvpn/files/badvpn-ncd.service new file mode 100644 index 000000000000..6ca7aa515e00 --- /dev/null +++ b/net-vpn/badvpn/files/badvpn-ncd.service @@ -0,0 +1,11 @@ +[Unit] +Description=Network Configuation Daemon +After=syslog.target + +[Service] +ExecStart=/usr/bin/badvpn-ncd --logger syslog --syslog-ident ncd --loglevel warning --channel-loglevel ncd_log_msg info /etc/ncd.conf +Restart=always + +[Install] +WantedBy=multi-user.target + diff --git a/net-vpn/badvpn/files/badvpn-server.conf b/net-vpn/badvpn/files/badvpn-server.conf new file mode 100644 index 000000000000..ed5103d3d0ef --- /dev/null +++ b/net-vpn/badvpn/files/badvpn-server.conf @@ -0,0 +1,11 @@ +# User account to run server as. +#vpn_user="badvpn" + +# Enable or disable syslog. +#vpn_syslog="NO" + +# Syslog identification. +#vpn_syslog_ident="badvpn-server" + +# Arguments to badvpn-server. +vpn_args="--listen-addr 0.0.0.0:7179" diff --git a/net-vpn/badvpn/files/badvpn-server.init b/net-vpn/badvpn/files/badvpn-server.init new file mode 100644 index 000000000000..32ee7fefe33e --- /dev/null +++ b/net-vpn/badvpn/files/badvpn-server.init @@ -0,0 +1,48 @@ +#!/sbin/openrc-run +# Copyright 1999-2012 Gentoo Foundation +# Released under the 3-clause BSD license. + +command="${vpn_exec:-/usr/bin/badvpn-server}" +command_args="${vpn_args}" +command_background="YES" +description="BadVPN server" +pidfile="/var/run/${RC_SVCNAME}.pid" +start_stop_daemon_args="--user \"${vpn_user:-badvpn}\"" + +depend() { + need localmount + after bootmisc + if yesno "${vpn_syslog:-NO}"; then + use logger + fi +} + +start_pre() { + if yesno "${vpn_syslog:-NO}"; then + command_args="${command_args} + --logger syslog + --syslog-ident \"${vpn_syslog_ident:-${RC_SVCNAME}}\"" + fi +} + +start() +{ + [ -n "$command" ] || return 0 + local _background= + ebegin "Starting ${name:-$RC_SVCNAME}" + if yesno "${command_background}"; then + if [ -z "${pidfile}" ]; then + eend 1 "command_background option used but no pidfile specified" + return 1 + fi + _background="--background --make-pidfile" + fi + eval start-stop-daemon --start \ + --exec $command \ + ${procname:+--name} $procname \ + ${pidfile:+--pidfile} $pidfile \ + $_background $start_stop_daemon_args \ + -- $command_args + eend $? "Failed to start $RC_SVCNAME" + return $? +} |