Commit graph

226 commits

Author SHA1 Message Date
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
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
Michal Schmidt b647f10da7 systemctl: fix a FILE* leak
In practice it does not really matter, but let's be nice and close the
file.
2011-06-14 21:59:14 +02:00
Michal Schmidt b77398f7a0 systemctl: fix 'is-enabled' for native units under /lib
The units always showed up as enabled.

The config file has to be parsed before we can check what's in
the [Install] section.

https://bugzilla.redhat.com/show_bug.cgi?id=699027
2011-06-14 21:58:29 +02:00
Frederic Crozat dc725264f3 enable chkconfig support in systemctl for openSUSE 2011-06-09 13:31:26 +02:00
Michal Schmidt 78e39b43b8 systemctl: fix double unref of a dbus message 2011-06-05 17:22:37 +02:00
Lennart Poettering b23de6af89 dbus: make daemon reexecution synchronous
We simply keep open copies of the dbus connections across the
reexecution and close them as last step of it. A client can thus simply
wait until its connection is dropped to know when the reexecution is
finished.

https://bugzilla.redhat.com/show_bug.cgi?id=698198
2011-04-28 22:07:01 +02:00
Lennart Poettering e190aa0be1 systemctl: whitelist /etc instead of blacklisting /lib to figure out if [Install] is needed 2011-04-27 22:30:50 +02:00
Chris E Ferron 54e4fdef80 MeeGo support
This commit consists of the initial work to include MeeGo as a ported
distribution for systemd.

The majority of the changes are small configuration additions to auto
tools, so that MeeGo is identified as a valid distribution option.

Some small deviations will be noticed between the configuration of MeeGo
and other distributions. As MeeGo is a distribution striving for
compliancy to support its near embedded attributes and target users,
there is less user configuration options available by default. Most
services will be enabled by systemd as part of the distribution
requirements, and as such most links and service files will be pre-setup
for the MeeGo distribution. As much of this is going to be done within
the MeeGo distribution packaging this is still noteworthy to mention, as
it explains why in systemd you will observe configuration differences
where the MeeGo distribution removes all links in the pkgsysconfdir for
instance.  MeeGo will be user configurable if there is desire, but most
services will be enabled by the distribution as designated by the MeeGo
compliancy standards.

Other changes are in source to add such areas as meego-release defined
in utils, and hostname in hostname-setup, defining vconsole-setup,
localizations and rescue additions as needed.

As this is all ground work, MeeGo will continue to strive for complete
compatibility.
2011-04-20 01:05:30 +02:00
Lennart Poettering 3d3961f267 systemctl: always consider unit files with no [Install] section but stored in /lib enabled 2011-04-16 03:29:54 +02:00
Lennart Poettering b21a0ef8fc dbus: expose monotonic timestamps on the bus 2011-04-07 21:35:37 +02:00
Lennart Poettering 017803e242 systemctl: properly parse JobNew signals
https://bugzilla.redhat.com/show_bug.cgi?id=693274
2011-04-06 02:46:13 +02:00
Lennart Poettering 82e23dddeb systemctl: make most operations NOPs in a chroot 2011-04-06 01:35:56 +02:00
Lennart Poettering 964d124efa systemctl: don't truncate description when using pager
https://bugs.freedesktop.org/show_bug.cgi?id=35725
2011-03-29 18:54:37 +02:00
Lennart Poettering 3731f1eaa8 conf-parser: fix remaining parser functions according to new prototype 2011-03-28 23:04:30 +02:00