Commit Graph

55 Commits

Author SHA1 Message Date
Harald Hoyer 3f85ef0f05 s/commandline/command line/g 2014-11-06 15:34:18 +01:00
Hugo Grostabussiat a6fb0dc138 cryptsetup: Fix timeout on dm device.
Fix a bug in systemd-cryptsetup-generator which caused the drop-in
setting the job timeout for the dm device unit to be written with a
name different than the unit name.

https://bugs.freedesktop.org/show_bug.cgi?id=84409
2014-10-24 02:14:49 +02:00
Lennart Poettering 0e2f14014c cryptsetup: fix an OOM check 2014-10-23 00:39:42 +02:00
Daniel Buch d6bc8348d5 readahead: wipe out readahead 2014-09-25 16:39:18 +02:00
Zbigniew Jędrzejewski-Szmek 8eea868708 cryptsetup: allow x-systemd.device-timeout
https://bugs.freedesktop.org/show_bug.cgi?id=54210
2014-06-30 18:41:17 -04:00
Lennart Poettering bde29068aa cryptsetup: don't add unit dependency on /dev/null devices when it is listed as password file
As special magic, don't create device dependencies for /dev/null. Of
course, there might be similar devices we might want to include, but
given that none of them really make sense to specify as password source
there's really no point in checking for anything else here.

https://bugs.freedesktop.org/show_bug.cgi?id=75816
2014-06-23 19:18:44 +02:00
Lennart Poettering 8501384436 stop complaining about unknown kernel cmdline options
Also stop warning about unknown kernel cmdline options in the various
tools, not just in PID 1
2014-06-19 16:55:20 +02:00
Lennart Poettering 9542239eaf cryptsetup: introduce new cryptsetup-pre.traget unit so that services can make sure they are started before and stopped after any LUKS setup
https://bugzilla.redhat.com/show_bug.cgi?id=1097938
2014-06-18 00:09:46 +02:00
Matthew Monaco 66aaf85e17 cryptsetup: copy value, not key for (rd.)luks.key 2014-04-19 23:38:14 -04:00
Lennart Poettering c3834f9b88 generators: add Documentation= fields that point to the generator man pages 2014-03-06 18:48:22 +01:00
Lennart Poettering 059cb3858a util: move more intellegince into parse_proc_cmdline()
Already split variable assignments before invoking the callback. And
drop "rd." settings if we are not in an initrd.
2014-03-06 18:48:22 +01:00
Lennart Poettering 744198e925 cryptsetup: some fixes 2014-03-06 04:00:42 +01:00
Zbigniew Jędrzejewski-Szmek 141a79f491 Extract looping over /proc/cmdline into a shared function
In cryptsetup-generator automatic cleanup had to be replaced
with manual cleanup, and the code gets a bit longer. But existing
code had the issue that it returned negative values from main(),
which was wrong, so should be reworked anyway.
2014-02-17 02:26:22 -05:00
Dave Reisner 66a5dbdf28 cryptsetup-generator: auto add deps for device as password
If the password is a device file, we can add Requires/After dependencies
on the device rather than requiring the user to do so.
2014-02-08 13:53:02 -05:00
Lennart Poettering 74df0fca09 util: unify reading of /proc/cmdline
Instead of individually checking for containers in each user do this
once in a new call proc_cmdline() that read the file only if we are not
in a container.
2013-11-06 03:15:16 +01:00
Andrey Borzenkov 4469ff4ade set IgnoreOnIsolate=true for systemd-cryptsetup@.service
When crypttab contains noauto, cryptsetup service does not have any
explicit dependencies. If service is started later manually (directly or via
mount dependency) it will be stopped on isolate.

mount units already have IgnoreOnIsolate set by default. Set it by
default for cryptsetup units as well.
2013-09-29 20:36:59 +02:00
Eelco Dolstra a0f708053b Fix obsolete references to systemd-random-seed-load.service
This service was merged with systemd-random-seed-save.service in
c35b956d34.
2013-09-23 11:41:30 +02:00
Tom Gundersen 7ab064a6d6 cryptsetup-generator: allow specifying options in /proc/cmdline
The main usecase for this is to make it possible to use cryptsetup in
the initrd without it having to include a host-specific /etc/crypttab.

Tested-by: Thomas Bächler <thomas@archlinux.org>
2013-09-13 11:52:14 +02:00
Tom Gundersen 8c11d3c1b5 cryptsetup-generator: don't create tmp+swap units 2013-09-13 11:52:14 +02:00
Lennart Poettering 2b68185ac9 cryptsetup: downgrade world-writable warning again
This semi-reverts 8973790ee6.
2013-05-03 15:25:44 +02:00
Lennart Poettering 8973790ee6 cryptsetup: warn if /etc/crypttab is world-readable 2013-04-30 08:36:01 -03:00
Zbigniew Jędrzejewski-Szmek c79bb9e4e2 Standarize on one spelling of symlink error message
It's polite to print the name of the link that wasn't created,
and it makes little sense to print the target.
2013-04-24 00:25:04 -04:00
Lukas Nykryn 5a8e217859 crypt-setup-generator: correctly check return of strdup 2013-04-19 10:10:41 -04:00
Harald Hoyer 7fd1b19bc9 move _cleanup_ attribute in front of the type
http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
2013-04-18 09:11:22 +02:00
Harald Hoyer 951657bd0a cryptsetup-generator: add support for rd.luks.key=
Also clarify rd.luks.uuid and luks.uuid in the manual.

https://bugzilla.redhat.com/show_bug.cgi?id=905683
2013-04-18 02:45:01 +02:00
Harald Hoyer 68395007f3 cryptsetup-generator: add JobTimeoutSec=0 for the decrypted crypt devices
The password query for a crypto device currently times out after 90s,
which is too short to grab a cup of coffee when a machine boots	up.

The resulting decrypted device /dev/mapper/luks-<uuid> might not
be a mountpoint (but part of a LVM PV or raid array)
and therefore the timeout cannot be controlled by the settings
in /etc/fstab. For this reason this device should not carry its own timeout.

Also the encrypted device /dev/disk/by-*/* already has a timeout and
additionally the timeout for the password query is set in /etc/crypttab.

This patch disables the timeout of the resulting decrypted devices by creating
<device-unit>.d/50-job-timeout-sec-0.conf files with "JobTimeoutSec=0".
2013-04-04 17:40:09 +02:00
Thomas Weißschuh ceca950145 cryptsetup: add RequiresMountsFor for keyfile
This ensures that the keyfile is available during the opening of the encrypted
device.

Also dropped the explicit ordering Before=local-fs.target, as the containers
are ordered implicitly by their content.
2013-04-01 00:37:48 -04:00
Thomas Weißschuh 9ece938a67 cryptsetup: RequiresMountsFor if source is a file
Fixes: https://bugzilla.novell.com/show_bug.cgi?id=730496
       https://bugs.freedesktop.org/show_bug.cgi?id=60821
2013-04-01 00:37:48 -04:00
Lennart Poettering e32530cbef cryptsetup-generator: let's be a bit more efficient with strv_extend() 2013-03-25 23:51:32 +01:00
Lennart Poettering 608d41f355 cryptsetup-generator: add a missing OOM check 2013-03-25 23:49:13 +01:00
Harald Hoyer 24a988e9aa cryptsetup-generator: use _cleanup_ where possible 2013-03-13 09:18:30 +01:00
Harald Hoyer e2cb60fa97 cryptsetup-generator: fix the kernel command line strategy for luks.uuid
If rd.luks.uuid or luks.uuid is specified on the kernel command, only
generate units for these UUIDs. Additionally use the information in
/etc/crypttab unless rd.luks.crypttab=0 or luks.crypttab=0 is specified.
2013-03-01 15:05:28 +01:00
Harald Hoyer a860325e7e added some missing include for a5c32cff1f 2013-02-14 16:37:31 +01:00
Michal Schmidt 1cda32b8a2 cryptsetup-generator: state file name in error messages 2012-11-23 14:19:30 +01:00
Michal Schmidt 74576bea7a cryptsetup-generator: use log_oom() everywhere 2012-11-23 14:19:30 +01:00
Lennart Poettering 64825d3c58 fix a couple of issues found with llvm-analyze 2012-08-08 23:54:21 +02:00
Shawn Landden 0d0f0c50d3 log.h: new log_oom() -> int -ENOMEM, use it
also a number of minor fixups and bug fixes: spelling, oom errors
that didn't print errors, not properly forwarding error codes,
few more consistency issues, et cetera
2012-07-26 11:48:26 +02:00
Shawn Landden 669241a076 use "Out of memory." consistantly (or with "\n")
glibc/glib both use "out of memory" consistantly so maybe we should
consider that instead of this.

Eliminates one string out of a number of binaries. Also fixes extra newline
in udev/scsi_id
2012-07-25 11:23:57 +02:00
Lennart Poettering 7f2cddae09 unit: rename BindTo= to BindsTo=
all other dependencies are in 3rd person. Change BindTo= accordingly to
BindsTo=.

Of course, the dependency is widely used, hence we parse the old name
too for compatibility.
2012-07-13 23:34:40 +02:00
Lennart Poettering b7def68494 util: rename join() to strjoin()
This is to match strappend() and the other string related functions.
2012-07-13 13:41:01 +02:00
Lennart Poettering 1c7327004a man: add reference to crypttab(5) from cryptsetup units 2012-06-27 13:24:13 +02:00
Lennart Poettering d0d6944cdc man: document systemd-cryptsetup 2012-06-27 12:19:35 +02:00
Lennart Poettering 35eb6b124e cryptsetup: fix escaping when generating cryptsetup units 2012-06-25 20:16:15 +02:00
Lennart Poettering 6d37ea8a8e units: rename cryptsetup@.service to systemd-cryptsetup@.service
It's also our own code, hence should have the prefix.
2012-06-25 14:28:50 +02:00
Lennart Poettering 66a78c2b95 cryptsetup: allow configuration of LUKS disks via the kernel cmdline
This generalizes a bit of the functionality already available in dracut.
2012-06-22 10:11:06 +02:00
Kay Sievers d2e54fae5c mkdir: append _label to all mkdir() calls that explicitly set the selinux context 2012-05-31 12:40:20 +02:00
Lennart Poettering 07719a21b6 manager: rework generator logic
Previously generated units were always placed at the end of the search
path. With this change there will be three unit dirs instead of one, to
place generated entries at the beginning, in the middle and at the end
of the search path:

beginning: for units that need to override all configuration, regardless
of user or vendor. Example use: system-update-generator uses this to
temporarily redirect default.target.

middle: for units that need to override vendor configuration, but not
vendor configuration. Example use: /etc/fstab should override vendor
supplied configuration (think /tmp), but should not override native user
configuration.

end: does not override anything but is available as well. Possible usage
might be to convert D-Bus bus service files to native units but allowing
vendor supplied native units to win.
2012-05-23 03:43:29 +02:00
Lennart Poettering 1b64d026af units: remove service sysv_path variable and replace it by generic unit_path
UnitPath= is also writable via native units and may be used by generators
to clarify from which file a unit is generated. This patch also hooks up
the cryptsetup and fstab generators to set UnitPath= accordingly.
2012-05-22 23:08:24 +02:00
Lennart Poettering a690306153 log: make sure generators never log into the journal to avoid activation deadlocks
This makes all generators log to kmsg by default.
2012-05-22 22:00:37 +02:00
Lennart Poettering 6b1dc2bd3c mount: replace PID1 internal fstab parser with generator
Bit by bit we should remove non-unit parsing from PID 1 and move into
generators, to clean up our code base a bit and clearly separate
parsers.
2012-05-22 19:25:17 +02:00