Commit graph

239 commits

Author SHA1 Message Date
Lennart Poettering c1072ea0da util: rework ANSI escape code macros 2012-01-14 01:54:33 +01:00
Lennart Poettering d3f2bdbfee journal: add output mode that just prints simple messages without any decorations 2012-01-13 02:58:45 +01:00
Lennart Poettering 67a122058b journalctl: add new short-monotonic output mode 2012-01-07 04:41:30 +01:00
Lennart Poettering 81527be142 build-sys: move public header files into a dir of their own 2012-01-05 16:01:58 +01:00
Lennart Poettering df50185b43 journal: beef up journal output of systemctl and journalctl 2012-01-04 18:33:36 +01:00
Lennart Poettering 6f003b4304 journalctl: fix counting of -n parameter 2012-01-04 04:00:14 +01:00
Lennart Poettering 86aa7ba4f9 systemctl: hook up systemctl with the journal 2012-01-03 21:08:58 +01:00
Lennart Poettering dc1ecd78e9 Merge branch 'journal' 2011-12-31 00:59:37 +01:00
Michal Schmidt c971700e41 systemctl: fix typo in 'is-enabled'
It prevented the action from working without dbus.
2011-12-15 21:03:02 +01:00
Michal Schmidt f7b9e331ed systemctl: print 'error' load state in red
Be consistent in coloring of load states in list-units and status.
Print only 'error' in red.
There are no 'banned' or 'failed' states. Do not color 'masked', it's
not an error.
2011-12-06 01:30:16 +01:00
Bill Nottingham d380a3bcd1 Allow 'list-unit-files' to run with --root.
To do so, move the check for the bus to the bus-using portion of
list_unit_files(), and ensure that get_config_path doesn't abort when
checking the runtime path with --root.
2011-12-05 22:04:42 +01:00
Lennart Poettering 1e2579fdeb Merge branch 'master' into journal 2011-11-08 19:44:16 +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
Dexter Morgan 6fdae8a6a4 Add Mageia support
This patch adds support for the Mageia Linux distribution:
 http://www.mageia.org/

Mageia is a fork of Mandriva although some divergence has already occured
and thus inclusion of these changes upstream allow us to (hopefully)
migrate more rapidly to the new standard approaches systemd offers.
Indeed, we already use the preferred mechanism of OS identification via
the /etc/os-release file rather than a distro specific variation.

This patch mostly mirrors the patch added previously for Mandriva
support. In addition to those original authors, this patch was mostly
written by Dexter Morgan with help from Colin Guthrie and Eugeni Dodonov.
2011-11-02 02:16:39 +01:00
Zbigniew Jędrzejewski-Szmek 1c0a113fd3 systemctl: make list-unit-files output more economical
The first column is given the width of the widest entry,
if possible, otherwise all entries are ellipsized to fit
in ($COLUMNS - (width of second column)).

[ Added a few fixes, calculate state_cols too, respect '--no-legend',
  better handling of '--full' -- michich ]
2011-10-24 19:40:05 +02:00
Lennart Poettering 87d2c1ff6a journal: add preliminary incomplete implementation 2011-10-07 22:02:05 +02:00
Michal Schmidt 798e258d30 systemctl: fix corrupted output of units
On some systems the list of units in systemctl output came out wrong,
all on one line and with missing descriptions.

It turns out printf() really attempts to mmap 2G memory when INT_MAX is
passed as the field width. On machines with small virtual memory
without overcommit the mmap inside printf() failed.

Do not use INT_MAX for unlimited width.
2011-09-29 21:25:50 +02:00
Lennart Poettering f176b5c296 systemctl: fix error message when no connection to systemd is available 2011-09-29 16:00:29 +02:00
Lennart Poettering 8185a5090a systemctl: fix detection whether the dbus connection is available 2011-09-29 15:32:10 +02:00
Michal Schmidt 4deb3b9391 systemctl: better width and alignment of fields
Provide nicer output by taking advantage of the available columns.

Expand UNIT and DESCRIPTION if possible. Economize the space:
 - never give UNIT more width than it can use.
 - if there's a shortage of space, give 25 columns to UNIT, even
   if it would result in overflowing the total columns. The field would not
   be useful below width 25.
 - then if possible, assign up to 25 columns to DESCRIPTION.
 - then split any remaining space evenly between UNIT and DESCRIPTION.

Keep the columns aligned even with '--full'.
2011-09-27 12:10:33 +02:00
Michal Schmidt ebed32bfe8 systemctl: print the legend regardless of stdout type, add --no-legend
Print the legend (the column headers and the footer with hints) by
default even to non-tty output. People seem to get confused by the
difference when they redirect the output.

Add a parameter to suppress the printing of the legend.

Related-to: https://bugzilla.redhat.com/show_bug.cgi?id=713567
2011-09-27 12:10:27 +02:00
Lennart Poettering 3e085b6c59 llvm-analyze: change a few things to make llvm-analyze show fewer false positives 2011-09-23 16:28:27 +02:00
Lennart Poettering f8440af5fe coverity: change a few things so that coverity doesn't show so many false positives 2011-09-23 01:45:34 +02:00
Lennart Poettering 8ea913b2ea coverity: fix a couple of bugs found by coverity 2011-09-23 01:45:34 +02:00
Lennart Poettering d76702a7b2 systemctl: if we managed to reexec the init system via the bus don't retry via signal
If we managed to reeexec the init system via the bus this allows us to
provide synchronous behaviour to callers. This is all lost if we then
repeat the reexecution via SIGTERM.

https://bugzilla.redhat.com/show_bug.cgi?id=698198
2011-08-31 03:31:32 +02:00
Frederic Crozat 65457142f1 initctl: check for kexec_loaded when reboot is requested through initctl 2011-08-24 02:19:30 +02:00
Lennart Poettering d8bbda9141 cgroup: expose cgroup attributes as unit properties on the bus 2011-08-21 20:07:08 +02:00
Lennart Poettering f786e80d7a systemctl: fix parsing of LoadError property for systemctl show 2011-07-31 18:28:33 +02:00
Lennart Poettering a43757462a dbus: export unit file state 2011-07-31 18:28:02 +02:00
Lennart Poettering 9f39404c86 dbus: export load error on unit objects 2011-07-31 18:13:03 +02:00
Lennart Poettering ecdcbc5e60 systemctl: s/ignore/ignore_error/ in 'show' output 2011-07-30 16:42:05 +02:00
Lennart Poettering 729e3769c3 systemctl: hook up new install logic
This adds a number of new options to systemctl, for presets, reenabling,
masking/unmask, and runtime operations.
2011-07-25 04:58:02 +02:00
Lennart Poettering e1ea662c33 systemctl: remove monitor command since it is mostly useless 2011-07-23 04:21:47 +02:00
Lennart Poettering 34c4b47b7f systemctl: split --help into multiple sections 2011-07-23 04:20:22 +02:00
Lennart Poettering 09adcdf71d systemctl: fix indenting 2011-07-22 04:31:21 +02:00
Lennart Poettering c800e48374 path-lookup: make inclusion of user private units optional 2011-07-22 04:31:20 +02:00
Lennart Poettering 0a55b298d9 systemctl: don't try rebooting with /dev/initcl if Upstart worked 2011-07-14 18:05:33 +02:00
Lennart Poettering aca4c78676 systemctl: fix --help syntax for variables 2011-07-08 21:45:59 +02:00
Lennart Poettering a4c279f874 loginctl: add various introspection functions 2011-07-08 21:39:10 +02:00
Lennart Poettering 69fc152fc1 systemctl: hide all information on --kill-mode= since it is mostly useless 2011-07-07 04:19:03 +02:00
Lennart Poettering ef3a24de02 systemctl: use cached tty value where possible 2011-07-07 03:30:47 +02:00
Lennart Poettering 3b0727f5ec systemctl: cache tty value before we open the pager 2011-07-07 03:30:31 +02:00
Lennart Poettering abca482291 loginctl: add basic implementation of loginctl for introspecting controlling sessions/users/seats 2011-07-07 03:29:56 +02:00
Lennart Poettering 1968a36040 cgls: add pager support to systemd-cgls 2011-07-07 02:34:35 +02:00
Michal Schmidt 52c002150a shutdown: respect the dry run option '-k'
Don't do the actual power-off/reboot when '-k' is passed to shutdown.

Related to: https://bugzilla.redhat.com/show_bug.cgi?id=624149
2011-07-03 00:12:16 +02:00
Michal Schmidt 1a63987788 shutdown: accept minutes argument without '+'
Both SysVinit's and upstart's shutdown commands accept the number of
minutes with or without the plus sign.
'shutdown -h 1' works in RHEL 5, Fedora 14, Debian 6.
Let's be compatible.

https://bugzilla.redhat.com/show_bug.cgi?id=708886
2011-07-03 00:11:22 +02:00
Frederic Crozat be394c48a7 systemctl: add support for --root for systemctl enable/disable/is-enabled
Add --root=<root> for enable/disable/is-enabled systemctl commands. To
be used for easily enable / disable systemd services for a chroot,
without running systemctl inside chroot.
2011-06-27 14:08:16 +02:00
Ville Skyttä abebb5af9a systemctl: Add SYSTEMD_PAGER for setting the pager to use in systemctl 2011-06-20 17:59:59 +02:00
Jim Meyering 23b2a3300c systemctl: plug a leak upon create_symlink mismatch 2011-06-15 20:44:28 +02:00
Alexey Shabalin d9eaa2d538 systemctl: enable chkconfig support in systemctl for ALTLinux 2011-06-15 20:13:36 +02:00