summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/init/vyconfd.sh11
-rw-r--r--src/systemd/vyconfd.service2
2 files changed, 12 insertions, 1 deletions
diff --git a/src/init/vyconfd.sh b/src/init/vyconfd.sh
new file mode 100755
index 000000000..670651f57
--- /dev/null
+++ b/src/init/vyconfd.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+#
+# Check if state file exists to determine if restart
+if [ -f /var/run/vyconfd.state ]; then
+ echo "Restarting vyconfd from active config"
+ /usr/libexec/vyos/vyconf/vyconfd --log-file /var/run/log/vyconfd.log --reload-active-config --legacy-config-path
+else
+ echo "Starting vyconfd from saved config"
+ touch /var/run/vyconfd.state
+ /usr/libexec/vyos/vyconf/vyconfd --log-file /var/run/log/vyconfd.log --legacy-config-path
+fi
diff --git a/src/systemd/vyconfd.service b/src/systemd/vyconfd.service
index d23ca2202..6e6292f60 100644
--- a/src/systemd/vyconfd.service
+++ b/src/systemd/vyconfd.service
@@ -8,7 +8,7 @@ DefaultDependencies=no
After=systemd-remount-fs.service
[Service]
-ExecStart=/usr/libexec/vyos/vyconf/vyconfd --log-file /var/run/log/vyconfd.log --legacy-config-path
+ExecStart=/usr/libexec/vyos/init/vyconfd.sh
Type=exec
SyslogIdentifier=vyconfd
SyslogFacility=daemon