Commit Graph

84 Commits

Author SHA1 Message Date
Serge Hallyn
820d2a2b3a switch from libsystemd's dbus to dbus-1
This is purely so that we can do static linking.  Linking against
libsystemd makes that a challenge because while it's perfectly simple
to do, distros tend not to provide a libsystemd.a.

Tools that want to (a) link against liblxc and (b) have a statically
linked binary to bind into a minimal container are ill served by
this.  So link against libdbus-1.

.github/workflows/build.yml: switch to dbus-1.
src/lxc/cgroups/cgfsng.c: replace the unpriv_systemd_create_scope(),
   start_scope, and enter_scope() systemd code with dbus-1 code.
src/tests/oss-fuzz.sh: update from libsystemd-dev to libdbus-1-dev
src/tests/oss-fuzz.sh: disable dbus
.github/workflows/*: update from libsystemd-dev to libdbus-1-dev
meson.build and meson_options.txt: switch from sd_bus to dbus
lxc.spec.in: add dbus-1 to BuildRequires

Signed-off-by: Serge Hallyn <serge@hallyn.com>

Changelog: 03/13: use custom iter type so we can cleanup more easily...
Changelog: 03/13: initialize each dbus_iter to { 0 } as mihalicyn suggested.
2023-03-19 15:30:56 -05:00
Pablo Correa Gómez
7f4386f096
Update lxc-net to support nftables
Closes #3093
Closes #3602

Add support for nftables firewall rules if `nft` command line
interface is available in the system

Signed-off-by: Pablo Correa Gómez <ablocorrea@hotmail.com>
2021-05-28 14:33:23 +02:00
Wolfgang Bumiller
b62782546c allow running lxc-monitord as a system daemon
lxc-monitord instances are spawned on demand and, if this
happens from a service, the daemon is considered part of
it by systemd, as it is running in the same cgroups. This
can be avoided by leaving it running permanently.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-31 15:34:56 +02:00
tomponline
a8a6c2c659 fix rpm packaging for bash completion directory.
Closed #1825

Signed-off-by: tomponline <tomp@tomp.uk>
2019-02-05 17:10:20 +00:00
2xsec
3b15904166
fix post section script error for rpm install
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-10-10 18:51:26 +09:00
2xsec
7701a78d8f
fix rpm packaging error for static library
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-10-10 18:21:41 +09:00
2xsec
a8eed52c17
add compile flags for dlog
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-09-13 11:37:54 +09:00
2xsec
723e380b6a move some comments in lxc.spec.in
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-25 13:26:39 +09:00
Christian Brauner
e144a06bd7
tree-wide: remove python3 bindings
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:33 +01:00
Christian Brauner
b52a5bef6f
tree-wide: remove lua bindings
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:33 +01:00
David Negreira
e82021215f Fixed typo on lxc.spec.in
Signed-off-by: David Negreira David@otherreality.net
2017-11-23 21:23:14 +01:00
Cam Cope
84432621ed
Configure a static MAC address on the LXC bridge
Signed-off-by: Cam Cope <cam@dropbox.com>
2016-11-22 15:16:32 -08:00
Evgeni Golov
bc39575656 fix rpm build, include all built files, but only once
Signed-off-by: Evgeni Golov <evgeni@debian.org>
2016-10-29 20:29:18 +02:00
Evgeni Golov
73bf276366 use python3_sitearch for including the python code
Closes: #502
Signed-off-by: Evgeni Golov <evgeni@debian.org>
2016-10-29 20:29:08 +02:00
Stéphane Graber
7c76d6b7b7 Drop lxc-devsetup as unneeded by current autodev
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2016-06-07 15:11:07 -04:00
Aleksandr Mezin
f6ab2204b7 python-lxc: use setuptools instead of distutils
setuptools is recommended by Python Packaging Guide
https://python-packaging-user-guide.readthedocs.io/en/latest/current/

It contains some useful extensions like 'develop' command. Also it
is required for building wheels AFAIK.

The only downside is an extra build-time dependency. setuptools are
packaged in both Debian and Ubuntu (python3-setuptools), as well as
other major distros, so it shouldn't be an issue, I think.

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2016-05-31 04:18:04 +06:00
Johannes Kastl
cd27b6c810 lxc.spec.in: fixed hardcoded path to lxc-net config file
Signed-off-by: Johannes Kastl <git@ojkastl.de>
2016-03-24 09:26:28 +01:00
Sungbae Yoo
2b371b262f doc: Add Korean man pages
Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
2015-06-11 20:08:58 +09:00
Johannes Kastl
1f3fc0d73a rpm: added dependency to lxc-libs to lxc package
Ensures matching versions of lxc and lxc-libs being installed

Signed-off-by: Johannes Kastl <mail@ojkastl.de>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2015-01-24 16:46:04 -05:00
Veres Lajos
ec64264d78 typofixes - https://github.com/vlajos/misspell_fixer
Signed-off-by: Veres Lajos <vlajos@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-04 18:40:26 -05:00
Dwight Engen
fce070c815 fixups to init script rework
- move action() from common to sysvinit wrapper since its only really
  applicable for sysvinit and not the other init systems

- fix bug in action() fallback, need to shift away msg before executing action

- make lxc-net 98 so it starts before lxc-container (99), otherwise the lxcbr0
  won't be available when containers are autostarted

- make the default RUNTIME_PATH be /var/run instead of /run. On older
  distros (like ol6.5) /run doesn't exist. lxc-net will create this directory
  and attempt to create the dnsmasq.pid file in it, but this will fail when
  SELinux is enabled because the directory will have the default_t type.
  Newer systems have /var/run symlinked to /run so you get to the same place
  in that case.

- add %postun to remove lxc-dnsmasq user when pkgs are removed

- fix bug in lxc-oracle template that was creating /var/lock/subsys/lxc as
  a dir and interfering with the init scripts

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-09-29 12:17:11 -04:00
Michael H. Warfield
0af993195c Rework init scripts
This commit is based on the work of:
    Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>

A generic changelog would be:
 - Bring support for lxcbr0 to all distributions
 - Share the container startup and network configuration logic across
   distributions and init systems.
 - Have all the init scripts call the helper script.
 - Support for the various different distro-specific configuration
   locations to configure lxc-net and container startup.

Changes on top of Mike's original version:
 - Remove sysconfig/lxc-net as it's apparently only there as a
   workaround for an RPM limitation and is breaking Debian systems by
   including a useless file which will get registered as a package provided
   conffile in the dpkg database and will therefore cause conffile prompts
   on upgrades...
 - Go with a consistant coding style in the various init scripts.
 - Split out the common logic from the sysvinit scripts and ship both in
   their respective location rather than have them be copies.
 - Fix the upstart jobs so they actually work (there's no such thing as
   libexec on Debian systems).

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-09-26 10:55:11 -04:00
Michael H. Warfield
015f0dd792 lxc-autostart: rework boot and group handling
This adds new functionality to lxc-autostart.

*) The -g / --groups option is multiple cummulative entry.
	This may be mixed freely with the previous comma separated
	group list convention.  Groups are processed in the
	order they first appear in the aggregated group list.

*) The NULL group may be specified in the group list using either a
	leading comma, a trailing comma, or an embedded comma.

*) Booting proceeds in order of the groups specified on the command line
	then ordered by lxc.start.order and name collalating sequence.

*) Default host bootup is now specified as "-g onboot," meaning that first
	the "onboot" group is booted and then any remaining enabled
	containers in the NULL group are booted.

*) Adds documentation to lxc-autostart for -g processing order and
	combinations.

*) Parameterizes bootgroups, options, and shutdown delay in init scripts
	and services.

*) Update the various init scripts to use lxc-autostart in a similar way.

Reported-by: CDR <venefax@gmail.com>
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-06-03 11:10:01 -04:00
Dwight Engen
ba5783a56a lxc.spec: adjust for move of libexecdir/lxc-init to sbin/lxc.init
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-03-31 18:24:21 -05:00
Dwight Engen
9f2fd74c7b add lua-alt-getopt dependency
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-24 11:52:39 -05:00
Dwight Engen
e0f2f5c764 lxc.spec: package bash completion, lxc-monitord move
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-22 15:19:59 -05:00
Stéphane Graber
45e854dc86 Move lxc-user-nic and lxc-monitord to libexec
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-20 23:27:16 -05:00
Stéphane Graber
dc0682900a init: Add upstart jobs and some more changes (v3)
This adds the 3 upstart jobs that we've had in Ubuntu for a while:
 - lxc.conf: Main upstart job, triggers lxc-net.conf based on config
 - lxc-instance.conf: Triggered by lxc.conf for each auto-started container
 - lxc-net.conf: Triggered by lxc.conf, sets up lxcbr0, NAT, mangling, ...

In addition, there are two extra config files in /etc/default:
 - lxc: Allows setting some values like http proxying, disabling autostart, ...
 - lxc-net: Network configuration for the lxcbr0 bridge

This change also disables the sysv script for all distros but Oracle as
the current script won't work on either Ubuntu nor Debian and I suspect
quite a few more distros, so it's not nearly as distro-agnostic as we
thought.

For Debian, only install the upstart jobs and systemd unit.
For Ubuntu, only install the upstart jobs.

This change also moves all the init related stuff to config/init/

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2014-01-16 17:18:38 -05:00
Dwight Engen
a3da3d8296 install only lxc-user-nic setuid
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-01-15 10:06:16 -05:00
Dwight Engen
420dfb599b add lxc-autostart support for sysv init systems
This change updates the way init scripts get installed so that more
than one init system can be supported. Instead of installing the
systemd service file from the spec file, it should be installed at
make install time, so that someone compiling from source also gets
the unit file installed.

Update the plamo template to use a lock file not named just
/var/lock/subsys/lxc since the presence of that file is used by
sysv init rc file to know if it should run the K01lxc script. This
also makes it consistent with the other templates which use
/var/lock/subsys/lxc-$template-name.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2014-01-03 13:49:04 -06:00
Michael H. Warfield
58d6a17e02 Catch the python packages when building them.
If we have "with_python" we want to add the resulting packages to
the resulting rpm.

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-12-19 22:19:30 +01:00
Stéphane Graber
f7f1ba77b7
Drop trailing white spaces.
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-11-25 11:52:43 -05:00
Michael H. Warfield
87ff951e68 Support files for systemd on Fedora.
Added a file "lxc.service" for a systemd service file.

Added a file "lxc-devsetup" to setup /dev/ on startup to support autodev
in containers.

Service file references lxc-devsetup as an ExecStartPre command.  The
lxc-devsetup script is not dependent on systemd or Fedora and can
be used at bootup on any system.

Modified lxc.spec.in to install the two new files on Fedora.  The systemd
specific code in the lxc.spec file may need some review and conditionalize
for systemd on non-systemd rpm-based systems.

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-11-21 11:25:35 -06:00
Serge Hallyn
9588a6cecb rpm spec: fix version numbering when building alpha, beta, rc
We want to ensure smooth upgrades when doing rpm -U throughout the
release cycle so this change implements the scheme documented at:
http://fedoraproject.org/wiki/Packaging%3aNamingGuidelines#NonNumericRelease

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-29 14:50:07 -04:00
Dwight Engen
7920b1b435 rpm spec: fix "warning: bogus date in %changelog"
Mar 24 2009 was actually a Tuesday, maybe Daniel was still recovering
from Monday ;) Stranger still that RPM actually checks this!?

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-10-25 16:18:17 -05:00
Dwight Engen
0adde0f841 update rpm .spec file
The following changes were made to fix rpmlint warnings/errors
- use %global instead of %define
  http://fedoraproject.org/wiki/PackagingDrafts/global_preferred_over_define
- change Summary to match .deb
- update License
- do not mention the libcap dependency explicitly, rpm will fill it in
- fix Summary, Description for libs and devel packages
- pass -q to %setup
- add %post for libs to run ldconfig
- explicitly name lxc man paths so pkg doesn't "own" /usr/share/man
- mark /etc/lxc/default.conf as a config file

In addition, while I was here:
- split lua bits into seperate lxc-lua package
- change Description to match .deb
- remove "Version" in changelog entries to follow
  http://fedoraproject.org/wiki/Packaging:Guidelines#Changelogs

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-22 16:47:25 -04:00
Stéphane Graber
07520b2af5
Update maintainers and URLs
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-10-20 00:48:48 -04:00
Stéphane Graber
250b1eec71
licensing: Add missing headers and FSF address
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2013-09-03 14:33:03 -04:00
Dwight Engen
dc5e436e70 lxc.spec.in: remove lxc-shutdown (for commit 3e625e2d)
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-05-29 09:03:49 -05:00
Daniel Lezcano
9afe19d634 Change author email address
Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
2013-03-19 11:19:13 +01:00
Dwight Engen
f080ffd7d6 add lua binding for the lxc API
The lua binding is based closely on the python binding. Also included are
a test program for excercising the binding, and an lxc-top utility for
showing statistics on running containers.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-01-28 18:04:08 -05:00
Dwight Engen
ce95113287 include python files in make dist and rpm
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-01-23 17:30:07 -05:00
Dwight Engen
7323456ec3 assume LXCPATH took on default localstatedir based value in configure
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Michael H. Warfield <mhw@WittsEnd.com>
2012-12-10 12:34:53 -05:00
Dwight Engen
1c6085cdd9 lxc.spec: add openssl and rsync as Required since both are used in lxc-clone
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2012-12-06 10:08:20 -05:00
Dwight Engen
f1a3a3ab8f make install should create /var/cache/lxc directory
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2012-12-05 15:23:27 -05:00
Dwight Engen
4245ba5007 make install should create $LXCPATH directory
The $LXCPATH (default /var/lib/lxc) directory was not being created by
make install, so unless it gets created by some other means
(packaging tools), commands such as lxc-create will fail.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2012-12-04 15:11:23 -05:00
Dwight Engen
f6a8db2d94 Fix package name needed for building docs with RPM
Tested on Oracle Linux 6 and Fedora 17

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2012-11-14 10:55:06 -05:00
Peter Simons
aa8d013ec5 Update documentation to Docbook 4.5
The package 'docbook-tools' [1] required to format Docbook 3.0 into man pages
has been obsoleted a long time ago and can no longer be downloaded from its
former homepage. Recent versions of that package -- now called 'docbook2X' --,
cannot deal with that old markup format anymore (and don't support the '-w all'
command line switch either). To remedy these issues, all SGML files have been
updated to Docbook 4.5 so that recent versions of docbook2man can process them.

[1] http://sources.redhat.com/docbook-tools/
[2] http://docbook2x.sourceforge.net/

Signed-off-by: Peter Simons <simons@cryp.to>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2012-11-12 15:20:39 -05:00
Dwight Engen
6f75ba0bda Add distro config file /etc/lxc/lxc.conf
This allows a distro to put the distro specific default network
configuration (for example bridge device, link type), or other lxc
configuration in the case that -f is not passed by the user to
lxc-create, in which case lxc-create will use the distro conf file as
the basis for the containers config.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2012-11-12 13:18:32 -05:00
Dwight Engen
f7a81eeb14 Remove unneeded ksrc spec file macro
Change 910bb4fa obviated the need for the --with-linuxdir configure
option which means that the ksrc rpm macro no longer makes sense either.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2012-10-31 17:08:13 +01:00