Commit 65b27d84 by Martin Pitt Committed by Stéphane Graber

Add systemd unit for lxc.net

This is the equivalent of the upstart lxc-net.conf to set up the LXC bridge. This also drops "lxc.service" from tarballs. It is built source which depends on configure options, so the statically shipped file will not work on most systems. https://launchpad.net/bugs/1312532Signed-off-by: 's avatarMartin Pitt <martin.pitt@ubuntu.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent 213b0fe0
...@@ -114,6 +114,7 @@ config/lt*.m4 ...@@ -114,6 +114,7 @@ config/lt*.m4
config/bash/lxc config/bash/lxc
config/init/systemd/lxc-autostart-helper config/init/systemd/lxc-autostart-helper
config/init/systemd/lxc.service config/init/systemd/lxc.service
config/init/systemd/lxc-net.service
config/init/sysvinit/lxc config/init/sysvinit/lxc
doc/*.1 doc/*.1
......
EXTRA_DIST = \ EXTRA_DIST = \
lxc-devsetup \ lxc-devsetup \
lxc.service lxc.service.in \
lxc-net.service.in \
$(NULL)
if INIT_SCRIPT_SYSTEMD if INIT_SCRIPT_SYSTEMD
lxc-autostart-helper: ../sysvinit/lxc.in $(top_builddir)/config.status lxc-autostart-helper: ../sysvinit/lxc.in $(top_builddir)/config.status
...@@ -11,14 +13,15 @@ lxc-autostart-helper: ../sysvinit/lxc.in $(top_builddir)/config.status ...@@ -11,14 +13,15 @@ lxc-autostart-helper: ../sysvinit/lxc.in $(top_builddir)/config.status
< $< > $@-t && \ < $< > $@-t && \
chmod a+x $@-t && \ chmod a+x $@-t && \
mv $@-t $@ mv $@-t $@
BUILT_SOURCES = lxc-autostart-helper BUILT_SOURCES = lxc-autostart-helper lxc.service lxc-net.service
install-systemd: lxc.service lxc-devsetup lxc-autostart-helper install-systemd: lxc.service lxc-net.service lxc-devsetup lxc-autostart-helper
$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR) $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
$(INSTALL_DATA) lxc.service $(DESTDIR)$(SYSTEMD_UNIT_DIR)/ $(INSTALL_DATA) lxc.service lxc-net.service $(DESTDIR)$(SYSTEMD_UNIT_DIR)/
uninstall-systemd: uninstall-systemd:
rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/lxc.service rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/lxc.service
rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/lxc-net.service
rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || : rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
pkglibexec_SCRIPTS = lxc-devsetup lxc-autostart-helper pkglibexec_SCRIPTS = lxc-devsetup lxc-autostart-helper
......
[Unit]
Description=LXC network bridge setup
After=network.target
Before=lxc.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=@DATADIR@/lxc/lxc.net start
ExecStop=@DATADIR@/lxc/lxc.net stop
[Unit] [Unit]
Description=LXC Container Initialization and Autoboot Code Description=LXC Container Initialization and Autoboot Code
After=syslog.target network.target After=syslog.target network.target
Wants=lxc-net.service
[Service] [Service]
Type=oneshot Type=oneshot
......
...@@ -614,6 +614,7 @@ AC_CONFIG_FILES([ ...@@ -614,6 +614,7 @@ AC_CONFIG_FILES([
config/init/sysvinit/lxc config/init/sysvinit/lxc
config/init/systemd/Makefile config/init/systemd/Makefile
config/init/systemd/lxc.service config/init/systemd/lxc.service
config/init/systemd/lxc-net.service
config/init/upstart/Makefile config/init/upstart/Makefile
config/etc/Makefile config/etc/Makefile
config/templates/Makefile config/templates/Makefile
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment