Commit graph

85 commits

Author SHA1 Message Date
Kay Sievers d7832d2c6e util: move all to shared/ and split external dependencies in separate internal libraries
Before:
  $ ldd /lib/systemd/systemd-timestamp
  linux-vdso.so.1 =>  (0x00007fffb05ff000)
  libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f90aac57000)
  libcap.so.2 => /lib64/libcap.so.2 (0x00007f90aaa53000)
  librt.so.1 => /lib64/librt.so.1 (0x00007f90aa84a000)
  libc.so.6 => /lib64/libc.so.6 (0x00007f90aa494000)
  /lib64/ld-linux-x86-64.so.2 (0x00007f90aae90000)
  libdl.so.2 => /lib64/libdl.so.2 (0x00007f90aa290000)
  libattr.so.1 => /lib64/libattr.so.1 (0x00007f90aa08a000)
  libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f90a9e6e000)

After:
  $ ldd systemd-timestamp
  linux-vdso.so.1 =>  (0x00007fff3cbff000)
  libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f5eaa1c3000)
  librt.so.1 => /lib64/librt.so.1 (0x00007f5ea9fbb000)
  libc.so.6 => /lib64/libc.so.6 (0x00007f5ea9c04000)
  /lib64/ld-linux-x86-64.so.2 (0x00007f5eaa3fc000)
  libdl.so.2 => /lib64/libdl.so.2 (0x00007f5ea9a00000)
  libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f5ea97e4000)
2012-04-10 14:13:38 +02:00
Lennart Poettering 353e12c2f4 service: ignore SIGPIPE by default 2012-02-09 03:18:04 +01:00
Lennart Poettering 5d6b158473 exec: include path name of binary we are about to execute when renaming forked off processes
Immediately after forking off a process change the comm name and argv[0]
to "(foobar)" where "foobar" is the basename of the path we are about to
execute.

This should be useful when charting boot progress.
2012-02-01 22:33:15 +01:00
Kay Sievers 891703e1ee persistant -> persistent 2012-01-18 21:47:30 +01:00
Lennart Poettering 8d53b4534a exec: introduce ControlGroupPersistant= to make cgroups persistant 2012-01-18 15:40:21 +01:00
Lennart Poettering 706343f492 journal: introduce log target 'journal' for executed processes 2012-01-06 02:48:38 +01:00
Lennart Poettering 54fe0cdbe3 execute: talk directly to the journald, instead to the stdout-syslog-bridge 2012-01-05 21:39:08 +01:00
Michal Schmidt 0b1f4ae635 execute: fix losing of start timestamps
Start timestamps were always cleared before saving exit timestamps.
Fix it by removing a condition that makes no sense any way I look at it.
2011-12-17 01:33:40 +01:00
Michal Schmidt 4c2630ebf2 execute: log errors from "sd(EXEC)"
To give the administrator more hints about failures occuring in spawning
of commands than just the exit code, log the strerror.
All fds are closed, so reopen the log.

Related-to: https://bugzilla.redhat.com/show_bug.cgi?id=752901
2011-11-17 01:36:11 +01:00
Michal Schmidt 9ba353983a execute: make setup_pam() return -errno when possible
The only caller currently checks if the result is non-zero,
so nothing changes there.
2011-11-17 00:16:22 +01:00
Michal Schmidt 4d8a7798e7 execute: avoid logging to closed fds
Several functions called from the "sd(EXEC)" process try to log messages
when all the file descriptors are already closed, including the logging
ones. The logging functions do not expect their fds to be closed and
they hit an assertion failure. The failure wants to be logged too,
so there is an infinite recursion, ended by a SIGSEGV.

When we close all fds, we must let log.c know about it.
2011-11-16 23:52:10 +01:00
Michal Schmidt 0ad26e09de utmp: remove unneded parameters
With these functions no caller ever passes anything else than 0
for 't' (meaning the current time will be used).
2011-11-07 01:09:53 +01:00
Lennart Poettering 64685e0cea util: properly detect what the last capability is 2011-10-11 22:30:31 +02:00
Lennart Poettering 346bce1f4c stdout-bridge: rename logger to stdout-syslog-bridge to make it more descriptive 2011-08-30 22:42:49 +02:00
Lennart Poettering ab1f063390 exec: optionally apply cgroup attributes to the cgroups we create 2011-08-20 00:22:02 +02:00
Lennart Poettering ff01d048b4 exec: introduce PrivateNetwork= process option to turn off network access to specific services 2011-08-02 05:24:58 +02:00
Lennart Poettering fa8f36ac15 execute: properly enforce group
https://bugzilla.redhat.com/show_bug.cgi?id=723892
2011-08-01 21:34:42 +02:00
Lennart Poettering 4c12626c8e umask: change default umask to 0022 just to be sure, and set it explicitly in all binaries, in order to make sure it is set when started from the terminal 2011-08-01 20:52:18 +02:00
Lennart Poettering 4b67834e9f util: make use of get_user_creds() and get_group_creds() wherever applicable 2011-07-23 01:17:59 +02:00
Lennart Poettering ddd8876392 util: user parse_uid() wherever applicable 2011-07-23 00:47:17 +02:00
Michal Vyskocil 1cccf43569 nspawn: Move the get_user_creds from execute.c to utils.c for later usage in nspawn.c. 2011-07-01 23:49:56 +02:00
Lennart Poettering aa87e62474 execute: properly pass PAM environment to executed process 2011-06-30 04:31:34 +02:00
Lennart Poettering 7fbf31dfe3 execute: fix PAM error checking 2011-06-30 04:15:53 +02:00
Lennart Poettering 3dead8d925 execute: invoke sigwait() in a loop when waiting for PAM parent, to avoid spurious wake-ups 2011-06-30 04:15:39 +02:00
Lennart Poettering 0f1df8e169 execute: don't invoke pam_setcred, since we are not running on a tty where the user could change his password 2011-06-30 04:14:50 +02:00
Lennart Poettering 3b8bdddeff execute: do initgroups() first, pam initialization second so that it can still modify the groups list 2011-06-30 02:15:01 +02:00
Lennart Poettering 64747e2d4b exec: add ControlGroupModify= switch to allow changing access mode to cgroups fs 2011-06-30 00:11:25 +02:00
Lennart Poettering ae556c2109 execute: don't choke when systemd was compiled with a different CAP_LAST_CAP then what it is run with 2011-06-28 13:33:56 +02:00
Lennart Poettering 6ea832a207 exec: hangup/reset/deallocate VTs in gettys
Explicitly disconnect all clients from a VT when a getty starts/finishes
(requires TIOCVHANGUP, available in 2.6.29).

Explicitly deallocate getty VTs in order to flush scrollback buffer.

Explicitly reset terminals to a defined state before spawning getty.
2011-05-18 01:07:36 +02:00
Lennart Poettering 73090dc815 execute: when we run as PID 1 the kernel doesn't give us CAP_SETPCAP by default. Get that temporarily when dropping capabilities for good 2011-04-19 06:06:41 +02:00
Lennart Poettering 90a5f6e42a execute: don't fail if we cannot fix OOM in a container 2011-04-12 20:12:15 +02:00
Lennart Poettering 9c1b183c70 service: fix units with more than one socket
https://bugzilla.redhat.com/show_bug.cgi?id=693289
2011-04-06 02:25:39 +02:00
Lennart Poettering 7d76f31288 log: fix shifting of facilities 2011-03-31 21:22:44 +02:00
Lennart Poettering da19d5c19f src: our lord is coverity 2011-03-31 15:35:40 +02:00
Lennart Poettering cd25cce98f exec: drop process group kill mode since it has little use and confuses the user 2011-03-29 23:31:38 +02:00
Lennart Poettering 260abb780a exec: properly apply capability bounding set, add inverted bounding sets 2011-03-18 04:52:45 +01:00
Lennart Poettering f6a6225e41 def: centralize definition of default timeout in one place 2011-03-17 04:02:35 +01:00
Lennart Poettering 91b22f21f3 core: move abstract namespace sockets to /dev/.run
Now that we have /dev/.run there's no need to use abstract namespace
sockets. So, let's move things to /dev/.run, to make things more easily
discoverable and improve compat with chroot() and fs namespacing.
2011-03-14 03:12:25 +01:00
Lennart Poettering 8c7be95e5a execute: load environment files at time of execution, not when we load the service configuration
https://bugzilla.redhat.com/show_bug.cgi?id=661282
2011-03-04 03:44:43 +01:00
Lennart Poettering 430c18ed7f kill: always send SIGCONT after SIGTERM
When we kill a process to terminate it make sure to send SIGCONT to
ensure it is unpaused and processes the signal.
2011-03-03 23:55:30 +01:00
Harald Hoyer 35b8ca3aaf Spelling Corrections
Just some lame spelling corrections with no functionality.
2011-02-28 22:47:38 +01:00
Lennart Poettering 28dbc1e80b execute: optionally forward program output to /dev/console in addition to syslog/kmsg 2011-02-15 01:27:53 +01:00
Lennart Poettering ba035df230 execute: make sending of SIGKILL on shutdown optional 2011-01-18 22:55:54 +01:00
Lennart Poettering 86a3475bc5 execute,util: fix two small memory leaks 2011-01-06 23:52:17 +01:00
Lennart Poettering a6ff950e71 execute: drop empty assignments from env blocks on execution but keep them around otherwise to make them visible 2011-01-06 20:38:02 +01:00
Lennart Poettering e3aa71c38c exec: automatically determine right TERM= setting based on tty name 2010-11-15 23:49:02 +01:00
Lennart Poettering 8a0867d6c5 systemctl: introduce systemctl kill 2010-10-22 16:11:50 +02:00
Lennart Poettering 52661efd21 unit: add minimal condition checker for unit startup 2010-10-13 02:15:41 +02:00
Lennart Poettering 169c1bda80 service: optionally, create INIT_PROCESS/DEAD_PROCESS entries for a service
This should fix accounting for pam_limits and suchlike.

https://bugzilla.redhat.com/show_bug.cgi?id=636036
2010-10-08 16:07:50 +02:00
Lennart Poettering 0e098b15c7 util: never use sizeof(sa_family_t) when calculating sockaddr sizes 2010-10-07 02:34:17 +02:00