Skip to content

Commit 018b6fd

Browse files
committed
T7980: distinguish vyconfd initialization from restart
1 parent 75716e9 commit 018b6fd

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/init/vyconfd.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
#
3+
# Check if state file exists to determine if restart
4+
if [ -f /var/run/vyconfd.state ]; then
5+
echo "Restarting vyconfd from active config"
6+
/usr/libexec/vyos/vyconf/vyconfd --log-file /var/run/log/vyconfd.log --reload-active-config --legacy-config-path
7+
else
8+
echo "Starting vyconfd from saved config"
9+
touch /var/run/vyconfd.state
10+
/usr/libexec/vyos/vyconf/vyconfd --log-file /var/run/log/vyconfd.log --legacy-config-path
11+
fi

src/systemd/vyconfd.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ DefaultDependencies=no
88
After=systemd-remount-fs.service
99

1010
[Service]
11-
ExecStart=/usr/libexec/vyos/vyconf/vyconfd --log-file /var/run/log/vyconfd.log --legacy-config-path
11+
ExecStart=/usr/libexec/vyos/init/vyconfd.sh
1212
Type=exec
1313
SyslogIdentifier=vyconfd
1414
SyslogFacility=daemon

0 commit comments

Comments
 (0)