1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 06:52:22 +03:00
Commit Graph

10555 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
99613ec5d7 libsystemd-journal: return 0 on success in get_data()
The man page says so. Right now 0 would be returned if the data was encrypted,
1 otherwise.
2013-03-07 00:45:56 -05:00
Zbigniew Jędrzejewski-Szmek
f2e82cd5ad systemd-python: export sd_j_get_fd, sd_j_reliable_fd, sd_j_close
sd_journal_get_fd(j) is called j.fileno(), for compatiblity with
Python conventions for file-like objects.

More importantly, those new .seek_head() and .seek_tail() do not
call .get_next(). This is better, if one wants to skip before
retrieving an entry.
2013-03-07 00:45:56 -05:00
Zbigniew Jędrzejewski-Szmek
5c1c14b3a0 systemd-python: split .seek() into .seek_head() and .seek_tail()
This way python code follows the original interface more closely.
Also, .seek(0, journal.SEEK_END) was just to much to type.
2013-03-07 00:45:56 -05:00
Zbigniew Jędrzejewski-Szmek
aaf0806118 systemd-python: catch only ValueErrors in conversion code
First of all, 'try: ... except: ...' (with no exception specified) is
always a no-no, since it catches all BaseExceptions, which includes ^C
and other stuff which should almost never be caught.

Now the conversion is stricter, and only one conversion is attempted,
and only a ValueEror is caught. It seems reasonable to catch ValueErrors,
since the entries in the journal are not verified, and any erroneous
application might log a field which cannot be converted. The consumer
of events must only check if a field is an instance of bytes and can
otherwise assume that the conversion was performed correctly.

Order of arguments in Reader.__init__ has been changed to match order
in _Reader.__init__.

Conversions have been updated to work under Python 2 and 3.
2013-03-07 00:45:56 -05:00
Zbigniew Jędrzejewski-Szmek
1d98d9a62c man: fix compilation of example 2013-03-07 00:45:56 -05:00
Michael Biebl
11dac832c7 service: sysv - properly handle init scripts with .sh suffix
Dropping the distribution specific #ifdefs in
88516c0c95 broke the .sh suffix stripping
since we now always used the else clause of the rc. check.

We eventually want to drop the rc. prefix stripping, but for now we
assume that no sysv init script uses both an rc. prefix and .sh suffix,
so make the check for the .sh suffix and rc. prefix mutually exclusive.
2013-03-06 23:24:31 +01:00
Zbigniew Jędrzejewski-Szmek
9304ef91c5 libsystemd-journal: export new function, increase library version
Since sd_journal_reliable_fd wasn't exported before, it is as if
it was added now. Library "current" number must be bumped.

michich> Someone links with the fixed version and produces a RPM with
         his program. The RPM will happily install on a system with an
         old systemd version (the deps will appear fine), but the
         program will fail to run.
2013-03-06 14:15:09 -05:00
Kay Sievers
f28cbd0382 README: more CONFIG_* updates 2013-03-06 20:02:14 +01:00
Kay Sievers
41938693e7 README: remove CONFIG_HOTPLUG, add CONFIG_NET 2013-03-06 19:51:52 +01:00
Kay Sievers
713bc0cfa4 README: add kernel config options 2013-03-06 19:36:57 +01:00
Zbigniew Jędrzejewski-Szmek
66ee5c3df7 journal: properly advertise sd_journal_reliable_fd
sd_journal_reliable_fd was added in 85210bffd8, but it was
exported under the wrong name. Not too many users I guess.
2013-03-06 12:17:37 -05:00
Zbigniew Jędrzejewski-Szmek
e76d2e20a5 build-sys: add missing $
Fixup for 25ee45f99.
2013-03-06 12:02:50 -05:00
Lennart Poettering
3c912ded61 core: add missing comma for NonewPrivileges=
https://bugzilla.redhat.com/show_bug.cgi?id=917404
2013-03-06 17:48:42 +01:00
Simon McVittie
92f3034958 bus: Escape environment-based D-Bus addresses properly
If XDG_RUNTIME_DIR contains a character like ":" (for instance if it's
formed from an X11 display name), then it isn't valid to substitute
it into a D-Bus address without escaping.

http://bugs.freedesktop.org/show_bug.cgi?id=60499
2013-03-06 17:23:49 +01:00
Enrico Scholz
f1324eaa68 manager: remove timer fd explicitly from epoll
Forked processes can keep the old fd alive triggering epoll over and
over again else.

https://bugs.freedesktop.org/show_bug.cgi?id=61697
2013-03-06 17:16:13 +01:00
Tom Gundersen
95f1b47d27 main: ISOLATE rather than REPLACE default.target
This allows switch-root to work correctly if a unit is active both before and
after the switch-root, but its dependencies change. Before the patch, any
dependencies added to active units by switch-root will not be pulled, in
particular filesystems configured in /etc/fstab would not be activated if
local-fs.target was active in the initrd.

It is not clear to me if there is a bug in the REPLACE handling, or if it is
working as expected and that we really want to use ISOLATE instead as this patch
does.
2013-03-06 16:24:49 +01:00
Lennart Poettering
61a9648f02 update TODO 2013-03-06 15:39:37 +01:00
Ryan Lortie
6ffe5e37c4 timedated: add CanNTP property
If we can't successfully query any ntpd units, set CanNTP to false.

GNOME wants to use this to grey out the NTP switch in the UI.

https://bugs.freedesktop.org/show_bug.cgi?id=61816
2013-03-06 15:39:37 +01:00
Harald Hoyer
da61d6b2f2 units: run systemd-ask-password-console.service after systemd-vconsole-setup.service 2013-03-06 15:39:37 +01:00
Harald Hoyer
248ea600d0 initrd-parse-etc.servic: force start local-fs.target 2013-03-06 11:03:39 +01:00
Harald Hoyer
7fdf51751c Revert "add initrd-fs.target and initrd-fs-pre.target"
This reverts commit 39b83cdab3.
2013-03-06 11:03:39 +01:00
Harald Hoyer
fdf1848d1d Revert "units/initrd-*: require initrd-fs.target rather than local-fs.target"
This reverts commit 7d89ce303f.
2013-03-06 11:03:39 +01:00
Zbigniew Jędrzejewski-Szmek
6210afbcff systemd-python: fix error check in _Reader.wait() 2013-03-05 23:23:09 -05:00
Zbigniew Jędrzejewski-Szmek
a187bfd98a journal/tests: free allocated memory in test 2013-03-05 21:43:06 -05:00
Daniel Wallace
646614a407 zsh-completion: journalctl query by binary and device
implement 1883552c3d from bash completion in zsh-completion
2013-03-05 21:04:15 +01:00
Nathaniel Chen
ebe5d6d0d0 hostnamed: allow more special characters in pretty hostname
this addresses the bug at:
  https://bugs.freedesktop.org/show_bug.cgi?id=59311
  https://bugzilla.redhat.com/show_bug.cgi?id=895299

hostnamectl is supposed to allow a range of special characters for
the 'pretty' hostname:
  $ hostnamectl set-hostname --pretty "Nathaniels Desktop !@#$%"
..however, it rejects apostrophes, double quotes, and backslashes.
The manual for hostnamectl suggests that this should be allowed.

It makes sense to reject \0, \n, etc. pretty_string_is_safe() is
the same as string_is_safe(), but allows more special characters.
2013-03-05 20:54:05 +01:00
Lennart Poettering
d47c78be4a util: properly escape corner cases in bus_path_escape(), too
This follows the suggestions from:

http://lists.freedesktop.org/archives/systemd-devel/2013-March/009363.html
2013-03-05 20:05:46 +01:00
Kay Sievers
2f2343c6b1 inhibit: print --list if no argument is given 2013-03-05 19:34:38 +01:00
Michael Biebl
1a9ce3f766 Fix typos 2013-03-05 19:19:26 +01:00
Lennart Poettering
37495eede9 journal: make gatewayd run under its own user ID 2013-03-05 19:15:31 +01:00
Kay Sievers
37c0e8f35e README: add udev goups 2013-03-05 19:04:48 +01:00
Lennart Poettering
f47ec8ebb3 update TODO 2013-03-05 18:59:14 +01:00
Lennart Poettering
a24c64f03f journald: introduce new "systemd-journal" group and make it own the journal files
Previously all journal files were owned by "adm". In order to allow
specific users to read the journal files without granting it access to
the full "adm" powers, introduce a new specific group for this.

"systemd-journal" has to be created by the packaging scripts manually at
installation time. It's a good idea to assign a static UID/GID to this
group, since /var/log/journal might be shared across machines via NFS.

This commit also grants read access to the journal files by default to
members of the "wheel" and "adm" groups via file system ACLs, since
these "almost-root" groups should be able to see what's going on on the
system. These ACLs are created by "make install". Packagers probably
need to duplicate this logic in their postinst scripts.

This also adds documentation how to grant access to the journal to
additional users or groups via fs ACLs.
2013-03-05 18:59:03 +01:00
Lennart Poettering
fc7b7e2e74 journald: stpcpy() + mempcpy() are awesome 2013-03-05 15:02:38 +01:00
Lennart Poettering
82499507b3 journald: drop splitting-by-audit entirely
Thinking about it we should probably not hide bugs by falling back to
audit when we have our own session information anyway.
2013-03-05 14:36:59 +01:00
Lennart Poettering
40adcda869 journald: be a bit more careful when spitting up journals by user id 2013-03-05 14:27:34 +01:00
Lennart Poettering
8a0889dfda journald: check session owner UID rather then audit ID when splitting up journal files
We should always go by our own cgroup hierarchy before using foreign
schemes such as audit, so let's do that for the split out logic too.
2013-03-05 14:23:27 +01:00
Harald Hoyer
ac4785b031 Revert "fstab-generator: place initrd /sysroot mounts in initrd-fs.target"
This reverts commit 8330847e94.

Conflicts:
	src/fstab-generator/fstab-generator.c
2013-03-05 06:45:06 +01:00
Lennart Poettering
6bc80e94b6 update TODO 2013-03-05 04:10:19 +01:00
Lennart Poettering
954449b82d logind: when registering a new session always use previous session info from cgroup path rather than audit
Previously for cases like "su" or "sudo" where a session is attempted to
be created from within an existing one we used the audit session ID to
detect this and in such a case we simple returned the session data of
the original session a second time.

With this change we will now use the cgroup path of the calling path to
determine the old session, i.e. we only rely on our own session
identification scheme, instead of audits.

We will continue to keep the audit session ID and ours in sync however,
to avoid unnecessary confusion.
2013-03-05 03:35:52 +01:00
Michael Biebl
d51167c626 build-sys: build and install systemd-coredumpctl conditionally
If coredump support is disabled via --disable-coredump, do not build and
install the systemd-coredumpctl binary and man page.
2013-03-04 23:23:06 +01:00
Harald Hoyer
135b5212d4 fstab-generator: only handle block devices with root= kernel command line parameter
skip s.th. like root=nfs:... root=iscsi:... root=nbd:...
2013-03-04 21:00:56 +01:00
Harald Hoyer
8330847e94 fstab-generator: place initrd /sysroot mounts in initrd-fs.target
also do not overwrite /sysroot*.mount units already generated from fstab
2013-03-04 19:37:06 +01:00
Harald Hoyer
7d89ce303f units/initrd-*: require initrd-fs.target rather than local-fs.target 2013-03-04 19:33:50 +01:00
Harald Hoyer
39b83cdab3 add initrd-fs.target and initrd-fs-pre.target 2013-03-04 19:33:50 +01:00
Zbigniew Jędrzejewski-Szmek
47c4903452 build-sys: do not install pam_systemd(8) without PAM 2013-03-04 13:16:38 -05:00
Zbigniew Jędrzejewski-Szmek
4fe5211923 build-sys: do not install logind manpages when disabled
The condition was wrong: HAVE_PAM -> ENABLE_LOGIND.
2013-03-04 13:06:43 -05:00
Kay Sievers
8ab85e2d2d ProFUSION got bought by Intel 2013-03-04 16:13:19 +01:00
Kay Sievers
da4993920c journal: split journal uid only when audit uid data is valid 2013-03-04 15:19:10 +01:00
Michal Schmidt
a0b6422689 core/manager: fix conditions to start and stop watching running jobs
Harald encountered division by zero in manager_print_jobs_in_progress.
Clearly we had the watch enabled when we shouldn't - there were no
running jobs in m->jobs, only waiting ones. This is either a deadlock,
or maybe some of them would be detected as runnable in the next dispatch
of the run queue. In any case we mustn't crash.

Fix it by starting and stopping the watch based on n_running_jobs
instead of the number of all jobs.
2013-03-04 14:51:32 +01:00