[systemd-devel] Why doe I not see the logging with -u
I made a first setup to make a service for the H2 database. I made the folowing service file: [Unit] Description=H2 Database [Service] Type=simple ExecStart=/usr/bin/java -cp /home/cecil/java/h2/bin/h2-1.3.174.jar org.h2.tools.Console -tool -tcp Restart=always User=cecil [Install] WantedBy=multi-user.target After starting and stopping I got with ‘journalctl -u h2’: -- Logs begin at Tue, 2013-11-19 06:24:51 CET, end at Sat, 2013-12-14 09:15:01 CET. -- Dec 13 11:37:40 Equus.Decebal.nl java[20909]: Web Console server running at http://127.0.0.2:8082 (only local connections) Dec 13 11:37:40 Equus.Decebal.nl java[20909]: TCP server running at tcp://127.0.0.2:9092 (only local connections) Dec 13 11:42:21 Equus.Decebal.nl java[20975]: Web Console server running at http://127.0.0.2:8082 (only local connections) Dec 13 11:42:21 Equus.Decebal.nl java[20975]: TCP server running at tcp://127.0.0.2:9092 (only local connections) Dec 13 11:42:59 Equus.Decebal.nl java[21031]: Web Console server running at http://127.0.0.2:8082 (only local connections) Dec 13 11:42:59 Equus.Decebal.nl java[21031]: TCP server running at tcp://127.0.0.2:9092 (only local connections) Dec 13 11:43:06 Equus.Decebal.nl java[21068]: Web Console server running at http://127.0.0.2:8082 (only local connections) Dec 13 11:43:06 Equus.Decebal.nl java[21068]: TCP server running at tcp://127.0.0.2:9092 (only local connections) lines 1-9/9 (END) But ‘journalctl | grep h2’ gives: Dec 13 11:38:22 Equus.Decebal.nl systemd[1]: h2.service: main process exited, code=exited, status=143/n/a Dec 13 11:38:22 Equus.Decebal.nl systemd[1]: Unit h2.service entered failed state Dec 13 11:42:32 Equus.Decebal.nl systemd[1]: h2.service: main process exited, code=exited, status=143/n/a Dec 13 11:42:32 Equus.Decebal.nl systemd[1]: Unit h2.service entered failed state Dec 13 11:43:03 Equus.Decebal.nl systemd[1]: h2.service: main process exited, code=exited, status=143/n/a Dec 13 11:43:03 Equus.Decebal.nl systemd[1]: Unit h2.service entered failed state Should I not see that with the first command, or am I overlooking something? ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Why doe I not see the logging with -u
В Sat, 14 Dec 2013 09:22:46 +0100 Cecil Westerhof cecil.wester...@snow.nl пишет: I made a first setup to make a service for the H2 database. I made the folowing service file: [Unit] Description=H2 Database [Service] Type=simple ExecStart=/usr/bin/java -cp /home/cecil/java/h2/bin/h2-1.3.174.jar org.h2.tools.Console -tool -tcp Restart=always User=cecil [Install] WantedBy=multi-user.target After starting and stopping I got with ‘journalctl -u h2’: ... Should I not see that with the first command, or am I overlooking something? Did you try journalctl -u h2.service? ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Why doe I not see the logging with -u
On 12/14/2013 09:56 AM, Andrey Borzenkov wrote: I made a first setup to make a service for the H2 database. I made the folowing service file: [Unit] Description=H2 Database [Service] Type=simple ExecStart=/usr/bin/java -cp /home/cecil/java/h2/bin/h2-1.3.174.jar org.h2.tools.Console -tool -tcp Restart=always User=cecil [Install] WantedBy=multi-user.target After starting and stopping I got with ‘journalctl -u h2’: ... Should I not see that with the first command, or am I overlooking something? Did you try journalctl -u h2.service? I did not, but that should give the same result. I just tried it and it does give the same result. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Why doe I not see the logging with -u
В Sat, 14 Dec 2013 10:19:45 +0100 Cecil Westerhof cecil.wester...@snow.nl пишет: On 12/14/2013 09:56 AM, Andrey Borzenkov wrote: I made a first setup to make a service for the H2 database. I made the folowing service file: [Unit] Description=H2 Database [Service] Type=simple ExecStart=/usr/bin/java -cp /home/cecil/java/h2/bin/h2-1.3.174.jar org.h2.tools.Console -tool -tcp Restart=always User=cecil [Install] WantedBy=multi-user.target After starting and stopping I got with ‘journalctl -u h2’: ... Should I not see that with the first command, or am I overlooking something? Did you try journalctl -u h2.service? I did not, but that should give the same result. I just tried it and it does give the same result. As user or as root? ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] systemd + logind possible deadlock
strace -p 1 stat(/sys, {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0 open(/sys/class/tty/console/active, O_RDONLY|O_CLOEXEC) = 19 fstat(19, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fbab0d58000 read(19, ttyS0 tty0\n, 4096) = 11 close(19) = 0 munmap(0x7fbab0d58000, 4096)= 0 open(/sys/class/tty/tty0/active, O_RDONLY|O_CLOEXEC) = 19 fstat(19, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fbab0d58000 read(19, tty7\n, 4096)= 5 close(19) = 0 munmap(0x7fbab0d58000, 4096)= 0 sendmsg(15, {msg_name(0)=NULL, msg_iov(9)=[{PRIORITY=6\nSYSLOG_FACILITY=3\nCOD..., 184}, {UNIT=SOL.service, 16}, {\n, 1}, {MESSAGE_ID=39f53479d3a045ac8e117..., 43}, {\n, 1}, {RESULT=done, 11}, {\n, 1}, {MESSAGE=Started SOL., 20}, {\n, 1}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL^CProcess 1 detached detached ... root 1280 0.1 0.0 0 0 ?Zs дек08 10:16 [systemd-journal] defunct ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] Add more _printf_'s for format-nonliterals
From: Thomas Hindoe Paaboel Andersen pho...@gmail.com Clang is a bit more strict wrt format-nonliterals: http://clang.llvm.org/docs/LanguageExtensions.html#format-string-checking Adding these extra printf attributes also makes gcc able to find more problems. E.g. this patch uncovers a format issue in udev-builtin-path_id.c Some parts looked intetional about breaking the format-nonliteral check. I added some supression for warnings there. --- src/core/job.c | 3 +++ src/core/unit.c| 3 +++ src/journal/journal-gatewayd.c | 1 + src/journal/microhttpd-util.c | 4 src/libsystemd-bus/bus-error.c | 2 ++ src/libudev/libudev.c | 1 + src/test/test-libudev.c| 1 + src/udev/accelerometer/accelerometer.c | 1 + src/udev/ata_id/ata_id.c | 1 + src/udev/cdrom_id/cdrom_id.c | 1 + src/udev/scsi_id/scsi_id.c | 1 + src/udev/udev-builtin-kmod.c | 1 + src/udev/udev-builtin-path_id.c| 1 + 13 files changed, 21 insertions(+) diff --git a/src/core/job.c b/src/core/job.c index ce97263..491c73d 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -610,6 +610,8 @@ _pure_ static const char *job_get_status_message_format_try_harder(Unit *u, JobT return NULL; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored -Wformat-nonliteral static void job_print_status_message(Unit *u, JobType t, JobResult result) { const char *format; @@ -676,6 +678,7 @@ static void job_print_status_message(Unit *u, JobType t, JobResult result) { unit_status_printf(u, ANSI_HIGHLIGHT_ON INFO ANSI_HIGHLIGHT_OFF, %s is not active.); } } +#pragma GCC diagnostic pop #pragma GCC diagnostic push #pragma GCC diagnostic ignored -Wformat-nonliteral diff --git a/src/core/unit.c b/src/core/unit.c index 6458c7f..160a346 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -1125,6 +1125,8 @@ _pure_ static const char *unit_get_status_message_format_try_harder(Unit *u, Job return NULL; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored -Wformat-nonliteral static void unit_status_print_starting_stopping(Unit *u, JobType t) { const char *format; @@ -1139,6 +1141,7 @@ static void unit_status_print_starting_stopping(Unit *u, JobType t) { unit_status_printf(u, , format); } +#pragma GCC diagnostic pop #pragma GCC diagnostic push #pragma GCC diagnostic ignored -Wformat-nonliteral diff --git a/src/journal/journal-gatewayd.c b/src/journal/journal-gatewayd.c index 384137b..5c35d8e 100644 --- a/src/journal/journal-gatewayd.c +++ b/src/journal/journal-gatewayd.c @@ -131,6 +131,7 @@ static int respond_oom_internal(struct MHD_Connection *connection) { #define respond_oom(connection) log_oom(), respond_oom_internal(connection) +_printf_(3,4) static int respond_error( struct MHD_Connection *connection, unsigned code, diff --git a/src/journal/microhttpd-util.c b/src/journal/microhttpd-util.c index 382087c..5675af4 100644 --- a/src/journal/microhttpd-util.c +++ b/src/journal/microhttpd-util.c @@ -27,6 +27,9 @@ #include macro.h #include util.h +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored -Wformat-nonliteral +_printf_(2,0) void microhttpd_logger(void *arg, const char *fmt, va_list ap) { _cleanup_free_ char *f; if (asprintf(f, microhttpd: %s, fmt) = 0) { @@ -35,3 +38,4 @@ void microhttpd_logger(void *arg, const char *fmt, va_list ap) { } log_metav(LOG_INFO, NULL, 0, NULL, f, ap); } +#pragma GCC diagnostic pop diff --git a/src/libsystemd-bus/bus-error.c b/src/libsystemd-bus/bus-error.c index 25eaf0e..2d1e80d 100644 --- a/src/libsystemd-bus/bus-error.c +++ b/src/libsystemd-bus/bus-error.c @@ -250,6 +250,7 @@ finish: return -bus_error_name_to_errno(name); } +_printf_(3,0) int bus_error_setfv(sd_bus_error *e, const char *name, const char *format, va_list ap) { if (!name) @@ -463,6 +464,7 @@ _public_ int sd_bus_error_set_errno(sd_bus_error *e, int error) { return -error; } +_printf_(3,0) int bus_error_set_errnofv(sd_bus_error *e, int error, const char *format, va_list ap) { int r; diff --git a/src/libudev/libudev.c b/src/libudev/libudev.c index bc73a5a..e1ba82f 100644 --- a/src/libudev/libudev.c +++ b/src/libudev/libudev.c @@ -65,6 +65,7 @@ void udev_log(struct udev *udev, va_end(args); } +_printf_(6,0) static void log_stderr(struct udev *udev, int priority, const char *file, int line, const char *fn, const char *format, va_list args) diff --git a/src/test/test-libudev.c b/src/test/test-libudev.c index 7ed4e14..a8c1ff0 100644 --- a/src/test/test-libudev.c +++ b/src/test/test-libudev.c @@ -34,6 +34,7 @@ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +_printf_(6,0) static void
Re: [systemd-devel] [RFC] [PATCH 0/3] journal: Add deferred log processing to reduce synchonous IO overhead
On Fri, Dec 13, 2013 at 10:16:16PM +0100, Karol Lewandowski wrote: One of the problems I see, though, is that no matter how deep I make the queue (`max_dgram_qlen') I still see process sleeping on send() way earlier that configured queue depth would suggest. Are you sure that the sysctl is set early enough, before the listening socket is created? Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Why doe I not see the logging with -u
On Sat, Dec 14, 2013 at 09:22:46AM +0100, Cecil Westerhof wrote: I made a first setup to make a service for the H2 database. I made the folowing service file: [Unit] Description=H2 Database [Service] Type=simple ExecStart=/usr/bin/java -cp /home/cecil/java/h2/bin/h2-1.3.174.jar org.h2.tools.Console -tool -tcp Restart=always User=cecil [Install] WantedBy=multi-user.target After starting and stopping I got with ‘journalctl -u h2’: -- Logs begin at Tue, 2013-11-19 06:24:51 CET, end at Sat, 2013-12-14 09:15:01 CET. -- Dec 13 11:37:40 Equus.Decebal.nl java[20909]: Web Console server running at http://127.0.0.2:8082 (only local connections) Dec 13 11:37:40 Equus.Decebal.nl java[20909]: TCP server running at tcp://127.0.0.2:9092 (only local connections) Dec 13 11:42:21 Equus.Decebal.nl java[20975]: Web Console server running at http://127.0.0.2:8082 (only local connections) Dec 13 11:42:21 Equus.Decebal.nl java[20975]: TCP server running at tcp://127.0.0.2:9092 (only local connections) Dec 13 11:42:59 Equus.Decebal.nl java[21031]: Web Console server running at http://127.0.0.2:8082 (only local connections) Dec 13 11:42:59 Equus.Decebal.nl java[21031]: TCP server running at tcp://127.0.0.2:9092 (only local connections) Dec 13 11:43:06 Equus.Decebal.nl java[21068]: Web Console server running at http://127.0.0.2:8082 (only local connections) Dec 13 11:43:06 Equus.Decebal.nl java[21068]: TCP server running at tcp://127.0.0.2:9092 (only local connections) lines 1-9/9 (END) But ‘journalctl | grep h2’ gives: Dec 13 11:38:22 Equus.Decebal.nl systemd[1]: h2.service: main process exited, code=exited, status=143/n/a Dec 13 11:38:22 Equus.Decebal.nl systemd[1]: Unit h2.service entered failed state Dec 13 11:42:32 Equus.Decebal.nl systemd[1]: h2.service: main process exited, code=exited, status=143/n/a Dec 13 11:42:32 Equus.Decebal.nl systemd[1]: Unit h2.service entered failed state Dec 13 11:43:03 Equus.Decebal.nl systemd[1]: h2.service: main process exited, code=exited, status=143/n/a Dec 13 11:43:03 Equus.Decebal.nl systemd[1]: Unit h2.service entered failed state Should I not see that with the first command, or am I overlooking something? You should. Can you show the output of 'journalctl -o verbose' corresponding to both types of message above? And for good measure, the output from SYSTEMD_LOG_LEVEL=debug journalctl -u h2 21 /dev/null|grep 'Journal filter' Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] Add more _printf_'s for format-nonliterals
On Sat, Dec 14, 2013 at 01:32:35PM +0100, Thomas H.P. Andersen wrote: From: Thomas Hindoe Paaboel Andersen pho...@gmail.com Clang is a bit more strict wrt format-nonliterals: http://clang.llvm.org/docs/LanguageExtensions.html#format-string-checking Adding these extra printf attributes also makes gcc able to find more problems. E.g. this patch uncovers a format issue in udev-builtin-path_id.c Some parts looked intetional about breaking the format-nonliteral check. I added some supression for warnings there. Looks OK. But I don't see the fix for udev-builtin-path_id.c? Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] systemd + logind possible deadlock
On Sat, Dec 14, 2013 at 11:55:47AM +0200, Oleksii Shevchuk wrote: strace -p 1 stat(/sys, {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0 open(/sys/class/tty/console/active, O_RDONLY|O_CLOEXEC) = 19 fstat(19, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fbab0d58000 read(19, ttyS0 tty0\n, 4096) = 11 close(19) = 0 munmap(0x7fbab0d58000, 4096)= 0 open(/sys/class/tty/tty0/active, O_RDONLY|O_CLOEXEC) = 19 fstat(19, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fbab0d58000 read(19, tty7\n, 4096)= 5 close(19) = 0 munmap(0x7fbab0d58000, 4096)= 0 sendmsg(15, {msg_name(0)=NULL, msg_iov(9)=[{PRIORITY=6\nSYSLOG_FACILITY=3\nCOD..., 184}, {UNIT=SOL.service, 16}, {\n, 1}, {MESSAGE_ID=39f53479d3a045ac8e117..., 43}, {\n, 1}, {RESULT=done, 11}, {\n, 1}, {MESSAGE=Started SOL., 20}, {\n, 1}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL^CProcess 1 detached detached ... It's not hangin', just pretendin' :) What y'all think about a little patch like this? ---8--- From 349f5ec587e5e6cc3ad7c89573bb15219eac8920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= zbys...@in.waw.pl Date: Sat, 14 Dec 2013 11:54:26 -0500 Subject: [PATCH] logging: reduce send timeout to something more sensible For a user, the timeout of 1 min per message seems equivalent to a hang. If journald cannot process a message from PID1 for 10 ms then something is significantly wrong. It's better to lose the message and continue. --- src/shared/log.c | 5 - src/shared/time-util.c | 7 +++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/shared/log.c b/src/shared/log.c index 2404de8..d0616c8 100644 --- a/src/shared/log.c +++ b/src/shared/log.c @@ -126,7 +126,10 @@ static int create_log_socket(int type) { /* We need a blocking fd here since we'd otherwise lose messages way too early. However, let's not hang forever in the unlikely case of a deadlock. */ -timeval_store(tv, 1*USEC_PER_MINUTE); +if (getpid() == 1) +timeval_store(tv, 10 * USEC_PER_MSEC); +else +timeval_store(tv, 10 * USEC_PER_SEC); setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, tv, sizeof(tv)); return fd; diff --git a/src/shared/time-util.c b/src/shared/time-util.c index 55428c4..205fa6f 100644 --- a/src/shared/time-util.c +++ b/src/shared/time-util.c @@ -142,12 +142,11 @@ struct timeval *timeval_store(struct timeval *tv, usec_t u) { if (u == (usec_t) -1) { tv-tv_sec = (time_t) -1; tv-tv_usec = (suseconds_t) -1; -return tv; +} else { +tv-tv_sec = (time_t) (u / USEC_PER_SEC); +tv-tv_usec = (suseconds_t) (u % USEC_PER_SEC); } -tv-tv_sec = (time_t) (u / USEC_PER_SEC); -tv-tv_usec = (suseconds_t) (u % USEC_PER_SEC); - return tv; } -- 1.8.1.rc0.194.gaf2e3a9 ---8--- Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] build: use -ftrapv for development
We want to find these bugs if they exist. --- autogen.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autogen.sh b/autogen.sh index d0a2f3f..9ffd724 100755 --- a/autogen.sh +++ b/autogen.sh @@ -54,10 +54,10 @@ args=$args \ fi if [ x$1 = xc ]; then -./configure CFLAGS='-g -O0' --enable-kdbus $args +./configure CFLAGS='-g -O0 -ftrapv' --enable-kdbus $args make clean elif [ x$1 = xg ]; then -./configure CFLAGS='-g -Og' --enable-kdbus $args +./configure CFLAGS='-g -Og -ftrapv' --enable-kdbus $args make clean else echo @@ -65,6 +65,6 @@ else echo Initialized build system. For a common configuration please run: echo echo -echo ./configure CFLAGS='-g -O0' --enable-kdbus $args +echo ./configure CFLAGS='-g -O0 -ftrapv' --enable-kdbus $args echo fi -- 1.8.5.1 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] machines get killed when scopes are destroyed
On Mon, Nov 18, 2013 at 03:03:18AM +0100, Zbigniew Jędrzejewski-Szmek wrote: v0lZy reported on IRC that his qemu machines get killed when shutting down the host. libvirt-guests.service is designed to suspend them during shutdown, but when it was run, the guests were all already dead. And indeed, each qemu is running inside a scope, which is not connected by any dependencies to either systemd-machine.service, or libvirt-guests.service. libvirt-guests.service does not depend on systemd-machine.service either. This means that when shutdown is ordered, the scopes will stopped in parallel to other libvirt-guests.service, and depending on timing, qemus will be just killed with SIGTERM. For this whole thing to work correctly, we need to ensure that scopes are not terminated prematurely. If we introduced a target like libvirt-ready.target, and made libvirt-guests.service be After=libvirt-ready.target, and made all the scopes be Before=libvirt-ready.target, I think the vms would have a chance to shutdown properly. But that's pretty complicated. And I'm not even sure how to do that properly. Any better ideas? As mentioned downthread, Zbyszek filed: https://bugzilla.redhat.com/show_bug.cgi?id=1031696 Basically I tried to pass After=libvirt-guests.service to CreateMachine scope_properties, but I just got an error back. Libvirt diffs are in the bug report. Maybe that isn't supposed to work, or makes no sense, or I messed up the syntax. Or maybe there's a much better solution. Lennart, any thoughts? Thanks, Cole ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] build: use -ftrapv for development
Applied. Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] systemctl: add the --plain option to the help message
--- src/systemctl/systemctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 24a74c3..9a76349 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -4834,7 +4834,8 @@ static int systemctl_help(void) { --root=PATH Enable unit files in the specified root directory\n -n --lines=INTEGER Number of journal entries to show\n -o --output=STRING Change journal output mode (short, short-monotonic,\n - verbose, export, json, json-pretty, json-sse, cat)\n\n + verbose, export, json, json-pretty, json-sse, cat)\n +--plain Print unit dependencies as a list instead of a tree\n\n Unit Commands:\n list-units [PATTERN...] List loaded units\n list-sockets [PATTERN...] List loaded sockets ordered by address\n -- 1.8.3.1 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] systemctl: add the --plain option to the help message
Applied. Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Why doe I not see the logging with -u
On 12/14/2013 05:25 PM, Zbigniew Jędrzejewski-Szmek wrote: On Sat, Dec 14, 2013 at 09:22:46AM +0100, Cecil Westerhof wrote: I made a first setup to make a service for the H2 database. I made the folowing service file: [Unit] Description=H2 Database [Service] Type=simple ExecStart=/usr/bin/java -cp /home/cecil/java/h2/bin/h2-1.3.174.jar org.h2.tools.Console -tool -tcp Restart=always User=cecil [Install] WantedBy=multi-user.target After starting and stopping I got with ‘journalctl -u h2’: -- Logs begin at Tue, 2013-11-19 06:24:51 CET, end at Sat, 2013-12-14 09:15:01 CET. -- Dec 13 11:37:40 Equus.Decebal.nl java[20909]: Web Console server running at http://127.0.0.2:8082 (only local connections) Dec 13 11:37:40 Equus.Decebal.nl java[20909]: TCP server running at tcp://127.0.0.2:9092 (only local connections) Dec 13 11:42:21 Equus.Decebal.nl java[20975]: Web Console server running at http://127.0.0.2:8082 (only local connections) Dec 13 11:42:21 Equus.Decebal.nl java[20975]: TCP server running at tcp://127.0.0.2:9092 (only local connections) Dec 13 11:42:59 Equus.Decebal.nl java[21031]: Web Console server running at http://127.0.0.2:8082 (only local connections) Dec 13 11:42:59 Equus.Decebal.nl java[21031]: TCP server running at tcp://127.0.0.2:9092 (only local connections) Dec 13 11:43:06 Equus.Decebal.nl java[21068]: Web Console server running at http://127.0.0.2:8082 (only local connections) Dec 13 11:43:06 Equus.Decebal.nl java[21068]: TCP server running at tcp://127.0.0.2:9092 (only local connections) lines 1-9/9 (END) But ‘journalctl | grep h2’ gives: Dec 13 11:38:22 Equus.Decebal.nl systemd[1]: h2.service: main process exited, code=exited, status=143/n/a Dec 13 11:38:22 Equus.Decebal.nl systemd[1]: Unit h2.service entered failed state Dec 13 11:42:32 Equus.Decebal.nl systemd[1]: h2.service: main process exited, code=exited, status=143/n/a Dec 13 11:42:32 Equus.Decebal.nl systemd[1]: Unit h2.service entered failed state Dec 13 11:43:03 Equus.Decebal.nl systemd[1]: h2.service: main process exited, code=exited, status=143/n/a Dec 13 11:43:03 Equus.Decebal.nl systemd[1]: Unit h2.service entered failed state Should I not see that with the first command, or am I overlooking something? You should. Can you show the output of 'journalctl -o verbose' corresponding to both types of message above? See attachments. And for good measure, the output from SYSTEMD_LOG_LEVEL=debug journalctl -u h2 21 /dev/null|grep 'Journal filter' That gives nothing. Even when I remove /dev/null -- Logs begin at Tue, 2013-11-19 06:24:51 CET, end at Sun, 2013-12-15 00:59:08 CET. -- Fri, 2013-12-13 11:37:40 CET [s=b6a58b6feb364b758ecb0ff6d531b755;i=ab73;b=36201f9cba90417c9c8ff931d14a17ed;m=8619d59103;t=4ed680d31f64a;x=4c5eb74b9e57f151] PRIORITY=6 _UID=0 _GID=0 _SELINUX_CONTEXT=[11B blob data] _MACHINE_ID=32d8e93f7e634d9d87d1021d9f47a2ad _HOSTNAME=Equus.Decebal.nl SYSLOG_FACILITY=3 _TRANSPORT=stdout _BOOT_ID=36201f9cba90417c9c8ff931d14a17ed SYSLOG_IDENTIFIER=java MESSAGE=Web Console server running at http://127.0.0.2:8082 (only local connections) _PID=20909 _COMM=java _EXE=/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0/jre/bin/java _CMDLINE=/usr/bin/java -cp /home/cecil/java/h2/bin/h2-1.3.174.jar org.h2.tools.Console -tool -tcp _SYSTEMD_CGROUP=/system/h2.service _SYSTEMD_UNIT=h2.service Fri, 2013-12-13 11:37:40 CET [s=b6a58b6feb364b758ecb0ff6d531b755;i=ab74;b=36201f9cba90417c9c8ff931d14a17ed;m=8619d78765;t=4ed680d33ecac;x=c7dc6cedba777091] PRIORITY=6 _UID=0 _GID=0 _SELINUX_CONTEXT=[11B blob data] _MACHINE_ID=32d8e93f7e634d9d87d1021d9f47a2ad _HOSTNAME=Equus.Decebal.nl SYSLOG_FACILITY=3 _TRANSPORT=stdout _BOOT_ID=36201f9cba90417c9c8ff931d14a17ed SYSLOG_IDENTIFIER=java _PID=20909 _COMM=java _EXE=/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0/jre/bin/java _CMDLINE=/usr/bin/java -cp /home/cecil/java/h2/bin/h2-1.3.174.jar org.h2.tools.Console -tool -tcp _SYSTEMD_CGROUP=/system/h2.service _SYSTEMD_UNIT=h2.service MESSAGE=TCP server running at tcp://127.0.0.2:9092 (only local connections) Fri, 2013-12-13 11:42:21 CET [s=b6a58b6feb364b758ecb0ff6d531b755;i=ab89;b=36201f9cba90417c9c8ff931d14a17ed;m=862a9286e4;t=4ed681deeec2b;x=de115828119e26b7] PRIORITY=6 _UID=0 _GID=0 _SELINUX_CONTEXT=[11B blob data] _MACHINE_ID=32d8e93f7e634d9d87d1021d9f47a2ad _HOSTNAME=Equus.Decebal.nl SYSLOG_FACILITY=3 _TRANSPORT=stdout _BOOT_ID=36201f9cba90417c9c8ff931d14a17ed SYSLOG_IDENTIFIER=java MESSAGE=Web Console server running at http://127.0.0.2:8082 (only local connections)
Re: [systemd-devel] [PATCH] Add more _printf_'s for format-nonliterals
On Sat, Dec 14, 2013 at 5:31 PM, Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl wrote: On Sat, Dec 14, 2013 at 01:32:35PM +0100, Thomas H.P. Andersen wrote: From: Thomas Hindoe Paaboel Andersen pho...@gmail.com Clang is a bit more strict wrt format-nonliterals: http://clang.llvm.org/docs/LanguageExtensions.html#format-string-checking Adding these extra printf attributes also makes gcc able to find more problems. E.g. this patch uncovers a format issue in udev-builtin-path_id.c Some parts looked intetional about breaking the format-nonliteral check. I added some supression for warnings there. Looks OK. But I don't see the fix for udev-builtin-path_id.c? Thanks, pushed. This patch only adds warnings for the issue in udev-builtin-path_id.c. I just wanted to point out that this also has a benefit with gcc. The issue in udev-builtin-path_id.c still needs to be fixed :) ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] udev: fix printf specifiers
This keeps the same behavior, which is wierd. --- src/udev/udev-builtin-path_id.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c index 7476330..7543a11 100644 --- a/src/udev/udev-builtin-path_id.c +++ b/src/udev/udev-builtin-path_id.c @@ -71,9 +71,9 @@ static int format_lun_number(struct udev_device *dev, char **path) /* address method 0, peripheral device addressing with bus id of zero */ if (lun 256) -return path_prepend(path, lun-%d, lun); +return path_prepend(path, lun-%hhu, (unsigned char) lun); /* handle all other lun addressing methods by using a variant of the original lun format */ -return path_prepend(path, lun-0x%04x%04x, (lun 0x), (lun 16) 0x); +return path_prepend(path, lun-0x%04hx%04hx, (unsigned short)(lun 0x), (unsigned short)(lun 16) 0x); } static struct udev_device *skip_subsystem(struct udev_device *dev, const char *subsys) -- 1.8.5.1 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Fwd: [Pkg-systemd-maintainers] Bug#732157: Want SIGSTOP-style daemon/service readiness notification
On Sat, Dec 14, 2013 at 11:19 PM, Shawn Landden sh...@churchofgit.com wrote: It would be nice if systemd could implement the service supervisor side of the service readiness protocol that upstart calls expect stop: The service doesn't fork, and when considers itself ready it raises SIGSTOP. The supervisor can observe this via the usual mechanisms, being the service's parent, and when it occurs it sends the service CONT and starts whatever was waiting for readiness. The sd_notify(3) protocol is just about tolerable, and it is good that it's documented, but it is quite unattractive for a daemon author: Either they have to add a build- and runtime- dependency on a systemd-specific library, or they have to reimplement a fairly tedious piece of socket code. For a daemon author, raise(SIGSTOP) is lovely and simple. I guess this would be a new Type (but I'm still halfway through the docs so no expert). No, it's not lovely, it's a very cheap and very bad hack. These signals are for admins and not for system management tools; just the same way ptrace is the very wrong tool to track startup behavior of services. It is just so wrong to things like that, and systemd should not do that. Kay ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] udev: fix printf specifiers
On Sat, Dec 14, 2013 at 06:48:34PM -0800, Shawn Landden wrote: This keeps the same behavior, which is wierd. --- src/udev/udev-builtin-path_id.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c index 7476330..7543a11 100644 --- a/src/udev/udev-builtin-path_id.c +++ b/src/udev/udev-builtin-path_id.c @@ -71,9 +71,9 @@ static int format_lun_number(struct udev_device *dev, char **path) /* address method 0, peripheral device addressing with bus id of zero */ if (lun 256) -return path_prepend(path, lun-%d, lun); +return path_prepend(path, lun-%hhu, (unsigned char) lun); /* handle all other lun addressing methods by using a variant of the original lun format */ -return path_prepend(path, lun-0x%04x%04x, (lun 0x), (lun 16) 0x); +return path_prepend(path, lun-0x%04hx%04hx, (unsigned short)(lun 0x), (unsigned short)(lun 16) 0x); } Hm, nothing wrong with this approach, but I don't like all those casts. I pushed a simpler change which adds 'l' in appropriate places. Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] udev: fix printf specifiers
On Sat, Dec 14, 2013 at 8:11 PM, Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl wrote: On Sat, Dec 14, 2013 at 06:48:34PM -0800, Shawn Landden wrote: This keeps the same behavior, which is wierd. --- src/udev/udev-builtin-path_id.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c index 7476330..7543a11 100644 --- a/src/udev/udev-builtin-path_id.c +++ b/src/udev/udev-builtin-path_id.c @@ -71,9 +71,9 @@ static int format_lun_number(struct udev_device *dev, char **path) /* address method 0, peripheral device addressing with bus id of zero */ if (lun 256) -return path_prepend(path, lun-%d, lun); +return path_prepend(path, lun-%hhu, (unsigned char) lun); /* handle all other lun addressing methods by using a variant of the original lun format */ -return path_prepend(path, lun-0x%04x%04x, (lun 0x), (lun 16) 0x); +return path_prepend(path, lun-0x%04hx%04hx, (unsigned short)(lun 0x), (unsigned short)(lun 16) 0x); } Hm, nothing wrong with this approach, but I don't like all those casts. I just decided to be explicit about what the code was doing because it is confusing, and AFAICT without any other justification, probably wrong. it could have been fixed by simply removing the long above, as the top comment says that it is only 32-bits wide. (and the formatting only supports 32-bits too) if you are going to put the least siginificant bytes first, wouldn't you want to do so byte-wise, instead of creating this mixed-endian monster? I pushed a simpler change which adds 'l' in appropriate places. Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel