diff options
author | Kim <kim.sidney@gmail.com> | 2018-10-14 21:33:06 +0200 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2018-10-15 02:33:06 +0700 |
commit | 576786c97065c8e5638e9e0a7cad688175cd3746 (patch) | |
tree | 8fc811fa1e16e4a63fd652d98394e7b4610ccfaf /debian | |
parent | 1f1175135c8b15322852319150c8ed12d99b7a92 (diff) | |
download | vyatta-cfg-576786c97065c8e5638e9e0a7cad688175cd3746.tar.gz vyatta-cfg-576786c97065c8e5638e9e0a7cad688175cd3746.zip |
Rework vyos router init (#11)
* Add a systemd vyos.target and split the vyatta-router
init script to multiple systemd scripts.
* remove ref to cloud-init
* Remove vyatta-router init and rename vyatta-router to vyos-initialize.
* Install files to correct dirs
* try to fix systemd boot issues
* Update script names
run config load in background to not block systemd
* Prevent cat: write error: Broken pipe
* Rework vyos startup
* add systemd to Makefile.am
* Update script name
* Fix inclusion of getty conf
* Fix indentation
Diffstat (limited to 'debian')
-rwxr-xr-x | debian/rules | 7 | ||||
-rw-r--r-- | debian/vyatta-cfg.install | 2 | ||||
-rw-r--r-- | debian/vyatta-cfg.postinst.in | 3 | ||||
-rw-r--r-- | debian/vyatta-cfg.postrm.in | 4 | ||||
-rw-r--r-- | debian/vyatta-cfg.vyatta-router.service | 22 | ||||
-rw-r--r-- | debian/vyatta-cfg.vyos-router.service | 18 | ||||
-rw-r--r-- | debian/vyatta-cfg.vyos.target | 3 |
7 files changed, 32 insertions, 27 deletions
diff --git a/debian/rules b/debian/rules index eab1375..2603b2d 100755 --- a/debian/rules +++ b/debian/rules @@ -1,5 +1,9 @@ #!/usr/bin/make -f +DIR := debian/vyatta-cfg +VYOS_LIBEXEC_DIR := usr/libexec/vyos +SYSTEM_GENERATORS_DIR := lib/systemd/system-generators + export DH_OPTIONS ## uncomment to enable hardening @@ -44,5 +48,6 @@ override_dh_install: dh_install $(inst_opts) override_dh_systemd_enable: - dh_systemd_enable -pvyatta-cfg --name vyatta-router vyatta-router.service + dh_systemd_enable -pvyatta-cfg --name vyos-router vyos-router.service + dh_systemd_enable -pvyatta-cfg --name vyos vyos.target diff --git a/debian/vyatta-cfg.install b/debian/vyatta-cfg.install index 8c9aca2..abbe975 100644 --- a/debian/vyatta-cfg.install +++ b/debian/vyatta-cfg.install @@ -4,3 +4,5 @@ opt/vyatta/share/vyatta-cfg/functions opt/vyatta/sbin opt/vyatta/etc bin +usr/libexec +lib diff --git a/debian/vyatta-cfg.postinst.in b/debian/vyatta-cfg.postinst.in index fc9b07b..a741b62 100644 --- a/debian/vyatta-cfg.postinst.in +++ b/debian/vyatta-cfg.postinst.in @@ -16,8 +16,7 @@ for dir in $sysconfdir/config $prefix/config; do chgrp vyattacfg $dir 2>/dev/null done -update-rc.d vyatta-router defaults 90 >/dev/null -systemctl enable vyatta-router.service >/dev/null +systemctl enable vyos-router.service >/dev/null # capability stuff for bin in my_cli_bin my_cli_shell_api; do diff --git a/debian/vyatta-cfg.postrm.in b/debian/vyatta-cfg.postrm.in index b184f20..b4cbc80 100644 --- a/debian/vyatta-cfg.postrm.in +++ b/debian/vyatta-cfg.postrm.in @@ -1,7 +1,7 @@ #!/bin/bash -e if [ "$1" = "purge" ]; then - update-rc.d vyatta-router remove >/dev/null || exit $? - systemctl disable vyatta-router.service >/dev/null || exit $? + systemctl disable vyos-initialize.service >/dev/null || exit $? + systemctl disable vyos-config-load.service >/dev/null || exit $? fi diff --git a/debian/vyatta-cfg.vyatta-router.service b/debian/vyatta-cfg.vyatta-router.service deleted file mode 100644 index 0ecf6f4..0000000 --- a/debian/vyatta-cfg.vyatta-router.service +++ /dev/null @@ -1,22 +0,0 @@ -[Unit] -SourcePath=/etc/init.d/vyatta-router -Description=VyOS Router -Before=runlevel2.target runlevel3.target runlevel4.target runlevel5.target shutdown.target getty@tty1.service getty@tty2.service getty@rrt3.service getty@tty4.service getty@tty5.service getty@tty6.service -After=systemd-journald-dev-log.socket time-sync.target local-fs.target -Conflicts=shutdown.target - -[Service] -Type=oneshot -Restart=no -TimeoutSec=5min -IgnoreSIGPIPE=no -KillMode=process -GuessMainPID=no -RemainAfterExit=yes -SysVStartPriority=4 -ExecStart=/etc/init.d/vyatta-router start -ExecStop=/etc/init.d/vyatta-router stop -StandardOutput=journal+console - -[Install] -WantedBy=multi-user.target diff --git a/debian/vyatta-cfg.vyos-router.service b/debian/vyatta-cfg.vyos-router.service new file mode 100644 index 0000000..9cc6f12 --- /dev/null +++ b/debian/vyatta-cfg.vyos-router.service @@ -0,0 +1,18 @@ +[Unit] +Description=VyOS Router +After=systemd-journald-dev-log.socket time-sync.target local-fs.target +Conflicts=shutdown.target +Before=systemd-user-sessions.service + +[Service] +Type=simple +Restart=no +TimeoutSec=5min +KillMode=process +RemainAfterExit=yes +ExecStart=/usr/libexec/vyos/init/vyos-router start +ExecStop=/usr/libexec/vyos/init/vyos-router stop +StandardOutput=journal+console + +[Install] +WantedBy=vyos.target diff --git a/debian/vyatta-cfg.vyos.target b/debian/vyatta-cfg.vyos.target new file mode 100644 index 0000000..47c91c1 --- /dev/null +++ b/debian/vyatta-cfg.vyos.target @@ -0,0 +1,3 @@ +[Unit] +Description=VyOS target +After=multi-user.target |