[systemd-devel] User journal corrupted or uncleanly shut down, renaming and replacing

2013-08-12 Thread Pedro Francisco
Hi,
Systemd complains frequently about corrupted journal. Do note: I don't
have the default mount options.

$ dmesg |grep corrupte
[   51.766346] systemd-journald[181]: File
/var/log/journal/06fde5edd4974fa9a343215f093f5aae/user-42.journal
corrupted or uncleanly shut down, renaming and replacing.

$ sudo rpm -qa systemd
systemd-204-9.fc19.i686

$ cat /proc/mounts
(...)
/dev/sda6 / ext4 rw,seclabel,noatime,nobarrier 0 0
(...)

In addition, I have an issue related to systemd-journald stopping
logging after a while if there are lots of output, as I mentioned on
http://thread.gmane.org/gmane.comp.sysutils.systemd.devel/12373 titled
Journald stops logging when lots of output .

Do you think:
a) mount options can affect systemd logging and
b) these two issues (the one on this email about corrupted journal and
the one on the linked thread about journald crashing when there are
lots of output) may be related?

Thanks in Advance,
-- 
Pedro
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] User journal corrupted or uncleanly shut down, renaming and replacing

2013-08-12 Thread Frederick Grose
On Mon, Aug 12, 2013 at 9:58 AM, Pedro Francisco
pedrogfranci...@gmail.com wrote:
 Hi,
 Systemd complains frequently about corrupted journal. Do note: I don't
 have the default mount options.

 $ dmesg |grep corrupte
 [   51.766346] systemd-journald[181]: File
 /var/log/journal/06fde5edd4974fa9a343215f093f5aae/user-42.journal
 corrupted or uncleanly shut down, renaming and replacing.

 $ sudo rpm -qa systemd
 systemd-204-9.fc19.i686

 $ cat /proc/mounts
 (...)
 /dev/sda6 / ext4 rw,seclabel,noatime,nobarrier 0 0
 (...)


See this thread for similar complaints:
https://lists.fedoraproject.org/pipermail/livecd/2013-August/007456.html

  --Fred

 In addition, I have an issue related to systemd-journald stopping
 logging after a while if there are lots of output, as I mentioned on
 http://thread.gmane.org/gmane.comp.sysutils.systemd.devel/12373 titled
 Journald stops logging when lots of output .

 Do you think:
 a) mount options can affect systemd logging and
 b) these two issues (the one on this email about corrupted journal and
 the one on the linked thread about journald crashing when there are
 lots of output) may be related?

 Thanks in Advance,
 --
 Pedro
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] stop+start of nspawn scope aborts: 's-state == SCOPE_DEAD'

2013-08-12 Thread Marti Raudsepp
Hi list,

I hit a bug today in the scope unit support. Reproducible like this:

systemd-nspawn -bD /srv/subarch
systemctl stop machine-subarch.scope
systemctl start machine-subarch.scope

I wasn't sure whether start would do anything or not so I gave it a
shot, but it turned out to crash the host systemd with:

Assertion 's-state == SCOPE_DEAD' failed at src/core/scope.c:246,
function scope_start(). Aborting

Tested with systemd 206 as well as current git master
(206.103.g631c922) on Arch Linux.

/srv/subarch is a plain Arch Linux installation created according to:
https://wiki.archlinux.org/index.php/Arch_systemd_container

Regards,
Marti



gdb backtrace:
#0  0x7fa684ee21c9 in raise () from /usr/lib/libc.so.6
#1  0x7fa684ee35c8 in abort () from /usr/lib/libc.so.6
#2  0x0045d823 in log_assert ()
#3  0x0045e0c0 in log_assert_failed ()
#4  0x0047ea2f in scope_start ()
#5  0x00479721 in job_run_and_invalidate ()
#6  0x0040e3ee in manager_dispatch_run_queue ()
#7  0x0041152f in manager_loop ()
#8  0x00409726 in main ()

Full log:

Aug 12 19:30:32 arch systemd[1]: Stopping Container subarch
Aug 12 19:30:33 arch systemd[1]: machine-subarch.scope stopping timed
out. Killing
Aug 12 19:30:33 arch systemd[1]: Stopped Container subarch
Aug 12 19:30:33 arch systemd[1]: Unit machine-subarch.scope entered
failed state
Aug 12 19:30:33 arch systemd-machined[403]: Machine subarch terminated
Aug 12 19:30:33 arch systemd[1]: Stopped Container subarch

Aug 12 19:30:35 arch systemd[1]: Starting Container subarch
Aug 12 19:30:35 arch systemd[1]: Assertion 's-state == SCOPE_DEAD'
failed at src/core/scope.c:246, function scope_start(). Aborting
Aug 12 19:30:35 arch systemd[1]: Caught ABRT, dumped core as pid 486
Aug 12 19:30:35 arch systemd[1]: Freezing execution
Aug 12 19:30:35 arch systemd-coredump[487]: Process 486 (systemd)
dumped core
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] zsh_completion: Correctly display journal fields

2013-08-12 Thread William Giokas
---
 shell-completion/zsh/_journalctl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shell-completion/zsh/_journalctl b/shell-completion/zsh/_journalctl
index 61983d5..32708f5 100644
--- a/shell-completion/zsh/_journalctl
+++ b/shell-completion/zsh/_journalctl
@@ -19,7 +19,7 @@ _list_fields() {
 _KERNEL_{DEVICE,SUBSYSTEM}
 _UDEV_{SYSNAME,DEVNODE,DEVLINK}
 __CURSOR __{REALTIME,MONOTONIC}_TIMESTAMP)
-_describe 'possible fields' journal_fields
+_values -s '=' 'possible fields' ${journal_fields[@]}:value:
 }
 
 _journal_none() {
-- 
1.8.4.rc2.458.gc9b7461

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH v2] zsh_completion: Correctly display journal fields

2013-08-12 Thread William Giokas
---

Just a slightly edited version that functions MUCH nicer. Now, on top of
putting in the equals sign, when you type in:

  journalctl _EXE=tab

it automagically calles _journal_fields with _EXE as an argument. Same
with every other value you could put in there. Some examples:

wgiokas@wst420:~ % journalctl _BOOT_ID=tab
 possible values
037a3189b60e4da3917b49f7b92fe1ae  75fc1f7abd0c46d98c8dc159d69ae33c
wgiokas@wst420:~ % journalctl _HOSTNAME=tab
 possible values
bridge1localhost  wst420 wst421


 shell-completion/zsh/_journalctl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/shell-completion/zsh/_journalctl b/shell-completion/zsh/_journalctl
index 61983d5..0e909fe 100644
--- a/shell-completion/zsh/_journalctl
+++ b/shell-completion/zsh/_journalctl
@@ -19,7 +19,8 @@ _list_fields() {
 _KERNEL_{DEVICE,SUBSYSTEM}
 _UDEV_{SYSNAME,DEVNODE,DEVLINK}
 __CURSOR __{REALTIME,MONOTONIC}_TIMESTAMP)
-_describe 'possible fields' journal_fields
+_values -s '=' 'possible fields' \
+  ${journal_fields[@]}:value:_journal_fields ${words[CURRENT]%%=*}
 }
 
 _journal_none() {
-- 
1.8.4.rc2.458.gc9b7461

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] zsh_completion: Move helper function to autoload

2013-08-12 Thread William Giokas
_hosts_or_user_at_host was used by 6 different completions, and
previously was in all 6 of those files. I moved it out to its own file,
_sd_hosts_or_user_at_host. This will be autoloaded for use in other
completion functions. It also allows external completions to use this
function by simply calling _sd_hosts_or_user_at_host as in the systemd
completions.
---

I noticed this when looking at the _machinectl completions and seeing no
function of that name in the file. I think that this will make things
easier in the future.

The '_sd_' is just to prevent name conflicts if some other program
provides _hosts_or_user_at_host.

 Makefile.am| 1 +
 shell-completion/zsh/_hostnamectl  | 8 +---
 shell-completion/zsh/_localectl| 8 +---
 shell-completion/zsh/_loginctl | 8 +---
 shell-completion/zsh/_machinectl   | 2 +-
 shell-completion/zsh/_sd_hosts_or_user_at_host | 5 +
 shell-completion/zsh/_systemctl| 8 +---
 shell-completion/zsh/_timedatectl  | 8 +---
 8 files changed, 12 insertions(+), 36 deletions(-)
 create mode 100644 shell-completion/zsh/_sd_hosts_or_user_at_host

