Commit Graph

27 Commits

Author SHA1 Message Date
Brian C. Lane
81ce55a1e5 lorax: Move default tmp dir to /var/tmp/lorax
If systemd's tmpfiles.d timer is executed while lorax is running it will
remove any files and directories older than 30 days. This is what has
been causing the occasional error where /proc/ would seem to vanish
during the install.

Upstream has proposed this solution, https://github.com/systemd/systemd/pull/11482
but until that is released we need a work-around to protect the lorax
files.

This commit does several things:

* Move the default tmpdir from /var/tmp/ to /var/tmp/lorax/
* Add a lorax.conf tmpfiles.d file that prevents systemd-tmpfiles from
  removing anything under /var/tmp/lorax/
* Add an exit handler to lorax so that temporary directories are removed on
  exit or on a python traceback.
* Use flock to lock access to the tempdir while lorax is running.
* Remove any unlocked tempdirs named /var/tmp/lorax/lorax.* at startup

Note that the exit handler will not remove the tempdir if lorax is
killed with a signal -- those are being caught by dnf and prevent the
exit handler from running.

systemd-tmpfiles cannot clean up the tempdirs at boot time because they
contain files labeled as shadow_t, so we have to remove those when lorax
runs. It uses the flock to prevent removing any directories created by
parallel instances of lorax and only removes ones that are unlocked.
Worst case they will be around until the first run of lorax after a
reboot.

If you want to keep the working directory around for debugging purposes
use --workdir /var/tmp/lorax/my-workdir and it won't be removed by
lorax.

Resolves: rhbz#1668520
2019-01-22 17:12:56 -08:00
Brian C. Lane
ffc3195d77 Add support for systemd socket activation
Instead of enabling lorax-composer.service enable lorax-composer.socket
and it will start lorax-composer on first access to
/run/weldr/api.socket
2018-06-11 16:54:59 -07:00
Brian C. Lane
579e6840f8 Install the composer-cli library and include it in the rpm 2018-06-11 16:54:58 -07:00
Brian C. Lane
d2f784e5da Add composer-cli utility and implement the recipes commands
composer-cli --help shows the commands.
Output defaults to human readable, but raw json can be displayed by
passing --json
2018-06-11 16:54:58 -07:00
Brian C. Lane
c1bd07635a Fix wrong name for /etc/composer.conf 2018-06-11 16:54:58 -07:00
Brian C. Lane
569ce1d3dc Add support for yum to lorax-composer
This includes a new configuration file at /etc/lorax/composer.conf with
built-in defaults. It also adds a YUMLOCK server config object so that
request handlers can access the yum base object without interfering
with each other.
2018-06-11 16:54:58 -07:00
Brian C. Lane
3bbbeb347a setup.py: Add pylorax.api module to install, and systemd service
lorax-composer.service will be installed by default, but not enabled.
It stores recipes at /var/lib/lorax-composer/recipes/
2018-06-11 16:54:57 -07:00
Alexander Todorov
15de3e1687 pylint fix: remove unused imports 2018-06-11 16:54:57 -07:00
Brian C. Lane
641bbc21af Install mk-s390-cdboot to /usr/bin/ (#1478448)
Related: rhbz#1478448
2017-08-15 14:55:46 -07:00
Brian C. Lane
e543fecde0 move image-minimizer to lorax (#1082642)
This is used as a kickstart %post interpreter to streamline
modifications to images.

Also adds an example kickstart.

This Obsoletes the old appliance-tools-minimizer and includes a Provide
so that the transition will be seamless.

(cherry picked from commit 99f2ab9137)
(cherry picked from commit b090a09dca)

Resolves: rhbz#1082642
2014-10-22 10:32:14 -07:00
Brian C. Lane
14fa40556c Stop using /usr/bin/env (#987028) 2013-07-24 13:41:03 -07:00
Brian C. Lane
d3a9e77315 Modify spec file for livemedia-creator 2011-12-20 14:59:58 -08:00
Martin Gracik
73fc20b165 Write the lorax verion in the .buildstamp (#689697)
(cherry picked from commit 4271e0fc02)

Conflicts:
	src/pylorax/buildstamp.py

Signed-off-by: Will Woods <wwoods@redhat.com>
2011-10-24 16:07:25 -04:00
Will Woods
4343b12fc0 mkefiboot fixups (fix imports, mkdosimg, add to setup.py) 2011-05-12 17:28:53 -04:00
Martin Gracik
3a0ed30cca Setup and spec file changes
Added the license files and executable.
Marked lorax.conf as config.
2010-12-17 17:04:04 +01:00
Martin Gracik
8a91123766 Update setup.py 2010-12-02 13:37:06 +01:00
Martin Gracik
45c5ef566c Experimental single initrd image 2010-10-12 18:32:35 +02:00
Martin Gracik
1ab4a60bc7 Added some packages and config files
Also fixed the modules symlink
2010-04-02 14:20:05 +02:00
Martin Gracik
a4c638f132 New version 2010-02-23 14:20:05 +01:00
David Cantrell
6c6a55154a Fix /usr/share/lorax installation. 2008-10-04 20:15:56 -10:00
David Cantrell
c158df0024 Make sure /etc and /usr/share files go to the right place. 2008-10-04 20:14:31 -10:00
David Cantrell
c8e52cbf27 Use os.path.join() rather than explicitly listing full paths. 2008-10-04 20:09:46 -10:00
David Cantrell
f1375c5ea8 Fix more problems in setup.py. 2008-10-04 20:09:04 -10:00
David Cantrell
46052c010d Build the list of data_files more correctly in setup.py.
Build individual file lists for each subdirectory in etc/
2008-10-04 20:05:53 -10:00
David Cantrell
c01846d9ae lorax.py -> lorax 2008-10-04 19:53:33 -10:00
David Cantrell
5623014506 Write Makefile and correct problems in setup.py. 2008-10-04 19:51:17 -10:00
David Cantrell
f1ba230378 Added setup.py, a distutils-based install script. 2008-10-04 19:46:04 -10:00