Commit Graph

10670 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 5e65c93a43 systemd-activate: pass environment variables through
I need this to test half-installed socket-activated python
script, which requires PYTHONPATH and LD_LIBRARY_PATH set.
I assume that other people might find it useful to.

-E VAR passes through VAR from the environment, while
-E VAR=value sets VAR=value.

systemd-activate -E PYTHONPATH=/var/tmp/inst1/usr/lib64/python3.3/site-packages -E LD_LIBRARY_PATH=/var/tmp/inst1/usr/lib -l 2000 python3 -c 'from systemd.daemon import listen_fds; print(listen_fds())'
2013-03-15 22:55:24 -04:00
Kay Sievers 0f59fe5171 sysctl: default - add safe sysrq options 2013-03-15 19:30:53 +01:00
Kay Sievers 7aaec603d9 TODO: update 2013-03-15 17:48:12 +01:00
Lennart Poettering 9d60cb63d6 nspawn: don't make assumptions about the size of pid_t 2013-03-15 16:49:08 +01:00
Lennart Poettering bb27ff6672 logind: explicitly create state directories during early initialization
Strictly speaking this isn't necessary for the /run/systemd/seats/
directory, since that is created anyway as the first seat is found, and
seat0 is always found. But let's be explicit here, and also create the
sessions/ and users/ directories, so that people can always install
inotify watches from very early on, even when nobody logged in yet.
2013-03-15 16:49:08 +01:00
Lennart Poettering 66e411811b sd-booted: update sd_booted() check a bit
Previously we were testing whether /sys/fs/cgroup/systemd/ was a mount
point. This might be problematic however, when the cgroup trees are bind
mounted into a container from the host (which should be absolutely
valid), which might create the impression that the container was running
systemd, but only the host actually is.

Replace this by a check for the existance of the directory
/run/systemd/system/, which should work unconditionally, since /run can
never be a bind mount but *must* be a tmpfs on systemd systems, which is
flushed at boots. This means that data in /run always reflects
information about the current boot, and only of the local container,
which makes it the perfect choice for a check like this.

(As side effect this is nice to Ubuntu people who now use logind with
the systemd cgroup hierarchy, where the old sd_booted() check misdetects
systemd, even though they still run legacy Upstart.)
2013-03-15 16:49:08 +01:00
Lennart Poettering 961e452692 strv: fix STRV_FOREACH_PAIR macro definition 2013-03-15 16:49:07 +01:00
Kay Sievers 8f27a2212e sysctl: add 50-default.conf 2013-03-15 16:37:58 +01:00
Kay Sievers 94c525f076 sysctl: coredump.conf -> 50-coredump.conf 2013-03-15 15:59:21 +01:00
Kay Sievers d8a9ae897b man: bootup - "Systemd in the Initrd" -> "Initrd System Manager Bootup" 2013-03-15 12:34:50 +01:00
Harald Hoyer 9e5f0f9291 Make initrd.target the default target in the initrd
First, rename root-fs.target to initrd-root-fs.target to clarify its usage.

Mount units with "x-initrd-rootfs.mount" are now ordered before
initrd-root-fs.target. As we sometimes construct /sysroot mounts in
/etc/fstab in the initrd, we want these to be mounted before the
initrd-root-fs.target is active.

initrd.target can be the default target in the initrd.

                             (normal startup)
                                    :
                                    :
                                    v
                              basic.target
                                    |
             ______________________/|
            /                       |
            |                  sysroot.mount
            |                       |
            |                       v
            |             initrd-root-fs.target
            |                       |
            |                       v
            |            initrd-parse-etc.service
(custom initrd services)            |
            |                       v
            |            (sysroot-usr.mount and
            |             various mounts marked
            |               with fstab option
            |                x-initrd.mount)
            |                       |
            |                       v
            |                initrd-fs.target
            |                       |
            \______________________ |
                                   \|
                                    v
                               initrd.target
                                    |
                                    v
                          initrd-cleanup.service
                               isolates to
                         initrd-switch-root.target
                                    |
                                    v
             ______________________/|
            /                       |
            |        initrd-udevadm-cleanup-db.service
            |                       |
(custom initrd services)            |
            |                       |
            \______________________ |
                                   \|
                                    v
                        initrd-switch-root.target
                                    |
                                    v
                        initrd-switch-root.service
                                    |
                                    v
                               switch-root
2013-03-15 00:49:37 +01:00
Lennart Poettering c1dae1b3c9 main: don't mount /sys, /dev and friends when we run with PID != 1
Back from old times when we developed systemd on non-systemd hosts we
still mounted the missing directories such as the cgroup stuff even when
running with a PID != 1. There's no point for that anymore, so let's
just do that if we are actually PID 1, and never otherwise.

https://bugs.freedesktop.org/show_bug.cgi?id=62354
2013-03-14 21:39:07 +01:00
Zbigniew Jędrzejewski-Szmek 1c17cbed55 fileio: use _cleanup_ 2013-03-13 22:50:04 -04:00
Zbigniew Jędrzejewski-Szmek d29dd03302 build-sys: link libsystemd-login also against libsystemd-daemon-internal
https://bugs.freedesktop.org/show_bug.cgi?id=62085

/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../lib64/libsystemd-login.so:
undefined reference to `sd_listen_fds'

In ee465038ce 'build-sys: break dependency loop between
libsystemd-id128.la and -shared.la', a partial fix was applied, and
the use of functions from libsystemd-id128 was removed from
libsystemd-shared. Nevertheless, fdset.c was still using sd_listen_fds,
so libsystemd-login should be linked against libysystemd-daemon
or libsystemd-daemon-internal.

Tested-by: Elias Probst <mail@eliasprobst.eu>
2013-03-13 22:20:51 -04:00
Michal Sekletar 1609dcb137 systemctl: remove unused variable 2013-03-13 21:05:08 -04:00
Zbigniew Jędrzejewski-Szmek d39efe744a tmpfiles: add missing missing.h include
mbiebl> src/tmpfiles/tmpfiles.c:221:13: error: ‘MAX_HANDLE_SZ’
        undeclared (first use in this function)

Fixup for 427b47c4ab.
2013-03-13 20:27:36 -04:00
Zbigniew Jędrzejewski-Szmek 427b47c4ab initctl: catch write error, use _cleanup_
!= operator always returns something nonnegative, so the
error condition was not caught.
2013-03-13 19:53:45 -04:00
Zbigniew Jędrzejewski-Szmek 7199aa96ce journalctl: show systemd messages about unit for -u
journalctl -u unit is not very useful, because it doesn't show
systemd messages about starting, stopping, coredumps, etc,
like systemctl status unit does. Make it show the same
information using the same rules.

If somebody really want to see just messages from by the unit,
it is easy enough to use _SYSTEMD_UNIT=...
2013-03-13 19:53:45 -04:00
Zbigniew Jędrzejewski-Szmek 886a64fe69 logs-show: export logic to add matches for units
After that functions which add matches, show_journal_by_unit
and show_journal_by_user_unit, become nearly identical, so
I merged them into one function.
2013-03-13 19:53:29 -04:00
Thomas Hindoe Paaboel Andersen 7d7681f70b man: fix some typos 2013-03-13 23:09:49 +01:00
Zbigniew Jędrzejewski-Szmek 4afb5c73a2 build-sys: add two new files to EXTRA_DIST
Also move custom-*.xsl EXTRA_DIST additions closer to where
they are used.
2013-03-13 13:24:14 -04:00
Hannes Reinecke 946f182575 libudev: implement udev_device_set_attribute_value() 2013-03-13 17:44:45 +01:00
Michal Schmidt 814cc56212 core: single unit_kill implementation for all unit types
There are very few differences in the implementations of the kill method in the
unit types that have one. Let's unify them.

This does not yet unify unit_kill() with unit_kill_context().
2013-03-13 17:21:53 +01:00
Michal Schmidt 6282c859bd util, manager: and mempset() and use it
Just like mempcpy() is almost identical to memcpy() except the useful
return value, so is the relation of mempset() to memset().
2013-03-13 14:14:13 +01:00
Michal Schmidt 5052495bba manager: use more stpcpy() 2013-03-13 14:14:00 +01:00
Kay Sievers 99d680acf1 tmpfiles: --clean -- check for bind mounts of the same filesystem and skip them 2013-03-13 13:16:10 +01:00
Harald Hoyer 24a988e9aa cryptsetup-generator: use _cleanup_ where possible 2013-03-13 09:18:30 +01:00
Harald Hoyer 700e07ffd5 add initrd-fs.target and root-fs.target
Instead of using local-fs*.target in the initrd, use root-fs.target for
sysroot.mount and initrd-fs.target for /sysroot/usr and friends.

Using local-fs.target would mean to carry over the activated
local-fs.target to the isolated initrd-switch-root.target and thus in
the real root. Having local-fs.target already active after
deserialization causes ordering problems with the real root services and
targets.

We better isolate to targets for initrd-switch-root.target, which are
only available in the initrd.
2013-03-13 08:11:17 +01:00
Zbigniew Jędrzejewski-Szmek 783162123d build-sys: use -f with ln -s
Parallel builds would sometimes try to recreate the link,
and fail since 'ln -s' would refuse to overwrite.
2013-03-13 00:55:45 -04:00
Mathieu Bridon 3ae390ba02 man: Document the actual behaviour of ExecStopPost
The documentation makes it sound like ExecStopPost is only run when
stopping the service with `systemctl stop foo.service`

However, that is not the case, as it also gets run when the service
unexpectedly exists, crashes, or gets SIGKILLed.
2013-03-13 00:51:35 -04:00
Zbigniew Jędrzejewski-Szmek 702f64b93c man,html: say 'systemd 198' in the header
This should help readers of the man or HTML pages know if the documentation
is out of date. An alternative to use a date generated from 'git log' was
considered, but since we try to keep user visible documentation up to date,
showing the project version should be enough.
2013-03-12 23:57:46 -04:00
Zbigniew Jędrzejewski-Szmek a0b8045be2 man: strip the comments in man page headers
They contained the date, which creates a problem with multiarch
packages, since the generated file would be different each time.
2013-03-12 23:57:46 -04:00
Zbigniew Jędrzejewski-Szmek ee465038ce build-sys: break dependency loop between libsystemd-id128.la and -shared.la
The loop was added in d848b9cbfa 'Move generic specifier functions to shared'.
2013-03-12 23:05:53 -04:00
Michal Sekletar a63c198cc0 shutdown: move attribute packed to the end of the declaration, so it is not ignored 2013-03-13 01:39:11 +01:00
Michal Schmidt 5b176ee064 manager: push back animation timer whenever a job finishes
The running jobs animation is supposed to hide itself when jobs are
progressing sufficiently fast.
2013-03-13 00:13:24 +01:00
Harald Hoyer 6bde0b3220 remote-fs.target: want remote-fs-pre.target
This pulls in remote-fs-pre.target if remote-fs.target is needed.

Previously remote-fs-pre.target was not active, if no remote fs was
mounted from /etc/fstab. So, every manual remote fs mount was ordered
against the inactive remote-fs-pre.target and umount.target.

Because remote-fs-pre.target was not active, the remote fs was umounted
at umount.target time, which was too late (network already down).

Now remote-fs-pre.target is active, even if no remote fs is mounted.
On shutdown it is deactivated in the correct order and all manual remote
fs mounts also.
2013-03-12 18:24:44 +01:00
Michal Sekletar 4d4fe926cb core: fix getting information about mount unit
We should not try to get information about mount unit from fragment
if the unit was created because of /proc/self/mountinfo event.
2013-03-12 17:22:11 +01:00
Kay Sievers 3bf3cd95ab udevd: sort into sysinit instead of basic target 2013-03-12 15:56:19 +01:00
Zbigniew Jędrzejewski-Szmek fea7838e7e core/smack: downgrade info to debug
BogdanR> I think it's cool it supports SMACK and that it encourages
         them to use a propper mount point for smackfs but I don't
         think it's cool that it's printing on the screen even when
         I parse quiet to the kernel that "SMACK support is not
         enabled ...".
2013-03-11 18:03:13 -04:00
Zbigniew Jędrzejewski-Szmek 24be982274 Remove or indent #define GNU_SOURCE
It is only needed in files designed to be usable in standalone
compilation. In those files the #ifdefinery is indented. When
compiling in-tree, GNU_SOURCE is always defined, so remove one
definition.
2013-03-11 18:03:13 -04:00
Lennart Poettering 361514aca1 bootchart: bump RLIMIT_NOFILE only after we forked us off, so that the init system inherits the kernel default 2013-03-11 22:54:36 +01:00
Lennart Poettering 6d031c0b60 bootchart: various superficial cleanups
Let's update bootchar to share the coding style a bit more with the rest
of the package.

- Some tabs/spaces fixes

- add #pragma to header

- split up header so that we have a 1:1 relation between .c and .h files
  like everywhere else

- Prefix user command line arguments/configuration settings with "arg_".

- other coding style fixes
2013-03-11 22:47:58 +01:00
Lennart Poettering e75dcf5737 bootchart: rename log.c to store.c to aovid confusion with src/shared/log.c 2013-03-11 19:18:53 +01:00
Lennart Poettering 795607b223 update TODO 2013-03-11 17:49:49 +01:00
Michael Biebl b39ad46de4 Update .gitignore
for the changes in 7b40ce553f
2013-03-11 17:08:03 +01:00
Lennart Poettering 41891700e0 journald: allow priority of 999, too 2013-03-11 15:10:29 +01:00
Michael Biebl f432bb9144 Move udevadm to rootbindir
The udevadm utility is needed during early boot, so move it to
rootbindir to support split-/usr configurations.
2013-03-11 07:18:33 +01:00
Kay Sievers 0876dc1c26 bootctl: print Options only when found 2013-03-10 23:18:50 +01:00
Kay Sievers bc6f2e7c62 bootctl: print secure boot flags 2013-03-10 22:48:27 +01:00
Zbigniew Jędrzejewski-Szmek ad88e758d1 Fix typos of /etc/systemd/systemd
<Lekensteyn> The 198 announcement mentions
             "/etc/systemd/systemd/foobar.service.d/*.conf", is that a
             typo? I only have a /etc/systemd/system/. Is there a
             manpage describing this new feature?
2013-03-09 18:56:31 -05:00