diff --git a/Makefile.am b/Makefile.am
index b8b8d06..0590e4d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -350,6 +350,7 @@ dist_zshcompletion_DATA = \
shell-completion/zsh/_kernel-install \
shell-completion/zsh/_systemd-nspawn \
shell-completion/zsh/_systemd-analyze \
+   shell-completion/zsh/_sd_hosts_or_user_at_host \
shell-completion/zsh/_systemd
 
 dist_sysctl_DATA = \
diff --git a/shell-completion/zsh/_hostnamectl 
b/shell-completion/zsh/_hostnamectl
index bc4441d..9d01495 100644
--- a/shell-completion/zsh/_hostnamectl
+++ b/shell-completion/zsh/_hostnamectl
@@ -1,11 +1,5 @@
 #compdef hostnamectl
 
-_hosts_or_user_at_host() {
-  _alternative \
-'users-hosts:: _user_at_host' \
-'hosts:: _hosts'
-}
-
 _hostnamectl_command() {
 local -a _hostnamectl_cmds
 _hostnamectl_cmds=(
@@ -34,5 +28,5 @@ _arguments -s \
 '--static[Only set static hostname]' \
 '--pretty[Only set pretty hostname]' \
 '--no-ask-password[Do not prompt for password]' \
-{-H,--host=}'[Operate on remote host]:userathost:_hosts_or_user_at_host' \
+{-H,--host=}'[Operate on remote 
host]:userathost:_sd_hosts_or_user_at_host' \
 '*::hostnamectl commands:_hostnamectl_command'
diff --git a/shell-completion/zsh/_localectl b/shell-completion/zsh/_localectl
index 0beed4f..321e418 100644
--- a/shell-completion/zsh/_localectl
+++ b/shell-completion/zsh/_localectl
@@ -73,17 +73,11 @@ _localectl_command() {
 fi
 }
 
-_hosts_or_user_at_host() {
-  _alternative \
-'users-hosts:: _user_at_host' \
-'hosts:: _hosts'
-}
-
 _arguments \
 {-h,--help}'[Show this help]' \
 '--version[Show package version]' \
 --no-convert[Don't convert keyboard mappings] \
 '--no-pager[Do not pipe output into a pager]' \
 '--no-ask-password[Do not prompt for password]' \
-{-H,--host=}'[Operate on remote host]:userathost:_hosts_or_user_at_host' \
+{-H,--host=}'[Operate on remote 
host]:userathost:_sd_hosts_or_user_at_host' \
 '*::localectl commands:_localectl_command'
diff --git a/shell-completion/zsh/_loginctl b/shell-completion/zsh/_loginctl
index d121a25..6d88685 100644
--- a/shell-completion/zsh/_loginctl
+++ b/shell-completion/zsh/_loginctl
@@ -1,11 +1,5 @@
 #compdef loginctl
 
-_hosts_or_user_at_host() {
-  _alternative \
-'users-hosts:: _user_at_host' \
-'hosts:: _hosts'
-}
-
 _loginctl_all_sessions(){_sys_all_sessions=($(loginctl list-sessions | { while 
read a b; do echo  $a; done; }) )}
 _loginctl_all_users()   {_sys_all_users=(   $(loginctl list-users| { while 
read a b; do echo  $a; done; }) )}
 _loginctl_all_seats()   {_sys_all_seats=(   $(loginctl list-seats| { while 
read a b; do echo  $a; done; }) )}
@@ -106,7 +100,7 @@ _arguments -s \
 '--kill-who=[Who to send signal to]:killwho:(main control all)' \
 {-s,--signal=}'[Which signal to send]:signal:_signals' \
 '--no-ask-password[Do not ask for system passwords]' \
-{-H,--host=}'[Show information for remote 
host]:userathost:_hosts_or_user_at_host' \
+{-H,--host=}'[Show information for remote 
host]:userathost:_sd_hosts_or_user_at_host' \
 {-P,--privileged}'[Acquire privileges before execution]' \
 '--no-pager[Do not pipe output into a pager]' \
 '*::loginctl command:_loginctl_command'
diff --git a/shell-completion/zsh/_machinectl b/shell-completion/zsh/_machinectl
index 89196a5..aa568e5 100644
--- a/shell-completion/zsh/_machinectl
+++ b/shell-completion/zsh/_machinectl
@@ -42,6 +42,6 @@ _arguments \
   '--no-ask-password[Do not ask for system passwords]' \
   '--kill-who=[Who to send signal to]:killwho:(leader all)' \
   {-s,--signal=}'[Which signal to send]:signal:_signals' \
-  {-H,--host=}'[Show information for remote 

[systemd-devel] [PATCH] [RFC] Make reboot to support additional command

2013-08-12 Thread WaLyong Cho
From: WaLyong Cho walyong@samsung.com

reboot syscall can be performed with additional argument. In some of
system, this functionality can be useful to ask next boot mode to
bootloader.
---
 src/systemctl/systemctl.c |   28 +++-
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index a635891..5b46350 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -19,6 +19,8 @@
   along with systemd; If not, see http://www.gnu.org/licenses/.
 ***/
 
+#include linux/reboot.h
+#include sys/syscall.h
 #include sys/reboot.h
 #include stdio.h
 #include getopt.h
@@ -133,6 +135,7 @@ static char *arg_user = NULL;
 static unsigned arg_lines = 10;
 static OutputMode arg_output = OUTPUT_SHORT;
 static bool arg_plain = false;
+static char *arg_reboot = NULL;
 
 static bool private_bus = false;
 
@@ -4703,7 +4706,7 @@ static int systemctl_help(void) {
 
 static int halt_help(void) {
 
-printf(%s [OPTIONS...]\n\n
+printf(%s [OPTIONS...]%s\n\n
%s the system.\n\n
 --help  Show this help\n
 --halt  Halt the machine\n
@@ -4714,6 +4717,7 @@ static int halt_help(void) {
  -d --no-wtmp   Don't write wtmp record\n
 --no-wall   Don't send wall message before 
halt/power-off/reboot\n,
program_invocation_short_name,
+   arg_action == ACTION_REBOOT   ?  command : ,
arg_action == ACTION_REBOOT   ? Reboot :
arg_action == ACTION_POWEROFF ? Power off :
Halt);
@@ -5200,9 +5204,19 @@ static int halt_parse_argv(int argc, char *argv[]) {
 }
 }
 
-if (optind  argc) {
-log_error(Too many arguments.);
-return -EINVAL;
+if (arg_action == ACTION_REBOOT) {
+/* reboot allow just one argument for his command string */
+if (optind+1 == argc)
+arg_reboot = strdup(argv[argc-1]);
+else if (optind+1  argc) {
+log_error(Too many arguments.);
+return -EINVAL;
+}
+} else {
+if (optind  argc) {
+log_error(Too many arguments.);
+return -EINVAL;
+}
 }
 
 return 1;
@@ -5949,7 +5963,11 @@ static _noreturn_ void halt_now(enum action a) {
 
 case ACTION_REBOOT:
 log_info(Rebooting.);
-reboot(RB_AUTOBOOT);
+if (arg_reboot)
+syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, 
LINUX_REBOOT_MAGIC2,
+LINUX_REBOOT_CMD_RESTART2, arg_reboot);
+else
+reboot(RB_AUTOBOOT);
 break;
 
 default:
-- 
1.7.9.5

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] systemd.unit(5): clarify the Description= contents

2013-08-12 Thread Michael Stapelberg
Hi,

Lennart, as discussed during DebConf earlier today, this patch clarifies
what should go into the Description= field. Please merge it :).

-- 
Best regards,
MichaelFrom fef7d55294b3b407eb6513a31f4087ff84a1f20e Mon Sep 17 00:00:00 2001
From: Michael Stapelberg stapelb...@debian.org
Date: Mon, 12 Aug 2013 21:56:52 +0200
Subject: [PATCH] systemd.unit(5): clarify the Description= contents

---
 man/systemd.unit.xml |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
index c6325d3..1714157 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml
@@ -359,7 +359,15 @@
 describing the unit. This is intended
 for use in UIs to show descriptive
 information along with the unit
-name./para/listitem
+name. The description should contain a name
+that means something to the end user.
+literalApache2 Web Server/literal is a good
+example. Bad examples are
+literalhigh-performance light-weight HTTP
+server/literal (too generic) or
+literalApache2/literal (too specific and
+meaningless for people who do not know
+Apache)./para/listitem
 /varlistentry
 
 varlistentry
-- 
1.7.10.4

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] brightness in tmpfiles.d

2013-08-12 Thread Christian Hesse
Hello everybody,

I have a file /etc/tmpfiles.d/brightness.conf containing this line:

w /sys/class/backlight/acpi_video0/brightness - - - - 10

This used to set the brightness on boot, but broke lately. The path is
correct, so I assume this is a race condition. Any chance to get this work
again?
-- 
main(a){char*c=/*Schoene Gruesse */B?IJj;MEH
CX:;,b;for(a/*Chris   get my mail address:*/=0;b=c[a++];)
putchar(b-1/(/*   gcc -o sig sig.c  ./sig*/b/42*2-3)*42);}


signature.asc
Description: PGP signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] brightness in tmpfiles.d

2013-08-12 Thread Mantas Mikulėnas
On Mon, Aug 12, 2013 at 11:40 PM, Christian Hesse l...@eworm.de wrote:
 Hello everybody,

 I have a file /etc/tmpfiles.d/brightness.conf containing this line:

 w /sys/class/backlight/acpi_video0/brightness - - - - 10

 This used to set the brightness on boot, but broke lately. The path is
 correct, so I assume this is a race condition. Any chance to get this work
 again?

Sure, and it involves *not* using tmpfiles.d.

I cannot know for sure, but yes, it is likely that it *is* a race
condition – tmpfiles.d being run before the relevant module gets
inserted, device gets detected, or whatever. And the usual way for
working with events like device detection is to write an udev rule
that triggers after that specific device has appeared:

ACTION==add, SUBSYSTEM==backlight,
KERNEL==acpi_video0, ATTR{brightness}=10

(I'm not 100% sure if the KERNEL match is correct. The rest should work.)

-- 
Mantas Mikulėnas graw...@gmail.com
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] brightness in tmpfiles.d

2013-08-12 Thread Kay Sievers
On Mon, Aug 12, 2013 at 11:27 PM, Mantas Mikulėnas graw...@gmail.com wrote:
 On Mon, Aug 12, 2013 at 11:40 PM, Christian Hesse l...@eworm.de wrote:
 Hello everybody,

 I have a file /etc/tmpfiles.d/brightness.conf containing this line:

 w /sys/class/backlight/acpi_video0/brightness - - - - 10

 This used to set the brightness on boot, but broke lately. The path is
 correct, so I assume this is a race condition. Any chance to get this work
 again?

 Sure, and it involves *not* using tmpfiles.d.

 I cannot know for sure, but yes, it is likely that it *is* a race
 condition – tmpfiles.d being run before the relevant module gets
 inserted, device gets detected, or whatever. And the usual way for
 working with events like device detection is to write an udev rule
 that triggers after that specific device has appeared:

 ACTION==add, SUBSYSTEM==backlight,
 KERNEL==acpi_video0, ATTR{brightness}=10

 (I'm not 100% sure if the KERNEL match is correct. The rest should work.)

Looks fine.

Remembering brightness sounds pretty useful for everyone. In the
longer run, it should probably be handled like ALSA restore for the
sound volume, with a service that writes it to /var/lib and reads it
from there ...

Kay
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] brightness in tmpfiles.d

2013-08-12 Thread Mantas Mikulėnas
On Tue, Aug 13, 2013 at 12:54 AM, Kay Sievers k...@vrfy.org wrote:
 Remembering brightness sounds pretty useful for everyone. In the
 longer run, it should probably be handled like ALSA restore for the
 sound volume, with a service that writes it to /var/lib and reads it
 from there ...

I guess this is hardware-dependent... In my case, it looks like the
opposite – the firmware /does/ remember brightness for me, but during
boot something resets it to maximum.

-- 
Mantas Mikulėnas graw...@gmail.com
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Hackfest at Linux Plumbers Conference?

2013-08-12 Thread David Strauss
Are there any plans?

-- 
David Strauss
   | da...@davidstrauss.net
   | +1 512 577 5827 [mobile]
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel