eef0a274e6187d1efb8fffaf66db94b8738662a0 |
|
10-Feb-2016 |
Lennart Poettering <lennart@poettering.net> |
activate: add a new switch --inetd to enable inetd-style socket activation
Previously, using --accept would enable inetd-style socket activation in addition to per-connection operation. This is
now split into two switches: --accept only switches between per-connection or single-instance operation. --inetd
switches between inetd-style or new-style fd passing.
This breaks the interface of the tool, but given that it is a debugging tool shipped in /usr/lib/systemd/ it's not
really a public interface.
This change allows testing new-style per-connection daemons. |
08719b64e4de1a1197074fd2e2d18b7259f27232 |
|
10-Feb-2016 |
Lennart Poettering <lennart@poettering.net> |
activate: minor fixes |
d31e430f14ea076665973b935003326e5ffcbfc8 |
|
10-Feb-2016 |
Lennart Poettering <lennart@poettering.net> |
activate: add new --seqpacket switch for testing SOCK_SEQPACKET sockets |
b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
7e0cdf8f1ff366a1d1770ea92bcce686db8c2dfc |
|
01-Feb-2016 |
Lennart Poettering <lennart@poettering.net> |
activate: reorder --help text
Make sure the --help and --version options are mentioned first, like in all our other tools. |
fa994f917d51997c6bc125161a473d1ed8d40229 |
|
01-Feb-2016 |
Lennart Poettering <lennart@poettering.net> |
activate: fix memory allocation for execv() parameters
Make sure we construct the full environment block on the heap, so that we can clean things up properly if execv()
fails. |
7b7afdfc072b14a4fa4dc195f50becaa7cecc5e8 |
|
22-Jan-2016 |
Susant Sahani <ssahani@gmail.com> |
systemd-activate: Add support for datagram sockets
core: Add flexible way to provide socket type
the socket type should be a diffrent argumet
in make_socket_fd . In this way we can set the socket
type like SOCK_STREAM SOCK_DGRAM in the address.
journal-remote: modify make_socket_fd |
366b7db4b65b994cd33cf4fd3c1be429be561307 |
|
01-Dec-2015 |
Klearchos Chaloulos <klearchos.chaloulos@nokia.com> |
journal-remote: split-mode=host, remove port from journal filename
When constructing the journal filename to store logs from a remote host, remove the port of the tcp connection, as the port will change with every reboot/connection loss between sender/reveiver machines. Having the port in the filename will cause a new journal file to be created for every reboot or connection loss.
For the implementation, a new argument "bool include_port" is added to the getpeername_pretty() function. This is passed to the sockaddr_pretty() function. The value of the include_port argument is set to true in all calls of getpeername_pretty(), except for 2 calls in journal-remote.c, where it is set to false. |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
3ffd4af22052963e7a29431721ee204e634bea75 |
|
25-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over. |
07630cea1f3a845c09309f197ac7c4f11edd3b62 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split our string related calls from util.[ch] into its own file 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. |
163c76c9305e6fee91dad8a3004f77020000ef96 |
|
06-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
activate: validate fdname when accepting it |
8dd4c05b5495c7ffe0f12ace87e71abe17bd0a0e |
|
06-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
core: add support for naming file descriptors passed using socket activation
This adds support for naming file descriptors passed using socket
activation. The names are passed in a new $LISTEN_FDNAMES= environment
variable, that matches the existign $LISTEN_FDS= one and contains a
colon-separated list of names.
This also adds support for naming fds submitted to the per-service fd
store using FDNAME= in the sd_notify() message.
This also adds a new FileDescriptorName= setting for socket unit files
to set the name for fds created by socket units.
This also adds a new call sd_listen_fds_with_names(), that is similar to
sd_listen_fds(), but also returns the names of the fds.
systemd-activate gained the new --fdname= switch to specify a name for
testing socket activation.
This is based on #1247 by Maciej Wereski.
Fixes #1247. |
3f6fd1ba65f962702753c4ad284b588e59689a23 |
|
29-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
util: introduce common version() implementation and use it everywhere
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. |
ce30c8dcb41dfe9264f79f30c7f51c0e74576638 |
|
10-Jun-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: whenever we fork off a foreign child process reset signal mask/handlers
Also, when the child is potentially long-running make sure to set a
death signal.
Also, ignore the result of the reset operations explicitly by casting
them to (void). |
2eec67acbb00593e414549a7e5b35eb7dd776b1b |
|
23-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused includes
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. |
4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4f |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: another round of simplifications
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno
+ return simplifications". |
56f64d95763a799ba4475daf44d8e9f72a1bd474 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: use log_*_errno whenever %m is in the format string
If the format string contains %m, clearly errno must have a meaningful
value, so we might as well use log_*_errno to have ERRNO= logged.
Using:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/'
Plus some whitespace, linewrap, and indent adjustments. |
23bbb0de4e3f85d9704a5c12a5afa2dfa0159e41 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: more log_*_errno + return simplifications |
eb56eb9b40950f1edcffdb7313f8de4f8572a6d5 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: simplify log_*_errno(r,...) immediately followed by "return r" |
c33b329709ebe2755181980a050d02ec7c81ed87 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: more log_*_errno() conversions, multiline calls
Basically:
find . -name '*.[ch]' | while read f; do perl -i.mmm -e \
'local $/;
local $_=<>;
s/log_(debug|info|notice|warning|error|emergency)\("([^"]*)%s"([^;]*),\s*strerror\(-?([->a-zA-Z_]+)\)\);/log_\1_errno(\4, "\2%m"\3);/gms;print;' \
$f; done
Plus manual indentation fixups. |
da927ba997d68401563b927f92e6e40e021a8e5c |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values. |
0a1beeb64207eaa88ab9236787b1cbc2f704ae14 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: auto-convert the simple cases to log_*_errno()
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(). |
aa44499da15a8fa7026463555a7a27e55e4e24a8 |
|
11-Sep-2014 |
Philippe De Swert <philippedeswert@gmail.com> |
activate: fix fd leak in do_accept()
Found with Coverity. |
601185b43da638b1c74153deae01dbd518680889 |
|
04-Aug-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Unify parse_argv style
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. |
73f860db9893deab6aebceb53dd7d0deb662e832 |
|
31-Jul-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Always prefer our headers to system headers
In practice this shouldn't make much difference, but
sometimes our headers might be newer, and we want to
test them. |
e0aa3726103448097e5ad7cc6f427e142103a321 |
|
17-Mar-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
activate: export make_socket_fd
Also improve logging to print out the parsed address on error. |
892213bf1fd23e48d64a407ece6e10b07bef1926 |
|
30-Dec-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
acticate: rename --environment to --setenv
Nspawn has --setenv, and systemd itself accepts systemd.setenv.
It is nice to have the same parameter name everywhere.
Old name is accepted, but not advertised. |
603938e0a9b5379984d7397e3cf81683c0037a53 |
|
17-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
activate: fix error checking on epoll_ctl() |
c099716487df4a4f5394e57e7ca14da1d358166a |
|
11-Dec-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
activate: clean up inherited descriptors
> [simon@troela server]$ /usr/lib/systemd/systemd-activate -l 9000 main.js
> Assertion 'fd == 3 + count' failed at src/activate/activate.c:115,
> function open_sockets(). Aborting.
> Aborted (core dumped)
> after a bit debuging i found the problem:
> slim appears to leak an fd into all of its children:
> stat /proc/14004/fd/3 (14004 is the pid a random process in my session)
> File: '/proc/14004/fd/3' -> '/var/log/slim.log'
systemd-activate should be robust against the shell (or anything else) leaking
descriptors. Now everything except stdin/stdout/stderr and received sockets
will be closed. |
d5d217eae1b3ba978c4ddd6a2ef2de4621329662 |
|
18-Nov-2013 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused variables |
ed6556920c1a6cdfe0bb04e806bc1f54ea191545 |
|
13-Nov-2013 |
Mantas Mikulėnas <grawity@gmail.com> |
activate: fix crash when -s is passed
getopt_long() was told to accept -s which was never implemented. |
df49ccafc0d57c731a3da3014ad55d5bb9ed3e1b |
|
13-Nov-2013 |
Mantas Mikulėnas <grawity@gmail.com> |
activate: mention -E in the help text |
9d458c0902cdc5d993fd2f78d36fb83a8130c81b |
|
08-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
clients: fix some signal handler issues |
2c408cb6276e3b8d18fb4e2a81a1128d8bbaa70d |
|
07-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
activate: print a nice message if no fd to listen on was specified |
30374ebe5e9f0b37e99dcbdc965c00fcf542f89d |
|
07-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
activate: port to use new getpeername_pretty()/getsockname_pretty() calls |
5b84559a76f30755019d6a0e6b2ccc9bbe0b3c56 |
|
07-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
activate: fix uninitialized memory |
175a3d25d0e8596d4ba0759aea3f89ee228e7d6d |
|
06-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
active: rework make_socket_fd() to be based on socket_address_listen()
Among other things this makes sure we set SO_REUSEADDR which is
immensely useful. |
eceb8483e5a02e8e337486b89719a3b99cfcb7ce |
|
06-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
activate: reduce log settings to normal |
29a5ca9baa58e55c4d9e1d008cdd014aa9c3c3e1 |
|
06-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
activate: get rid of redundant definiton of fd_cloexec() |
eb9da376d76b48585b3b63b4f91903b54f7abd36 |
|
06-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
clients: unify how we invoke getopt_long()
Among other things this makes sure we always expose a --version command
and show it in the help texts. |
e9c1ea9de87d4d508ac38ce87a2fa56e7529a91a |
|
03-Jul-2013 |
Jason St. John <jstjohn@purdue.edu> |
replace tabs with spaces in various files
The affected files in this patch had inconsistent use of tabs vs. spaces
for indentation, and this patch eliminates the stray tabs.
Also, the opening brace of sigchld_hdl() in activate.c was moved so the
opening braces are consistent throughout the file. |
7fd1b19bc9e9f5574f2877936b8ac267c7706947 |
|
18-Apr-2013 |
Harald Hoyer <harald@redhat.com> |
move _cleanup_ attribute in front of the type
http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html |
fff40a51ccbb02e8dec4ff2ee505bc84f75e445c |
|
01-Apr-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
activate: do not leak envp on error |
23ea3dab15181a3966ec45fa2ccbb81e59d2e0a7 |
|
21-Mar-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
activate: avoid warning from -Wshadow
src/activate/activate.c:167:51: warning: declaration shadows a variable in the global scope [-Wshadow]
static int launch(char* name, char **argv, char **environ, int fds) {
^
/usr/include/unistd.h:546:15: note: previous declaration is here
extern char **environ;
^ |
5e65c93a433447b15180249166f7b3944c3e6156 |
|
16-Mar-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
systemd-activate: pass environment variables through
I need this to test half-installed socket-activated python
script, which requires PYTHONPATH and LD_LIBRARY_PATH set.
I assume that other people might find it useful to.
-E VAR passes through VAR from the environment, while
-E VAR=value sets VAR=value.
systemd-activate -E PYTHONPATH=/var/tmp/inst1/usr/lib64/python3.3/site-packages -E LD_LIBRARY_PATH=/var/tmp/inst1/usr/lib -l 2000 python3 -c 'from systemd.daemon import listen_fds; print(listen_fds())' |
2ca0435be9359bde3020eeb528c2a6d72ac1e0b0 |
|
28-Feb-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
systemd-activate: add a socket-activation test tool |