1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 17:51:22 +03:00
Commit Graph

323 Commits

Author SHA1 Message Date
Lennart Poettering
399c5f9633 mount: drop unused function 2012-05-22 19:50:10 +02:00
Lennart Poettering
e6a2674500 execute: use a much lower idle timeout that default time
The idle timeout after all is for cosmetics only, hence avoid any
substantial delays just for it.
2012-05-22 19:26:15 +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
Kay Sievers
745e2fb79a main: only fall back to /bin/sh in case /sbin/init does not exist 2012-05-22 19:17:40 +02:00
Harald Hoyer
b46178e5c2 switch-root: do not use close old_root_fd after rm_rf_children()
rm_rf_children() has already closed the fd with closedir().
2012-05-22 16:15:09 +02:00
Lennart Poettering
bf4df7c3b6 main: properly queue default.target after switched root
This also introduces rd.systemd.unit= to specify the unit to boot into
in the initrd.
2012-05-22 13:22:00 +02:00
Lennart Poettering
92a39ae198 mount: use the same fstab extension option syntax everywhere
The man page and the actual code differed, and this is now corrected
2012-05-22 02:00:53 +02:00
David Ward
2e9d6c1251 service: fix auto-restart handling in service_start()
Do not bypass the SERVICE_DEAD/SERVICE_FAILED state by manually issuing
a start job while an automatic restart is pending.
2012-05-22 01:57:21 +02:00
David Ward
f0c7b229e1 service: fix auto-restart handling in service_stop()
When service_stop() handles a service in the SERVICE_AUTO_RESTART state,
it calls service_set_state() to transition it to the SERVICE_DEAD state.
However if the service failed, it should transition it to SERVICE_FAILED
instead, which will trigger its OnFailure units. To achieve this, we now
call service_enter_dead() in place of service_set_state(), which will
transition the service to either SERVICE_DEAD or SERVICE_FAILED as is
appropriate.

Also, some misleading comments are adjusted: service_stop() is not only
called on a user request, but also during an automatic restart in order
to handle dependencies.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45511
2012-05-22 01:55:52 +02:00
David Ward
feae8adb84 service: actually delay auto-restart if another job is pending
https://bugs.freedesktop.org/show_bug.cgi?id=45511
2012-05-22 01:53:30 +02:00
Frederic Crozat
c93ff2e913 main: allow system wide limits for services 2012-05-21 21:13:27 +02:00
Lennart Poettering
2660882b52 main: rename a few fix to follow general naming style 2012-05-21 19:48:04 +02:00
Lennart Poettering
416693175b switch-root: move switch_root() call into its own .c file 2012-05-21 19:33:39 +02:00
Harald Hoyer
97a66e9470 main: do_switch_root() do not recursively remove across device boundaries 2012-05-21 18:53:02 +02:00
Harald Hoyer
c3ba62509e core/main.c: handle the initrd timestamp differently, if in the initrd
If systemd is in the initrd/initramfs, set the initrd timestamp and do
not try to read it from the RD_TIMESTAMP environment variable.
2012-05-21 18:51:05 +02:00
Harald Hoyer
e148ac5a6c core/main.c: do_switch_root(): do not remove the old root if not in initrd
Only recursively remove the old root, if we have been in an
initrd/initramfs.
2012-05-21 18:50:29 +02:00
Harald Hoyer
d03bc1b814 core/main.c: add "--switchedroot" parameter
If systemd serializes from a switch_root, it adds "--switchedroot" to
the systemd in the real root.

If "--switchedroot" is found, then we do not skip all the stuff, which
is skipped for normal rexecs.
2012-05-21 18:50:06 +02:00
Harald Hoyer
f38ed06060 manager: only serialize the timestamps for the initramfs if in_initrd() 2012-05-21 18:49:31 +02:00
Harald Hoyer
f67cc036ba main: corrected do_switch_root()
do_switch_root now mount moves "/dev", "/proc", "/sys", "/run" and
removes the old root recursively.
2012-05-21 18:45:10 +02:00
Auke Kok
940c521034 sd-pam: Drop uid so parent signal arrives at child.
The PAM helper thread needs to capture the death signal from the
parent, but is prohibited from doing so since when the child dies
as normal user, the kernel won't allow it to send a TERM to the
PAM helper thread which is running as root.

This causes the PAM threads to never exit, accumulating after
user sessions exit.

There is however really no need to keep the PAM threads running as
root, so, we can just setresuid() to the same user as defined in the
unit file for the parent thread (User=). This makes the TERM signal
arrive as normal. In case setresuid() fails, we ignore the error, so
we at least fall back to the current behaviour.
2012-05-21 17:57:48 +02:00
Lennart Poettering
b8f8323268 main: try a bit harder to find an init process to execute after reexec/switch-root 2012-05-21 17:26:19 +02:00
Lennart Poettering
3614084261 service: make the fsck pass no configurable 2012-05-21 17:24:26 +02:00
Lennart Poettering
f7f21d33db cryptsetup: a few simplifications 2012-05-21 17:22:40 +02:00
Lennart Poettering
344de60901 hostname-setup: also consider (ńone) an unset hostname 2012-05-21 17:19:58 +02:00
Lennart Poettering
78d54bd42b unit: introduce RequiredBy= setting in [Install], to complement WantedBy= 2012-05-21 15:27:26 +02:00
Lennart Poettering
49dbfa7b2b units: introduce new Documentation= field and make use of it everywhere
This should help making the boot process a bit easier to explore and
understand for the administrator. The simple idea is that "systemctl
status" now shows a link to documentation alongside the other status and
decriptionary information of a service.

This patch adds the necessary fields to all our shipped units if we have
proper documentation for them.
2012-05-21 15:14:51 +02:00
Michal Schmidt
80fbf05e75 dbus-unit: always load the unit before handling a message for it
We need to be able to show the properties even of inactive units.
systemctl loads the unit before getting its properties, but this is racy
as the garbage collector may kick in right after the loading.

Fix it by always loading the unit before handling a message for it.

https://bugzilla.redhat.com/show_bug.cgi?id=814966#c6
2012-05-21 12:54:34 +02:00
Lennart Poettering
ee83acc49b switch-root: check for absolute paths 2012-05-16 03:24:50 +02:00
Lennart Poettering
c1d70f7ca5 namespace: make PrivateTmp= apply to both /tmp and /var/tmp 2012-05-14 22:41:30 +02:00
Lennart Poettering
50913bc0c8 core: add extra safety check before switching root 2012-05-14 22:41:30 +02:00
Michal Schmidt
7cf82e0bb1 job: info message if JOB_VERIFY_ACTIVE detects an inactive unit 2012-05-14 14:29:54 +02:00
Michal Schmidt
1f136e7acf job: report the status of first half of JOB_RESTART the same as JOB_STOP 2012-05-14 14:29:54 +02:00
Michal Schmidt
c69182961b unit: unit type dependent status messages
Instead of generic "Starting..." and "Started" messages for all unit use
type-dependent messages. For example, mounts will announce "Mounting..."
and "Mounted".

Add status messages to units of types that used to be entirely silent
(automounts, sockets, targets, devices). For unit types whose jobs are
instantaneous, report only the job completion, not the starting event.
Socket units with non-instantaneous jobs are rare (Exec*= is not used
often in socket units), so I chose not to print the starting messages
for them either.

This will hopefully give people better understanding of the boot.
2012-05-14 14:29:53 +02:00
Michal Schmidt
9ab7a8d2a3 unit: print the color status marks on the left
The alignment of the "[  OK  ]" and "[FAILED]" status marks to the right
side of the terminal makes it difficult to link them with the messages
on the left if your console is wide.

I considered the options:
 1. Align them to the 80th column regardless of the console width.
    Disadvantage - either:
    - truncating messages needlessly, not using available space; or
    - If the message is long, write the mark over it. => ugly
 2. Write them to the 80th column for short messages,
    and further to the right for longer ones.
    Disadvantage:
    - jagged look
 3. Write the marks on the left, before the message.
    Disadvantage:
    - Breaks tradition from RHL.
    Advantages:
    + slightly simpler code
    + Will annoy holy-traditionalists.

I chose option 3.
BTW, Debian now uses similar marks on the left with its makefile-style
boot.

Special values of the "status" argument to status_vprintf are:
  NULL - no status mark, no message indentation
  ""   - no status mark, message indented as if the mark was there
2012-05-14 14:29:53 +02:00
Michal Schmidt
5f23d5b149 job: change red [ABORT] status to yellow [DEPEND]
The red "[ABORT]" for a dependency failure is too scary.
It suggests a crash. And it suggests a problem with the unit itself.
Change it to a yellow "[DEPEND]" message. The color communicates the
level of seriousness better.
2012-05-14 14:29:53 +02:00
Michal Schmidt
66aa6f7fbb job: only jobs on the runqueue can be run 2012-05-14 14:29:53 +02:00
Michal Schmidt
1ebf0cb73d dbus-manager: fix tainted string
The pointer to the end of the string was not advanced after adding
the "cgroups-missing" taint. If "local-hwclock" was detected too,
it would overwrite the previous string.

With 'e' always pointing to the end of the string, removing the last
delimiter is easier.
2012-05-09 21:42:56 +02:00
Michal Schmidt
b809bd0940 main: fix uninitialized variable 2012-05-09 11:20:35 +02:00
Michal Schmidt
e564a98237 main: fix assertion failure due to use of ELEMENTSOF on a non-array 2012-05-09 11:13:26 +02:00
Lennart Poettering
664f88a7e6 manager: introduce SwitchRoot bus call for initrd/main transition 2012-05-09 01:24:50 +02:00
Lennart Poettering
a5d87bf0ea main: simplify+unify logic for parsing runtime booleans 2012-05-08 23:36:55 +02:00
Lennart Poettering
6edd7d0a09 sleep: implement suspend/hibernate as first class targets 2012-05-08 13:54:23 +02:00
Kay Sievers
9eb977db5b util: split-out path-util.[ch] 2012-05-08 02:33:10 +02:00
Kay Sievers
bbc98d3256 util: split-out hwclock.[ch] 2012-05-08 01:57:17 +02:00
Lennart Poettering
06dab8e18a dbus: include unit name in JobNew/JobRemoved signals
This breaks D-Bus interface slightly, but since the D-Bus API isn't
covered by the interface stability promise this should be OK.
2012-05-03 22:53:25 +02:00
Lennart Poettering
88f3e0c91f service: explicitly remove control/ subcgroup after each control command
The kernel will only notify us of cgroups running empty if no subcgroups
exist anymore. Hence make sure we don't leave our own control/ subcgroup
around longer than necessary.

https://bugzilla.redhat.com/show_bug.cgi?id=818381
2012-05-03 21:54:44 +02:00
Lennart Poettering
e677bf7ef6 hwclock: add taint flag for non-local hwclock 2012-05-03 16:00:49 +02:00
Lennart Poettering
0b86feac50 service: default to Type=dbus if BusName= is specified 2012-05-03 14:46:29 +02:00
Lennart Poettering
7e2668c6fd service: warn if a dbus name is specified but the service type is not dbus 2012-05-03 14:42:49 +02:00
Lennart Poettering
7c8fa05c4d unit: add new dependency type RequiresMountsFor=
RequiresMountsFor= is a shortcut for adding requires and after
dependencies to all mount units neeed for the specified paths.

This solves a couple of issues regarding dep loop cycles for encrypted
swap.
2012-04-30 10:52:07 +02:00
Michal Schmidt
e0209d83e7 core: add NOP jobs, job type collapsing
Two of our current job types are special:
JOB_TRY_RESTART, JOB_RELOAD_OR_START.

They differ from other job types by being sensitive to the unit active state.
They perform some action when the unit is active and some other action
otherwise. This raises a question: when exactly should the unit state be
checked to make the decision?

Currently the unit state is checked when the job becomes runnable. It's more
sensible to check the state immediately when the job is added by the user.
When the user types "systemctl try-restart foo.service", he really intends
to restart the service if it's running right now. If it isn't running right
now, the restart is pointless.

Consider the example (from Bugzilla[1]):

sleep.service takes some time to start.
hello.service has After=sleep.service.
Both services get started. Two jobs will appear:
 hello.service/start  waiting
 sleep.service/start  running
Then someone runs "systemctl try-restart hello.service".

Currently the try-restart operation will block and wait for
sleep.service/start to complete.

The correct result is to complete the try-restart operation immediately
with success, because hello.service is not running. The two original
jobs must not be disturbed by this.

To fix this we introduce two new concepts:
- a new job type: JOB_NOP
  A JOB_NOP job does not do anything to the unit. It does not pull in any
  dependencies. It is always immediately runnable. When installed to a unit,
  it sits in a special slot (u->nop_job) where it never conflicts with
  the installed job (u->job) of a different type. It never merges with jobs
  of other types, but it can merge into an already installed JOB_NOP job.

- "collapsing" of job types
  When a job of one of the two special types is added, the state of the unit
  is checked immediately and the job type changes:
  JOB_TRY_RESTART     -> JOB_RESTART or JOB_NOP
  JOB_RELOAD_OR_START -> JOB_RELOAD or JOB_START
  Should a job type JOB_RELOAD_OR_START appear later during job merging, it
  collapses immediately afterwards.
  Collapsing actually makes some things simpler, because there are now fewer
  job types that are allowed in the transaction.

[1] Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=753586
2012-04-25 18:38:27 +02:00
Lennart Poettering
b55d0651c0 shutdown: don't complain if we cannot lock memory, to make container shutdowns clean 2012-04-24 16:56:06 +02:00
Lennart Poettering
2b93b027d3 remount: consolidate remount-api-vfs and remount-rootfs into one
This has the advantage of removing a confusing warning by mount if the
root directory is not listed in fstab.
2012-04-24 16:42:42 +02:00
Lennart Poettering
f2b6878955 service: introduce Type=idle and use it for gettys
Type=idle is much like Type=simple, however between the fork() and the
exec() in the child we wait until PID 1 informs us that no jobs are
left.

This is mostly a cosmetic fix to make gettys appear only after all boot
output is finished and complete.

Note that this does not impact the normal job logic as we do not delay
the completion of any jobs. We just delay the invocation of the actual
binary, and only for services that otherwise would be of Type=simple.
2012-04-24 14:42:24 +02:00
Lennart Poettering
8d8e945624 manager: drop MountAuto= and SwapAuto= options
The ability to set MountAuto=no and SwapAuto=no was useful during the
adoption phase of systemd, so that distributions could stick to their
classic mount scripts a bit longer. It is about time to get rid of it
now.
2012-04-24 13:53:34 +02:00
Michal Schmidt
5273510e9f transaction: cancel jobs non-recursively on isolate
Recursive cancellation of jobs would trigger OnFailure actions of
dependent jobs. This is not desirable when isolating.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=798328
2012-04-23 08:13:02 +02:00
Michal Schmidt
39a18c60d0 job: serialize jobs properly
Jobs were not preserved correctly over a daemon-reload operation.
A systemctl process waiting for a job completion received a job removal
signal. The job itself changed its id. The job timeout started ticking all
over again.

This fixes the deficiencies.
2012-04-24 01:54:15 +02:00
Michal Schmidt
1b9cea0caa transaction: abort does not need to use recursive deletion
Recursion is unnecessary, because we're deleting all transaction jobs
anyway. And the recursive deletion produces debug messages that are
pointless in transaction abort.
2012-04-24 01:54:15 +02:00
Michal Schmidt
4e7bd268ae transaction: fix detection of cycles involving installed jobs
A transaction can be acyclic, but when it's added to installed jobs,
a cycle may result.

transaction_verify_order_one() attempts to detect these cases, but it
fails because the installed jobs often have the exact generation number
that makes them look as if they were walked already.

Fix it by resetting the generation numbers of all installed jobs before
detecting cycles.

An alternative fix could be to add the generation counter to the
Manager and use it instead of starting always from 1 in
transaction_activate(). But I prefer not having to worry about it
wrapping around.
2012-04-24 01:54:14 +02:00
Michal Schmidt
055163ad15 transaction: improve readability
The functions looked complicated with the nested loops with breaks,
continues, and "while (again)".
Here using goto actually makes them easier to understand.

Also correcting the comment about redundant jobs.
2012-04-24 01:54:14 +02:00
Lennart Poettering
ff64462375 shutdown: don't try to shut down DM devices in a container 2012-04-22 15:50:52 +02:00
Lennart Poettering
fb3d2b8fec hostname: if there's already a hostname set when PID 1 is invoked, don't complain 2012-04-22 15:47:38 +02:00
Lennart Poettering
78ff1acdfe job: the status messages are proper sentences, hence end them with a full stop 2012-04-22 15:39:26 +02:00
Lennart Poettering
e0295d2651 mount: don't fail if fstab doesn't exist 2012-04-22 15:33:43 +02:00
Lennart Poettering
59e132a7f4 transaction: downgrade warnings about masked units 2012-04-22 15:22:52 +02:00
Lennart Poettering
7c0436b94c transaction: add missing emacs and license headers 2012-04-22 15:22:27 +02:00
Lennart Poettering
8e47b1d2eb machine-id: fix spelling 2012-04-22 15:07:35 +02:00
Lennart Poettering
ab94af9201 util: unify getenv() logic for other PID 2012-04-22 15:00:42 +02:00
Lennart Poettering
3d9a412243 util: fix tty_is_vc_resolve() in a container where /sys/class/tty/console/active is misleading 2012-04-22 01:59:11 +02:00
Lennart Poettering
eaeb18dba9 mount-setup: ignore common container bind mounts 2012-04-22 01:00:57 +02:00
Lennart Poettering
461282d52a watchdog: fix default configuration fragment for watchdog 2012-04-21 15:47:38 +02:00
Michal Schmidt
6530407524 transaction: add starting requirements for JOB_RESTART
While having a Requires= dependency between units, the dependency is started
automatically on "systemctl start", but it's not started on "systemctl
restart".

JOB_RESTART jobs did not pull the dependencies for starting into the
transaction.

https://bugzilla.redhat.com/show_bug.cgi?id=802770

Note that the other bug noted in comment #2 has been fixed already by avoiding
the deletion of anchor jobs.
2012-04-20 17:12:29 +02:00
Michal Schmidt
97e6a11996 dbus-job: allow multiple bus clients
Merging of jobs can result in more than one client being interested in a job.
2012-04-20 17:12:29 +02:00
Michal Schmidt
d6a093d098 transaction: remove checks for installed
Transactions cannot contain installed jobs anymore. Remove the now pointless
checks.
2012-04-20 17:12:29 +02:00
Michal Schmidt
656bbffc6c transaction: rework merging with installed jobs
Previously transactions could reference installed jobs. It made some issues
difficult to fix.

This sets new rules for jobs:
A job cannot be both a member of a transaction and installed. When jobs are
created, they are linked to a transaction. The whole transaction is constructed
(with merging of jobs within, etc.). When it's complete, all the jobs are
unlinked from it one by one and let to install themselves. It is during the
installation when merging with previously installed jobs (from older
transactions) is contemplated.

Merging with installed jobs has different rules than merging within a
transaction:
 - An installed conflicting job gets cancelled. It cannot be simply deleted,
   because someone might be waiting for its completion on DBus.
 - An installed, but still waiting, job can be safely merged into.
 - An installed and running job can be tricky. For some job types it is safe to
   just merge. For the other types we merge anyway, but put the job back into
   JOB_WAITING to allow it to run again. This may be suboptimal, but it is not
   currently possible to have more than one installed job for a unit.

Note this also fixes a bug where the anchor job could be deleted during merging
within the transaction.
2012-04-20 17:12:29 +02:00
Michal Schmidt
05d576f1f7 job: separate job_install()
Let the jobs install themselves.
2012-04-20 17:12:28 +02:00
Michal Schmidt
f1c2bdca42 transaction: remove a couple of asserts
We already asserted these facts in the previous loop.
2012-04-20 17:12:28 +02:00
Michal Schmidt
e6eda1f23e transaction: remove the anchor link
tr->anchor_job is sufficient.
2012-04-20 17:12:28 +02:00
Michal Schmidt
38809d9dfe transaction: avoid garbage collecting the anchor job
Make sure the anchor job is never considered garbage, even if it has no links
leading to it (this will be allowed in the next patch).
2012-04-20 17:12:28 +02:00
Michal Schmidt
0d9989aa68 transaction: simplify transaction_find_jobs_that_matter_to_anchor() 2012-04-20 17:12:28 +02:00
Michal Schmidt
4483f69498 transaction: change the linking of isolate jobs to the anchor
When isolating, the JOB_STOP jobs have no parent job, so they are all peers
of the real anchor job. This is a bit odd.

Link them from the anchor job.
2012-04-20 17:12:28 +02:00
Michal Schmidt
b94fbd3078 transaction: maintain anchor_job
Track which job is the anchor in the transaction.
2012-04-20 17:12:28 +02:00
Michal Schmidt
3c956cfee2 transaction: do not add installed jobs to the transaction
Do not attempt to optimize away the job creation by refering to installed jobs.
We do not want to disturb installed jobs until commiting the transaction.

(A later patch to job merging will make the separation of transaction jobs and
installed jobs complete.)
2012-04-20 17:12:28 +02:00
Michal Schmidt
1da4264fbd job: jobs shouldn't need to know about transaction anchors
Let the transactions maintain their own anchor links.
2012-04-20 17:12:28 +02:00
Michal Schmidt
668ad332a4 job: job_new() can find the manager from the unit 2012-04-20 17:12:27 +02:00
Michal Schmidt
75778e21df manager: split transaction.[ch]
manager.c takes care of the main loop, unit management, signal handling, ...
transaction.c computes transactions.

After split:
manager.c:     65 KB
transaction.c: 40 KB
2012-04-20 17:12:27 +02:00
Michal Schmidt
7527cb5275 manager: Transaction as an object
This makes it obvious that transactions are short-lived. They are created in
manager_add_job() and destroyed after the application of jobs.
It also prepares for a split of the transaction code to a new source.
2012-04-20 17:12:27 +02:00
Michal Schmidt
97e7d748d1 job: job_uninstall()
Split the uninstallation of the job from job_free() into a separate function.
Adjust the callers.

job_free() now only works on unlinked and uninstalled jobs. This enforces clear
thinking about job lifetimes.
2012-04-20 17:12:27 +02:00
Michal Schmidt
121b3b3180 manager: simplify transaction_abort()
This is equivalent.
2012-04-20 17:12:27 +02:00
Michal Schmidt
02a3bcc6b4 job: allow job_free() only on already unlinked jobs
job_free() is IMO too helpful when it unlinks the job from the transaction.
The callers should ensure the job is already unlinked before freeing.
The added assertions check if anyone gets it wrong.
2012-04-20 17:12:27 +02:00
Michal Schmidt
153bda8f03 manager: fix comment 2012-04-20 17:12:27 +02:00
Lennart Poettering
71f737d2de mount-setup: don't log with LOG_ERROR if a mount that doesn't matter fails 2012-04-20 12:40:02 +02:00
Lennart Poettering
a0a3844815 main: log to the journal in container mode, by default 2012-04-20 12:40:01 +02:00
Kay Sievers
4d46fec56d remove MS_* which can not be combined with current kernel code
MS_BIND|MS_MOVE can not be combined:
  do_mount()
    else if (flags & MS_BIND)
      do_loopback(&path, dev_name, flags & MS_REC);
    [...]
    else if (flags & MS_MOVE)
      do_move_mount(&path, dev_name);

MS_REMOUNT|MS_UNBINDABLE can not be combined:
  do_mount()
    if (flags & MS_REMOUNT)
      do_remount(&path, flags & ~MS_REMOUNT, mnt_flags, data_page);
    [...]
    else if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE))
      do_change_type(&path, flags);
2012-04-18 13:37:45 +02:00
Kay Sievers
5ba2dc259f udev: unify /dev static symlink setup 2012-04-17 22:31:38 +02:00
Kay Sievers
e9a5ef7cdd selinux: unify systemd and udev code 2012-04-17 16:05:28 +02:00
Lennart Poettering
b59e246565 logind: remove redundant entries from logind's default controller lists too 2012-04-16 19:15:00 +02:00
Lennart Poettering
9156e799a2 manager: remove unavailable/redundant entries from default controllers list 2012-04-16 18:59:07 +02:00
Lennart Poettering
3474ae3c7e cgroup: if a controller is not available don't try to create cgroups in its hierarchy 2012-04-16 18:59:07 +02:00
Lennart Poettering
ecedd90fcd service: place control command in subcgroup control/
Previously, we were brutally and onconditionally killing all processes
in a service's cgroup before starting the service anew, in order to
ensure that StartPre lines cannot be misused to spawn long-running
processes.

On logind-less systems this has the effect that restarting sshd
necessarily calls all active ssh sessions, which is usually not
desirable.

With this patch control processes for a service are placed in a
sub-cgroup called "control/". When starting a service anew we simply
kill this cgroup, but not the main cgroup, in order to avoid killing any
long-running non-control processes from previous runs.

https://bugzilla.redhat.com/show_bug.cgi?id=805942
2012-04-13 23:29:59 +02:00
Kay Sievers
3b6d9a7c50 update .gitignore 2012-04-13 21:58:01 +02:00
Lennart Poettering
c757a65b6a watchdog: make watchdog dbus properties writable 2012-04-13 21:37:59 +02:00
Lennart Poettering
2dad62205f dbus: expose whether we have a hardware watchdog on the bus 2012-04-13 19:46:51 +02:00
Lennart Poettering
691206668a unit: signal explicitly if a condition failed in unit_start()
We shouldn't print a status message on the console if we skipped a unit
due to a condition. Hence make unit_start() return -ENOEXEC in such a
case which is mapped to JOB_SKIPPED which results in no console message.
2012-04-13 19:46:51 +02:00
Lennart Poettering
9f28b98ec6 main: unset some more env vars 2012-04-13 18:52:53 +02:00
Lennart Poettering
44785992c3 audit: ignore if we get EPERM
if auditing access is not available, then don't complain about it, in
order to play nice with systems lacking CAP_SYS_AUDIT
2012-04-13 18:52:53 +02:00
Lennart Poettering
2c3ff76eb0 loopback: handle EPERM more gracefully 2012-04-13 18:52:53 +02:00
Lennart Poettering
a41b539efc manager: support systems lacking /dev/tty0 2012-04-13 18:52:52 +02:00
Lennart Poettering
7ea07dcdda fix a couple of things found with the llvm static analyzer 2012-04-13 13:58:50 +02:00
Lennart Poettering
08e1fb68d7 build-sys: move *-setup out of shared to avoid selinux being pulled in 2012-04-12 18:19:34 +02:00
Lennart Poettering
b6e661357c main: we want all setup functions to be in files called xxx-setup.[ch] 2012-04-12 14:29:29 +02:00
Kay Sievers
90ccc3fca7 move more main systemd parts to core/ 2012-04-12 14:24:40 +02:00
Lennart Poettering
4d89613917 hostname-setup: move to core/ 2012-04-12 14:23:17 +02:00
Lennart Poettering
146de8175e shutdown: move shutdown to core since it replaces PID 1 2012-04-12 14:18:36 +02:00
Lennart Poettering
08e4738832 build-sys: dbus-loop.h is not used by the core 2012-04-12 13:42:10 +02:00
Lennart Poettering
643a14a527 build-sys: move a few things into more appropriate places 2012-04-12 13:35:56 +02:00
Lennart Poettering
fff7b732b2 build-sys: add stub makefiles to make emacs easier to use 2012-04-12 13:35:56 +02:00
Kay Sievers
78a825f216 rename machine-id-main.c tomacht the binary and move main.c to core/ 2012-04-12 13:12:06 +02:00
Lennart Poettering
68faf98ca0 execute: when we can't get the requested rlimit, get the next closest 2012-04-12 12:58:19 +02:00
Lennart Poettering
d051610953 unit: introduce ConditionPathIsReadWrite 2012-04-12 12:58:19 +02:00
Lennart Poettering
5430f7f2bc relicense to LGPLv2.1 (with exceptions)
We finally got the OK from all contributors with non-trivial commits to
relicense systemd from GPL2+ to LGPL2.1+.

Some udev bits continue to be GPL2+ for now, but we are looking into
relicensing them too, to allow free copy/paste of all code within
systemd.

The bits that used to be MIT continue to be MIT.

The big benefit of the relicensing is that closed source code may now
link against libsystemd-login.so and friends.
2012-04-12 00:24:39 +02:00
Lennart Poettering
6bb92a169e polkit: temporarily spawn of a polkit agent in terminals for possibly authenticated operations 2012-04-11 20:39:03 +02:00
Kay Sievers
b30e2f4c18 move libsystemd_core.la sources into core/ 2012-04-11 16:03:51 +02:00