summaryrefslogtreecommitdiff
path: root/src/etc
diff options
context:
space:
mode:
Diffstat (limited to 'src/etc')
-rwxr-xr-xsrc/etc/init.d/isc-dhcpv4-server4
-rwxr-xr-xsrc/etc/init.d/isc-dhcpv6-relay4
-rwxr-xr-xsrc/etc/init.d/isc-dhcpv6-server4
-rwxr-xr-xsrc/etc/ppp/ip-pre-up51
-rw-r--r--src/etc/rsyslog.d/01-auth.conf14
-rw-r--r--src/etc/udev/rules.d/99-vyos-wwan.rules11
-rwxr-xr-xsrc/etc/vmware-tools/scripts/resume-vm-default.d/ether-resume.py20
7 files changed, 95 insertions, 13 deletions
diff --git a/src/etc/init.d/isc-dhcpv4-server b/src/etc/init.d/isc-dhcpv4-server
index 377634a13..94a1020ac 100755
--- a/src/etc/init.d/isc-dhcpv4-server
+++ b/src/etc/init.d/isc-dhcpv4-server
@@ -72,7 +72,7 @@ case "$1" in
start)
test_config
log_daemon_msg "Starting $DESC" "$NAME"
- start-stop-daemon --start --quiet --pidfile "$DHCPD_PID" \
+ start-stop-daemon --start --oknodo --quiet --pidfile "$DHCPD_PID" \
--exec /usr/sbin/dhcpd -- \
-q $OPTIONS -cf "$DHCPD_CONF" -pf "$DHCPD_PID" $INTERFACES
sleep 2
@@ -87,7 +87,7 @@ case "$1" in
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
- start-stop-daemon --stop --quiet --pidfile "$DHCPD_PID"
+ start-stop-daemon --stop --oknodo --quiet --pidfile "$DHCPD_PID"
log_end_msg $?
rm -f "$DHCPD_PID"
;;
diff --git a/src/etc/init.d/isc-dhcpv6-relay b/src/etc/init.d/isc-dhcpv6-relay
index 5a8ce620c..e553eafd1 100755
--- a/src/etc/init.d/isc-dhcpv6-relay
+++ b/src/etc/init.d/isc-dhcpv6-relay
@@ -31,11 +31,11 @@ DHCRELAYPID=/var/run/dhcv6relay.pid
case "$1" in
start)
- start-stop-daemon --start --quiet --pidfile $DHCRELAYPID \
+ start-stop-daemon --start --oknodo --quiet --pidfile $DHCRELAYPID \
--exec /usr/sbin/dhcrelay -- -q $OPTIONS -pf $DHCRELAYPID
;;
stop)
- start-stop-daemon --stop --quiet --pidfile $DHCRELAYPID
+ start-stop-daemon --stop --oknodo --quiet --pidfile $DHCRELAYPID
;;
restart | force-reload)
$0 stop
diff --git a/src/etc/init.d/isc-dhcpv6-server b/src/etc/init.d/isc-dhcpv6-server
index 55f59b68e..f6b27cb4a 100755
--- a/src/etc/init.d/isc-dhcpv6-server
+++ b/src/etc/init.d/isc-dhcpv6-server
@@ -72,7 +72,7 @@ case "$1" in
start)
test_config
log_daemon_msg "Starting $DESC" "$NAME"
- start-stop-daemon --start --quiet --pidfile "$DHCPD_PID" \
+ start-stop-daemon --start --oknodo --quiet --pidfile "$DHCPD_PID" \
--exec /usr/sbin/dhcpd -- \
-q $OPTIONS -cf "$DHCPD_CONF" -pf "$DHCPD_PID" $INTERFACES
sleep 2
@@ -87,7 +87,7 @@ case "$1" in
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
- start-stop-daemon --stop --quiet --pidfile "$DHCPD_PID"
+ start-stop-daemon --stop --oknodo --quiet --pidfile "$DHCPD_PID"
log_end_msg $?
rm -f "$DHCPD_PID"
;;
diff --git a/src/etc/ppp/ip-pre-up b/src/etc/ppp/ip-pre-up
new file mode 100755
index 000000000..05840650b
--- /dev/null
+++ b/src/etc/ppp/ip-pre-up
@@ -0,0 +1,51 @@
+#!/bin/sh
+#
+# This script is run by the pppd when the link is created.
+# It uses run-parts to run scripts in /etc/ppp/ip-pre-up.d, to
+# change name, setup firewall,etc you should create script(s) there.
+#
+# Be aware that other packages may include /etc/ppp/ip-pre-up.d scripts (named
+# after that package), so choose local script names with that in mind.
+#
+# This script is called with the following arguments:
+# Arg Name Example
+# $1 Interface name ppp0
+# $2 The tty ttyS1
+# $3 The link speed 38400
+# $4 Local IP number 12.34.56.78
+# $5 Peer IP number 12.34.56.99
+# $6 Optional ``ipparam'' value foo
+
+# The environment is cleared before executing this script
+# so the path must be reset
+PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
+export PATH
+
+# These variables are for the use of the scripts run by run-parts
+PPP_IFACE="$1"
+PPP_TTY="$2"
+PPP_SPEED="$3"
+PPP_LOCAL="$4"
+PPP_REMOTE="$5"
+PPP_IPPARAM="$6"
+export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM
+
+# as an additional convenience, $PPP_TTYNAME is set to the tty name,
+# stripped of /dev/ (if present) for easier matching.
+PPP_TTYNAME=`/usr/bin/basename "$2"`
+export PPP_TTYNAME
+
+# If /var/log/ppp-ipupdown.log exists use it for logging.
+if [ -e /var/log/ppp-ipupdown.log ]; then
+ exec > /var/log/ppp-ipupdown.log 2>&1
+ echo $0 $*
+ echo
+fi
+
+# This script can be used to override the .d files supplied by other packages.
+if [ -x /etc/ppp/ip-pre-up.local ]; then
+ exec /etc/ppp/ip-pre-up.local "$*"
+fi
+
+run-parts /etc/ppp/ip-pre-up.d \
+ --arg="$1" --arg="$2" --arg="$3" --arg="$4" --arg="$5" --arg="$6"
diff --git a/src/etc/rsyslog.d/01-auth.conf b/src/etc/rsyslog.d/01-auth.conf
new file mode 100644
index 000000000..cc64099d6
--- /dev/null
+++ b/src/etc/rsyslog.d/01-auth.conf
@@ -0,0 +1,14 @@
+# The lines below cause all listed daemons/processes to be logged into
+# /var/log/auth.log, then drops the message so it does not also go to the
+# regular syslog so that messages are not duplicated
+
+$outchannel auth_log,/var/log/auth.log
+if $programname == 'CRON' or
+ $programname == 'sudo' or
+ $programname == 'su'
+ then :omfile:$auth_log
+
+if $programname == 'CRON' or
+ $programname == 'sudo' or
+ $programname == 'su'
+ then stop
diff --git a/src/etc/udev/rules.d/99-vyos-wwan.rules b/src/etc/udev/rules.d/99-vyos-wwan.rules
new file mode 100644
index 000000000..67f30a3dd
--- /dev/null
+++ b/src/etc/udev/rules.d/99-vyos-wwan.rules
@@ -0,0 +1,11 @@
+ACTION!="add|change", GOTO="mbim_to_qmi_rules_end"
+
+SUBSYSTEM!="usb", GOTO="mbim_to_qmi_rules_end"
+
+# ignore any device with only one configuration
+ATTR{bNumConfigurations}=="1", GOTO="mbim_to_qmi_rules_end"
+
+# force Sierra Wireless MC7710 to configuration #1
+ATTR{idVendor}=="1199",ATTR{idProduct}=="68a2",ATTR{bConfigurationValue}="1"
+
+LABEL="mbim_to_qmi_rules_end"
diff --git a/src/etc/vmware-tools/scripts/resume-vm-default.d/ether-resume.py b/src/etc/vmware-tools/scripts/resume-vm-default.d/ether-resume.py
index 72da317f5..dc751c45c 100755
--- a/src/etc/vmware-tools/scripts/resume-vm-default.d/ether-resume.py
+++ b/src/etc/vmware-tools/scripts/resume-vm-default.d/ether-resume.py
@@ -15,11 +15,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys
-import subprocess
import syslog as sl
from vyos.config import Config
-from vyos.util import vyos
+from vyos import ConfigError
+from vyos.util import run
+
def get_config():
c = Config()
@@ -28,7 +29,7 @@ def get_config():
# skip interfaces that are disabled or is configured for dhcp
check_disable = "interfaces ethernet {} disable".format(intf)
check_dhcp = "interfaces ethernet {} address dhcp".format(intf)
- if c.exists_effective(check_disable) or c.exists_effective(check_dhcp):
+ if c.exists_effective(check_disable):
continue
# get addresses configured on the interface
@@ -38,23 +39,28 @@ def get_config():
interfaces[intf] = [addr.strip("'") for addr in intf_addresses]
return interfaces
+
def apply(config):
for intf, addresses in config.items():
# bring the interface up
cmd = ["ip", "link", "set", "dev", intf, "up"]
sl.syslog(sl.LOG_NOTICE, " ".join(cmd))
- subprocess.call(cmd)
+ run(cmd)
# add configured addresses to interface
for addr in addresses:
- cmd = ["ip", "address", "add", addr, "dev", intf]
+ if addr == "dhcp":
+ cmd = ["dhclient", intf]
+ else:
+ cmd = ["ip", "address", "add", addr, "dev", intf]
sl.syslog(sl.LOG_NOTICE, " ".join(cmd))
- subprocess.call(cmd)
+ run(cmd)
+
if __name__ == '__main__':
try:
config = get_config()
apply(config)
- except vyos.ConfigError as e:
+ except ConfigError as e:
print(e)
sys.exit(1)