summaryrefslogtreecommitdiff
path: root/src/notify
AgeCommit message (Collapse)AuthorFilesLines
2019-07-12tree-wide: get rid of strappend()Lennart Poettering1-1/+1
It's a special case of strjoin(), so no need to keep both. In particular as typing strjoin() is even shoert than strappend().
2019-05-08Merge pull request #12411 from keszybz/pr/12394Lennart Poettering1-0/+1
run: when emitting the calendarspec warning, use red
2019-05-08Enable log colors for most of tools in /usr/binZbigniew Jędrzejewski-Szmek1-0/+1
When emitting the calendarspec warning we want to see some color. Follow-up for 04220fda5c. Exceptions: - systemctl, because it has a lot hand-crafted coloring - tmpfiles, sysusers, stdio-bridge, etc, because they are also used in services and I'm not sure if this wouldn't mess up something.
2019-04-29codespell: fix spelling errorsBen Boeckel1-1/+1
2018-11-22coccinelle: make use of SYNTHETIC_ERRNOZbigniew Jędrzejewski-Szmek1-8/+6
Ideally, coccinelle would strip unnecessary braces too. But I do not see any option in coccinelle for this, so instead, I edited the patch text using search&replace to remove the braces. Unfortunately this is not fully automatic, in particular it didn't deal well with if-else-if-else blocks and ifdefs, so there is an increased likelikehood be some bugs in such spots. I also removed part of the patch that coccinelle generated for udev, where we returns -1 for failure. This should be fixed independently.
2018-11-20Split out pretty-print.c and move pager.c and main-func.h to shared/Zbigniew Jędrzejewski-Szmek1-1/+1
This is high-level functionality, and fits better in shared/ (which is for our executables), than in basic/ (which is also for libraries).
2018-11-19util-lib: move main() definition macros to its own header fileLennart Poettering1-0/+1
This way, we can extend the macro a bit with stuff pulled in from other headers without this affecting everything which pulls in macro.h, which is one of our most basic headers. This is just refactoring, no change in behaviour, in prepartion for later changes.
2018-11-17notify: define main through macroZbigniew Jędrzejewski-Szmek1-40/+25
2018-08-21Merge pull request #9783 from poettering/get-user-creds-flagsZbigniew Jędrzejewski-Szmek1-1/+1
beef up get_user_creds() a bit and other improvements
2018-08-20user-util: rework get_user_creds()Lennart Poettering1-1/+1
Let's fold get_user_creds_clean() into get_user_creds(), and introduce a flags argument for it to select "clean" behaviour. This flags parameter also learns to other new flags: - USER_CREDS_SYNTHESIZE_FALLBACK: in this mode the user records for root/nobody are only synthesized as fallback. Normally, the synthesized records take precedence over what is in the user database. With this flag set this is reversed, and the user database takes precedence, and the synthesized records are only used if they are missing there. This flag should be set in cases where doing NSS is deemed safe, and where there's interest in knowing the correct shell, for example if the admin changed root's shell to zsh or suchlike. - USER_CREDS_ALLOW_MISSING: if set, and a UID/GID is specified by numeric value, and there's no user/group record for it accept it anyway. This allows us to fix #9767 This then also ports all users to set the most appropriate flags. Fixes: #9767 [zj: remove one isempty() call]
2018-08-20tree-wide: add clickable man page link to all --help textsLennart Poettering1-5/+17
This is a bit like the info link in most of GNU's --help texts, but we don't do info but man pages, and we make them properly clickable on terminal supporting that, because awesome. I think it's generally advisable to link up our (brief) --help texts and our (more comprehensive) man pages a bit, so this should be an easy and straight-forward way to do it.
2018-06-14tree-wide: remove Lennart's copyright linesLennart Poettering1-3/+0
These lines are generally out-of-date, incomplete and unnecessary. With SPDX and git repository much more accurate and fine grained information about licensing and authorship is available, hence let's drop the per-file copyright notice. Of course, removing copyright lines of others is problematic, hence this commit only removes my own lines and leaves all others untouched. It might be nicer if sooner or later those could go away too, making git the only and accurate source of authorship information.
2018-06-14tree-wide: drop 'This file is part of systemd' blurbLennart Poettering1-2/+0
This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
2018-04-06tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek1-13/+0
Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
2018-01-11notify: add new --uid= commandLennart Poettering1-2/+36
The new --uid= switch allows selecting the UID from which the notificaiton messages shall originate. This is primarily useful for testing purposes, but might have other uses.
2017-12-19tree-wide: use !strv_isempty() instead of strv_length() > 0Yu Watanabe1-1/+1
2017-11-19Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek1-0/+1
This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
2017-07-18build-sys: drop automake supportZbigniew Jędrzejewski-Szmek1-1/+0
v2: - also mention m4
2016-11-07Rename formats-util.h to format-util.hZbigniew Jędrzejewski-Szmek1-1/+1
We don't have plural in the name of any other -util files and this inconsistency trips me up every time I try to type this file name from memory. "formats-util" is even hard to pronounce.
2016-02-10tree-wide: remove Emacs lines from all filesDaniel Mack1-2/+0
This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
2015-10-27util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering1-0/+1
2015-10-27util-lib: split string parsing related calls from util.[ch] into parse-util.[ch]Lennart Poettering1-0/+1
2015-10-24util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering1-0/+1
string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
2015-09-29util: introduce common version() implementation and use it everywhereLennart Poettering1-4/+1
This also allows us to drop build.h from a ton of files, hence do so. Since we touched the #includes of those files, let's order them properly according to CODING_STYLE.
2015-09-22notify: sort header files, follow CODING_STYLELennart Poettering1-7/+7
2015-09-20systemd-notify: Always pass a valid pid to sd_pid_notifyBenjamin Robin1-1/+1
If the option --pid was used, take the pid from this option, unless take the parend pid. Using 0 as pid (ucred of systemd-notify) will result 99% of the time in a failure with this error: "Cannot find unit for notify message of PID" Shouldn't we use always the ppid, since the MAINPID is something else ? Signed-off-by: Benjamin Robin <dev@benjarobin.fr>
2015-09-09notify: log error when sd_pid_notify() == 0Evgeny Vereshchagin1-3/+3
2015-04-10shared: add formats-util.hRonny Chevalier1-0/+1
2015-03-13tree-wide: there is no ENOTSUP on linuxDavid Herrmann1-1/+1
Replace ENOTSUP by EOPNOTSUPP as this is what linux actually uses.
2015-02-23remove unused includesThomas Hindoe Paaboel Andersen1-1/+0
This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
2015-01-27notify,firstboot,analyze,run: trim --help output to 80 linesZbigniew Jędrzejewski-Szmek1-6/+6
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt1-1/+1
It corrrectly handles both positive and negative errno values.
2014-11-28treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt1-1/+1
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
2014-09-25readahead: wipe out readaheadDaniel Buch1-20/+2
2014-09-15remove unneeded error.h includesEmil Renner Berthing1-1/+0
These are the only two places where this glibc-specific header is included. However none of the definitions in it seem to be used, so just remove the includes.
2014-08-12networkd: add minimal client tool "networkd" to query network statusLennart Poettering1-1/+2
In the long run this should become a full fledged client to networkd (but not before networkd learns bus support). For now, just pull interesting data out of networkd, udev, and rtnl and present it to the user, in a simple but useful output.
2014-08-03Unify parse_argv styleZbigniew Jędrzejewski-Szmek1-7/+4
getopt is usually good at printing out a nice error message when commandline options are invalid. It distinguishes between an unknown option and a known option with a missing arg. It is better to let it do its job and not use opterr=0 unless we actually want to suppress messages. So remove opterr=0 in the few places where it wasn't really useful. When an error in options is encountered, we should not print a lengthy help() and overwhelm the user, when we know precisely what is wrong with the commandline. In addition, since help() prints to stdout, it should not be used except when requested with -h or --help. Also, simplify things here and there.
2014-07-31Always prefer our headers to system headersZbigniew Jędrzejewski-Szmek1-1/+1
In practice this shouldn't make much difference, but sometimes our headers might be newer, and we want to test them.
2014-06-05sd-daemon: introduce sd_pid_notify() and sd_pid_notifyf()Lennart Poettering1-24/+23
sd_pid_notify() operates like sd_notify(), however operates on a different PID (for example the parent PID of a process). Make use of this in systemd-notify, so that message are sent from the PID specified with --pid= rather than the usually shortlived PID of systemd-notify itself. This should increase the likelyhood that PID 1 can identify the cgroup that the notification message was sent from properly.
2014-05-15Remove unnecessary casts in printfsZbigniew Jędrzejewski-Szmek1-1/+1
No functional change expected :)
2013-11-06clients: unify how we invoke getopt_long()Lennart Poettering1-5/+3
Among other things this makes sure we always expose a --version command and show it in the help texts.
2013-07-01core: add new "scope" unit type for making a unit of pre-existing processesLennart Poettering1-1/+2
"Scope" units are very much like service units, however with the difference that they are created from pre-existing processes, rather than processes that systemd itself forks off. This means they are generated programmatically via the bus API as transient units rather than from static configuration read from disk. Also, they do not provide execution-time parameters, as at the time systemd adds the processes to the scope unit they already exist and the parameters cannot be applied anymore. The primary benefit of this new unit type is to create arbitrary cgroups for worker-processes forked off an existing service. This commit also adds a a new mode to "systemd-run" to run the specified processes in a scope rather then a transient service.
2013-02-11env: considerably beef up environment cleaning logicLennart Poettering1-0/+1
Now, actually check if the environment variable names and values used are valid, before accepting them. With this in place are at some places more rigid than POSIX, and less rigid at others. For example, this code allows lower-case environment variables (which POSIX suggests not to use), but it will not allow non-UTF8 variable values. All in all this should be a good middle ground of what to allow and what not to allow as environment variables. (This also splits out all environment related calls into env-util.[ch])
2013-01-04build-sys: drop all distribution specfic checksLennart Poettering1-1/+0
Yay, we now have a completely generic systemd. No distribution specific checks anymore!
2012-04-13build-sys: add stub makefiles to all subdirs to ease development with emacsLennart Poettering1-0/+1
2012-04-12move all tools to subdirsKay Sievers1-0/+228