Re: [systemd-devel] machines get killed when scopes are destroyed

2013-11-18 Thread Daniel P. Berrange
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?

I don't have an answer for you, but just want to ask that you file a
bug against libvirt for this problem. This is an unintended regression
in libvirt functionality with the switch to systemd scopes.

http://libvirt.org/bugs.html

Regards,
Daniel
-- 
|: http://berrange.com  -o-http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org  -o- http://virt-manager.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org   -o-   http://live.gnome.org/gtk-vnc :|
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] French translation for systemd

2013-11-18 Thread Sylvain Plantefeve
Ok, thanks, I'll have a look at it.

BTW, while re-reading the catalog again, I found a couple of typos...

---
diff --git a/catalog/systemd-fr.catalog b/catalog/systemd-fr.catalog
index 92cc15f..dd7af91 100644
--- a/catalog/systemd-fr.catalog
+++ b/catalog/systemd-fr.catalog
@@ -128,7 +128,7 @@ Subject: Le démarrage du système est terminé
 Defined-By: systemd
 Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

-Tous les services nécéssaires au démarrage du système ont tous été lancés
+Tous les services nécessaires au démarrage du système ont tous été lancés
 avec succès. Notez que cela ne signifie pas que le système est maintenant
au
 repos, car des services peuvent encore être en train de terminer leur
 démarrage.
@@ -137,7 +137,7 @@ Le chargement du noyau a nécessité
@KERNEL_USEC@microsecondes.

 Le chargement du « RAM disk » initial a nécessité @INITRD_USEC@microsecondes.

-Le chargement de l'espace utilisateur a nécéssité
@USERSPACE_USEC@microsecondes.
+Le chargement de l'espace utilisateur a nécessité
@USERSPACE_USEC@microsecondes.

 -- 6bbd95ee977941e497c48be27c254128 fr
 Subject: Le système entre dans l'état de repos (sleep state) @SLEEP@


2013/11/17 Ronny Chevalier chevalier.ro...@gmail.com

 2013/11/17 Sylvain Plantefeve sylvain.plantef...@gmail.com:
  Thanks a lot!
 
  Sorry for the line-wraps thing, I'm new to contributing patches, and did
 not
  expect gmail to do that...
 You can use git format-patch then git send-mail to send patches, and
 avoid such issues.

 
  If you are also interested in the french translation of the journal's
  catalog, please find it for review in attachment (I can't find the damn
  setting to avoid line wrapping for now...).
 
  Regards,
 
 
 
 
 
  2013/11/16 Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl
 
  On Fri, Nov 15, 2013 at 04:02:27PM +0100, Sylvain Plantefeve wrote:
   Fixed.
  
   ---
   --- /dev/null
   +++ b/po/fr.po
   @@ -0,0 +1,397 @@
   +# French translations for systemd package
  Applied, thanks.
 
  Please note that your mailer line-wraps patches. This one was simple
  to fix, because there were only additions, but it's a problem in other
  cases.
 
  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


[systemd-devel] remove duplicate includes

2013-11-18 Thread Karel Zak
A few trivial patches... the duplications found by
https://raw.github.com/karelzak/util-linux/master/tools/checkincludes.pl

Karel

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


[systemd-devel] [PATCH 05/10] nss-myhostname: remove duplicate includes

2013-11-18 Thread Karel Zak
---
 src/nss-myhostname/netlink.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/nss-myhostname/netlink.c b/src/nss-myhostname/netlink.c
index 47a41f5..d61ecdf 100644
--- a/src/nss-myhostname/netlink.c
+++ b/src/nss-myhostname/netlink.c
@@ -31,7 +31,6 @@
 #include limits.h
 #include arpa/inet.h
 #include unistd.h
-#include inttypes.h
 #include stdlib.h
 
 #include ifconf.h
-- 
1.8.3.1

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


[systemd-devel] [PATCH 03/10] sysctl: remove duplicate includes

2013-11-18 Thread Karel Zak
---
 src/sysctl/sysctl.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c
index 67c7872..449e0ca 100644
--- a/src/sysctl/sysctl.c
+++ b/src/sysctl/sysctl.c
@@ -30,7 +30,6 @@
 #include log.h
 #include strv.h
 #include util.h
-#include strv.h
 #include hashmap.h
 #include path-util.h
 #include conf-files.h
-- 
1.8.3.1

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


[systemd-devel] [PATCH 10/10] backlight: remove duplicate includes

2013-11-18 Thread Karel Zak
---
 src/backlight/backlight.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c
index 9ec29f7..bf76703 100644
--- a/src/backlight/backlight.c
+++ b/src/backlight/backlight.c
@@ -24,7 +24,6 @@
 #include fileio.h
 #include libudev.h
 #include udev-util.h
-#include util.h
 
 static struct udev_device *find_pci_or_platform_parent(struct udev_device 
*device) {
 struct udev_device *parent;
-- 
1.8.3.1

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


[systemd-devel] [PATCH 04/10] shared: remove duplicate includes

2013-11-18 Thread Karel Zak
---
 src/shared/label.c | 1 -
 src/shared/util.c  | 1 -
 2 files changed, 2 deletions(-)

diff --git a/src/shared/label.c b/src/shared/label.c
index 5c7cc1c..4a26ba9 100644
--- a/src/shared/label.c
+++ b/src/shared/label.c
@@ -20,7 +20,6 @@
 ***/
 
 #include errno.h
-#include sys/stat.h
 #include unistd.h
 #include malloc.h
 #include sys/socket.h
diff --git a/src/shared/util.c b/src/shared/util.c
index b77d010..deb74c4 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -41,7 +41,6 @@
 #include stdarg.h
 #include sys/inotify.h
 #include sys/poll.h
-#include libgen.h
 #include ctype.h
 #include sys/prctl.h
 #include sys/utsname.h
-- 
1.8.3.1

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


[systemd-devel] [PATCH 01/10] udev: remove duplicate includes

2013-11-18 Thread Karel Zak
---
 src/udev/mtd_probe/probe_smartmedia.c | 1 -
 src/udev/v4l_id/v4l_id.c  | 4 
 2 files changed, 5 deletions(-)

diff --git a/src/udev/mtd_probe/probe_smartmedia.c 
b/src/udev/mtd_probe/probe_smartmedia.c
index feadb50..a007cce 100644
--- a/src/udev/mtd_probe/probe_smartmedia.c
+++ b/src/udev/mtd_probe/probe_smartmedia.c
@@ -26,7 +26,6 @@
 #include fcntl.h
 #include unistd.h
 #include stdint.h
-#include stdlib.h
 #include mtd_probe.h
 
 static const uint8_t cis_signature[] = {
diff --git a/src/udev/v4l_id/v4l_id.c b/src/udev/v4l_id/v4l_id.c
index 8dcb645..d5463b2 100644
--- a/src/udev/v4l_id/v4l_id.c
+++ b/src/udev/v4l_id/v4l_id.c
@@ -18,11 +18,7 @@
 #include string.h
 #include ctype.h
 #include stdlib.h
-#include stdio.h
-#include stdlib.h
-#include string.h
 #include unistd.h
-#include errno.h
 #include fcntl.h
 #include getopt.h
 #include sys/types.h
-- 
1.8.3.1

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


[systemd-devel] [PATCH 02/10] systemctl: remove duplicate includes

2013-11-18 Thread Karel Zak
---
 src/systemctl/systemctl.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 737cd67..54479db 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -65,7 +65,6 @@
 #include spawn-polkit-agent.h
 #include install.h
 #include logs-show.h
-#include path-util.h
 #include socket-util.h
 #include fileio.h
 #include bus-util.h
-- 
1.8.3.1

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


[systemd-devel] [PATCH 09/10] core: remove duplicate includes

2013-11-18 Thread Karel Zak
---
 src/core/shutdown.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index b5eb8b1..bcf2eec 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -24,7 +24,6 @@
 #include sys/reboot.h
 #include linux/reboot.h
 #include sys/wait.h
-#include sys/types.h
 #include sys/stat.h
 #include sys/mount.h
 #include sys/syscall.h
-- 
1.8.3.1

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


[systemd-devel] [PATCH 07/10] libudev: remove duplicate includes

2013-11-18 Thread Karel Zak
---
 src/libudev/libudev-device-private.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/libudev/libudev-device-private.c 
b/src/libudev/libudev-device-private.c
index cba08d2..cb4947f 100644
--- a/src/libudev/libudev-device-private.c
+++ b/src/libudev/libudev-device-private.c
@@ -24,7 +24,6 @@
 #include stdbool.h
 #include unistd.h
 #include fcntl.h
-#include string.h
 #include sys/stat.h
 
 #include libudev.h
-- 
1.8.3.1

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


[systemd-devel] [PATCH 08/10] journal: remove duplicate includes

2013-11-18 Thread Karel Zak
---
 src/journal/journalctl.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index a509104..c44be74 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -48,7 +48,6 @@
 #include fileio.h
 #include build.h
 #include pager.h
-#include logs-show.h
 #include strv.h
 #include journal-internal.h
 #include journal-def.h
-- 
1.8.3.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

2013-11-18 Thread Zbigniew Jędrzejewski-Szmek
On Mon, Nov 18, 2013 at 10:12:42AM +, Daniel P. Berrange wrote:
 I don't have an answer for you, but just want to ask that you file a
 bug against libvirt for this problem. This is an unintended regression
 in libvirt functionality with the switch to systemd scopes.

https://bugzilla.redhat.com/show_bug.cgi?id=1031696

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


[systemd-devel] [PATCH] use #pragma once instead of foo*foo define guards

2013-11-18 Thread Shawn Landden
---
 src/core/killall.h  | 5 +
 src/core/switch-root.h  | 5 +
 src/core/syscall-list.h | 5 +
 src/core/transaction.h  | 5 +
 src/login/logind-action.h   | 5 +
 src/login/logind-button.h   | 5 +
 src/login/logind-inhibit.h  | 5 +
 src/nss-myhostname/ifconf.h | 9 ++---
 src/shared/audit.h  | 5 +
 src/shared/capability.h | 5 +
 src/shared/cgroup-show.h| 5 +
 src/shared/conf-files.h | 5 +
 src/shared/hwclock.h| 5 +
 src/shared/spawn-polkit-agent.h | 5 +
 14 files changed, 15 insertions(+), 59 deletions(-)

diff --git a/src/core/killall.h b/src/core/killall.h
index d08ac14..95b110f 100644
--- a/src/core/killall.h
+++ b/src/core/killall.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef fookillallhfoo
-#define fookillallhfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -23,5 +22,3 @@
 ***/
 
 void broadcast_signal(int sig, bool wait);
-
-#endif
diff --git a/src/core/switch-root.h b/src/core/switch-root.h
index 0c4cd1e..ab493b5 100644
--- a/src/core/switch-root.h
+++ b/src/core/switch-root.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef fooswitchroothfoo
-#define fooswitchroothfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -23,5 +22,3 @@
 ***/
 
 int switch_root(const char *switch_root);
-
-#endif
diff --git a/src/core/syscall-list.h b/src/core/syscall-list.h
index 6bb4d91..37efc56 100644
--- a/src/core/syscall-list.h
+++ b/src/core/syscall-list.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef foosyscalllisthfoo
-#define foosyscalllisthfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -40,5 +39,3 @@ const char *syscall_to_name(int id);
 int syscall_from_name(const char *name);
 
 int syscall_max(void);
-
-#endif
diff --git a/src/core/transaction.h b/src/core/transaction.h
index 12f9194..b6ee237 100644
--- a/src/core/transaction.h
+++ b/src/core/transaction.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef footransactionhfoo
-#define footransactionhfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -53,5 +52,3 @@ int transaction_add_job_and_dependencies(
 int transaction_activate(Transaction *tr, Manager *m, JobMode mode, DBusError 
*e);
 int transaction_add_isolate_jobs(Transaction *tr, Manager *m);
 void transaction_abort(Transaction *tr);
-
-#endif
diff --git a/src/login/logind-action.h b/src/login/logind-action.h
index 5527136..74f7144 100644
--- a/src/login/logind-action.h
+++ b/src/login/logind-action.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef foologindactionhfoo
-#define foologindactionhfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -50,5 +49,3 @@ const char* handle_action_to_string(HandleAction h) _const_;
 HandleAction handle_action_from_string(const char *s) _pure_;
 
 int config_parse_handle_action(const char *unit, const char *filename, 
unsigned line, const char *section, const char *lvalue, int ltype, const char 
*rvalue, void *data, void *userdata);
-
-#endif
diff --git a/src/login/logind-button.h b/src/login/logind-button.h
index 83bf1fc..824106c 100644
--- a/src/login/logind-button.h
+++ b/src/login/logind-button.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef foologindbuttonhfoo
-#define foologindbuttonhfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -45,5 +44,3 @@ void button_free(Button*b);
 int button_open(Button *b);
 int button_recheck(Button *b);
 int button_set_seat(Button *b, const char *sn);
-
-#endif
diff --git a/src/login/logind-inhibit.h b/src/login/logind-inhibit.h
index ed3b2eb..da3d7e7 100644
--- a/src/login/logind-inhibit.h
+++ b/src/login/logind-inhibit.h
@@ -1,7 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef foologindinhibithfoo
-#define foologindinhibithfoo
+#pragma once
 
 /***
   This file is part of systemd.
@@ -93,5 +92,3 @@ InhibitWhat inhibit_what_from_string(const char *s);
 
 const char *inhibit_mode_to_string(InhibitMode k);
 InhibitMode inhibit_mode_from_string(const char *s);
-
-#endif
diff --git a/src/nss-myhostname/ifconf.h b/src/nss-myhostname/ifconf.h
index 2764a0a..cd598d2 100644
--- a/src/nss-myhostname/ifconf.h
+++ b/src/nss-myhostname/ifconf.h
@@ -1,9 +1,6 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef fooifconfhfoo
-#define fooifconfhfoo
-
-#include sys/socket.h
+#pragma once
 
 /***
   This file is part of systemd.
@@ -27,6 +24,7 @@
 #include inttypes.h
 #include sys/types.h
 #include assert.h
+#include sys/socket.h
 
 struct address {
 unsigned char family;
@@ -68,6 +66,3 @@ static inline int address_compare(const void *_a, const void 
*_b) {
 
 return 0;
 }
-
-
-#endif
diff --git 

Re: [systemd-devel] French translation for systemd

2013-11-18 Thread Jean-Michel Pollion
2013/11/18 Sylvain Plantefeve sylvain.plantef...@gmail.com

 Ok, thanks, I'll have a look at it.

 BTW, while re-reading the catalog again, I found a couple of typos...

 ---
 diff --git a/catalog/systemd-fr.catalog b/catalog/systemd-fr.catalog
 index 92cc15f..dd7af91 100644
 --- a/catalog/systemd-fr.catalog
 +++ b/catalog/systemd-fr.catalog
 @@ -128,7 +128,7 @@ Subject: Le démarrage du système est terminé
  Defined-By: systemd
  Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

 -Tous les services nécéssaires au démarrage du système ont tous été lancés
 +Tous les services nécessaires au démarrage du système ont tous été lancés
  avec succès. Notez que cela ne signifie pas que le système est maintenant
 au
  repos, car des services peuvent encore être en train de terminer leur
  démarrage.


That's still an incorrect sentence in French, using tous twice is wrong,
you should use either one of these instead :
- Tous les services nécessaires au démarrage du système ont été lancés...
- Les services nécessaires au démarrage du système ont tous été lancés...

Either one should be OK.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd + ExecStart + python script

2013-11-18 Thread Abdelghani Ouchabane

On 12/11/13 18:40, Zbigniew Jędrzejewski-Szmek wrote:

On Tue, Nov 12, 2013 at 06:14:30PM +0100, Abdelghani Ouchabane wrote:

On 11/11/13 17:32, Zbigniew Jędrzejewski-Szmek wrote:

On Mon, Nov 11, 2013 at 04:55:05PM +0100, Abdelghani Ouchabane wrote:

ExecStart=/usr/bin/python /opt/cyclades/bin/t_idl.pyo
|-1377 /bin/sh -c if [ ! -e
/home/x/taskconfig/screensaver ]; then /bin/mkdir -p
/home/x/taskconfig ;/bin/cp
/opt/cyclades/etc/taskconfig/screensaver
/home/x/taskconfig/screensaver ;fi ;
/bin/echo -n $BASHPID  /var/tmp/cyclades_services/IDL/pid ;
DISPLAY=:0 CYCLADES_ERR=IDL /opt/cyclades/bin/logger.sh -c
/usr/bin/python /opt/cyclades/bin/t_idl.pyo -p err -t IDL

Those two don't correspond. Either you're starting the program
directly, or through some shell scripts. It would help if you
showed the two unit files.

Zbyszek



Hallo Zbyszek,
   I modified the unit to start the main program as:

1- ExecStart=/bin/sh -c 'DISPLAY=:0 /usr/bin/python
/opt/cyclades/bin/t_idl.pyo'

Try something simpler:

Environment=DISPLAY=:0
ExecStart=/usr/bin/python /opt/cyclades/bin/t_idl.pyo

Anyway, it seems that the script either exits (maybe some error?) or
daemonizes itself.  If it's not failing to start with an error, you
probably need to change (starting from the snippet I put above) to
Type=forking, or make the script not exit.

Zbyszek

Hi Zbyszek,
  thanks a lot for your great help, the problem was in 
ezono-cyclades-t_idl.path, it contained the following:


[Unit]
Description=ezono-cyclades-t_idl Service Spool

[Path]
PathChanged=/tmp/cyclades/restart-t_idl
PathExists=/tmp/cyclades/start-ezono-cyclades-gui

[Install]
WantedBy=ezono-cyclades.target



And /tmp/cyclades/start-ezono-cyclades-gui is created during the boot 
but /tmp/cyclades/restart-t_idl is never created, this was making the 
ezono-cyclades-t_idl.service keeps restarting, after I removed 
PathChanged=/tmp/cyclades/restart-t_idl, the behavior becomes correct. 
From my understanding I can combine PathChanged  PathExists but it did 
not work for me.


Regards
Abdelghani

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


Re: [systemd-devel] systemd + ExecStart + python script

2013-11-18 Thread Zbigniew Jędrzejewski-Szmek
On Mon, Nov 18, 2013 at 05:56:47PM +0100, Abdelghani Ouchabane wrote:
 From my understanding I can combine PathChanged 
 PathExists but it did not work for me.
They must be *both* satisfied. I you want the unit to start when
*either* is satisfied, you should use trigger conditions, written
like PathExists=|

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


[systemd-devel] Patch to remap some hotkeys in Toshiba Satellite U940

2013-11-18 Thread Jose Ignacio Naranjo
Hi,

I don't know if this is the right place to send this small patch. In case
it is not the place, sorry for the noise (... and do you know the right
place :)? Thanks).

It is just just some remapping in hwdb for a few hotkeys. If you need any
rework in the patch or whatever, please tell me.

There are also two keys not working (not included in the patch):
 KEYBOARD_KEY_158=wlan
 KEYBOARD_KEY_157=mute

udevadm test-builtin says this:

keyboard: mapping scan code 343 (0x157) to key code 113 (0x71)
Error calling EVIOCSKEYCODE: Invalid argument
keyboard: mapping scan code 344 (0x158) to key code 238 (0xee)
Error calling EVIOCSKEYCODE: Invalid argument

I guess it is a problem because of the toshiba_acpi driver has no scancode
for 157/158. I will take a look on that in order to create also a patch
there if needed.

Regards,
JI
From 35a177a0197020ca9d18d42c66a61a71828aac12 Mon Sep 17 00:00:00 2001
From: Jose Ignacio Naranjo joseignacio.nara...@gmail.com
Date: Sun, 17 Nov 2013 21:11:34 +0100
Subject: [PATCH] hwdb: Support for Toshiba Satellite U940 hotkeys

---
 hwdb/60-keyboard.hwdb | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb
index 995986d..72cb993 100644
--- a/hwdb/60-keyboard.hwdb
+++ b/hwdb/60-keyboard.hwdb
@@ -1034,6 +1034,13 @@ keyboard:dmi:bvn*:bvr*:bd*:svnTOSHIBA*:pnSatellite*P75-A:pvr*
  KEYBOARD_KEY_a9=switchvideomode# switch display outputs
  KEYBOARD_KEY_d4=wlan   # RF Switch Off
 
+# Satellite U940
+keyboard:name:Toshiba*input*device:dmi:bvn*:bvr*:bd*:svnTOSHIBA*:pnSATELLITEU940:pvr*
+ KEYBOARD_KEY_13c=brightnessdown
+ KEYBOARD_KEY_13d=brightnessup
+ KEYBOARD_KEY_13e=switchvideomode
+ KEYBOARD_KEY_13f=f21   # Touchpad toggle
+
 ###
 # VIA
 ###
-- 
1.8.3.2

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


[systemd-devel] [PATCH] hwdb: Support for Toshiba Satellite U940 hotkeys

2013-11-18 Thread Jose Ignacio Naranjo
---
 hwdb/60-keyboard.hwdb | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb
index 995986d..72cb993 100644
--- a/hwdb/60-keyboard.hwdb
+++ b/hwdb/60-keyboard.hwdb
@@ -1034,6 +1034,13 @@ 
keyboard:dmi:bvn*:bvr*:bd*:svnTOSHIBA*:pnSatellite*P75-A:pvr*
  KEYBOARD_KEY_a9=switchvideomode# switch display 
outputs
  KEYBOARD_KEY_d4=wlan   # RF Switch Off
 
+# Satellite U940
+keyboard:name:Toshiba*input*device:dmi:bvn*:bvr*:bd*:svnTOSHIBA*:pnSATELLITEU940:pvr*
+ KEYBOARD_KEY_13c=brightnessdown
+ KEYBOARD_KEY_13d=brightnessup
+ KEYBOARD_KEY_13e=switchvideomode
+ KEYBOARD_KEY_13f=f21   # Touchpad toggle
+
 ###
 # VIA
 ###
-- 
1.8.3.2

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


Re: [systemd-devel] pam: Don't use loginuid [was: Re: Fix PAM module to not clobber XDG_RUNTIME_DIR with su]

2013-11-18 Thread Michael Stapelberg
Hi Martin,

Martin Pitt martin.p...@ubuntu.com writes:

 Martin Pitt [2013-11-14 17:53 +0100]:
 So option 1 is to update the patch to not rely on uid, but instead
 always get it from PAM.

 I went through all instances of using the uid, username, or pw, and I
 cannot find any place in the PAM module where we would actually want
 the originating user name, so I retract this.

 Option 2 is to never read it from loginuid, as that's indeed not
 what one should be concerned about in a PAM module.
 Attached patch is doing option 2. 

 ... and hence I'm convinced that this is the right thing to do.
Thanks for your patch.

This is a rather pressing issue for us (it breaks GDM logins in some
cases), and we’d like to fix it by cherry-picking a patch that was
merged upstream.

Therefore, I’d like to ask people with a commit bit (Colin?) to please
have another look and merge the patch unless something is still wrong
with it :). Thanks!

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


Re: [systemd-devel] [PATCH] selinux: fix selinux check for transient units

2013-11-18 Thread Daniel J Walsh
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 11/16/2013 08:10 AM, Lennart Poettering wrote:
 On Thu, 14.11.13 15:43, Daniel J Walsh (dwa...@redhat.com) wrote:
 
 
 -BEGIN PGP SIGNED MESSAGE- Hash: SHA1
 
 On 11/14/2013 12:50 PM, Harald Hoyer wrote:
 On 11/05/2013 11:12 PM, Daniel J Walsh wrote:
 On 11/05/2013 12:22 PM, Lennart Poettering wrote:
 
 Ok lets add a check that checks for start on a service labeled with
 the remote process label, then we can add rules like
 
 allow systemd_logind_t self:service start
 
 Or we can make it simpler and have the local end check against the
 init_t process.
 
 allow systemd_logind_t init_t:service start;
 
 Which is probably a better solution, if we have no way of
 differentiating the services.
 
 Machineid usually runs as init_t now.
 
 systemd-run runs as the label of the process that executes it,
 Usually unconfined_t, and sysadm_t.
 
 
 has any solution been found for this?
 
 seems like one is needed for 
 https://bugzilla.redhat.com/show_bug.cgi?id=1008864
 
 
 I guess the question I have is do you expect a patch from me?  Or are you
 guys working on it?  I would go with the checking based on process
 label.
 
 I am hoping for a patch for this!
 
 Thanks,
 
 Lennart
 

This patch adds a new call for SELINUX_SNAPSHOT_ACCESS_CHECK, because I
believe this error will happen when a snapshot is created.  Also now pass in
system
when doing a system check, if it is doing a service check and does not pass in
a unit file we will default the target to the label that systemd is running 
with.

How does this patch look?

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlKKhFgACgkQrlYvE4MpobNd1ACbBrwtl5T/CEhCttI9QZ3IZbes
k8UAoODr9J6D0CoyZfpdpvILU7QpxOD2
=0zYK
-END PGP SIGNATURE-
From d8e5784f64a68580f136b99cd5e3fd173586312f Mon Sep 17 00:00:00 2001
From: Dan Walsh dwa...@redhat.com
Date: Mon, 18 Nov 2013 15:52:37 -0500
Subject: [PATCH] Fix SELinux check for snapshot creation.

SELinux does not have a path to check for a snapshot servic creation.
This ends up giving us a bogus check.

On snapshot creation we should check if the remote process type, has the ability to start a service with the type that systemd is running with.
---
 src/core/dbus-manager.c   |  2 +-
 src/core/selinux-access.c |  9 +
 src/core/selinux-access.h | 12 
 3 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index 747bcfc..a60a568 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -1112,7 +1112,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
 dbus_bool_t cleanup;
 Snapshot *s;
 
-SELINUX_ACCESS_CHECK(connection, message, start);
+SELINUX_SNAPSHOT_ACCESS_CHECK(connection, message, start);
 
 if (!dbus_message_get_args(
 message,
diff --git a/src/core/selinux-access.c b/src/core/selinux-access.c
index c7e951c..af34b9e 100644
--- a/src/core/selinux-access.c
+++ b/src/core/selinux-access.c
@@ -374,8 +374,9 @@ int selinux_access_check(
 goto finish;
 }
 
-if (path) {
-tclass = service;
+
+tclass = service;
+if (path  strneq(path,system, strlen(system))) {
 /* get the file context of the unit file */
 r = getfilecon(path, fcon);
 if (r  0) {
@@ -384,9 +385,9 @@ int selinux_access_check(
 log_error(Failed to get security context on %s: %m,path);
 goto finish;
 }
-
 } else {
-tclass = system;
+if (path)
+tclass = system;
 r = getcon(fcon);
 if (r  0) {
 dbus_set_error(error, DBUS_ERROR_ACCESS_DENIED, Failed to get current context.);
diff --git a/src/core/selinux-access.h b/src/core/selinux-access.h
index 2d7ac64..53bb9b0 100644
--- a/src/core/selinux-access.h
+++ b/src/core/selinux-access.h
@@ -36,6 +36,18 @@ int selinux_access_check(DBusConnection *connection, DBusMessage *message, const
 DBusConnection *_c = (connection);  \
 DBusMessage *_m = (message);\
 dbus_error_init(_error);   \
+_r = selinux_access_check(_c, _m, system, (permission), _error); \
+if (_r  0) \
+return bus_send_error_reply(_c, _m, _error, _r); \
+} while (false)
+
+#define SELINUX_SNAPSHOT_ACCESS_CHECK(connection, message, permission) \
+do {\
+DBusError _error;

Re: [systemd-devel] [PATCH] selinux: fix selinux check for transient units

2013-11-18 Thread Michal Sekletar
On Mon, Nov 18, 2013 at 04:19:20PM -0500, Daniel J Walsh wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 On 11/16/2013 08:10 AM, Lennart Poettering wrote:
  On Thu, 14.11.13 15:43, Daniel J Walsh (dwa...@redhat.com) wrote:
  
  
  -BEGIN PGP SIGNED MESSAGE- Hash: SHA1
  
  On 11/14/2013 12:50 PM, Harald Hoyer wrote:
  On 11/05/2013 11:12 PM, Daniel J Walsh wrote:
  On 11/05/2013 12:22 PM, Lennart Poettering wrote:
  
  Ok lets add a check that checks for start on a service labeled with
  the remote process label, then we can add rules like
  
  allow systemd_logind_t self:service start
  
  Or we can make it simpler and have the local end check against the
  init_t process.
  
  allow systemd_logind_t init_t:service start;
  
  Which is probably a better solution, if we have no way of
  differentiating the services.
  
  Machineid usually runs as init_t now.
  
  systemd-run runs as the label of the process that executes it,
  Usually unconfined_t, and sysadm_t.
  
  
  has any solution been found for this?
  
  seems like one is needed for 
  https://bugzilla.redhat.com/show_bug.cgi?id=1008864
  
  
  I guess the question I have is do you expect a patch from me?  Or are you
  guys working on it?  I would go with the checking based on process
  label.
  
  I am hoping for a patch for this!
  
  Thanks,
  
  Lennart
  
 
 This patch adds a new call for SELINUX_SNAPSHOT_ACCESS_CHECK, because I
 believe this error will happen when a snapshot is created.  Also now pass in
 system
 when doing a system check, if it is doing a service check and does not pass in
 a unit file we will default the target to the label that systemd is running
 with.

Hi,

Maybe I am missing something but isn't this about transient units in general,
i.e. what about StartTransient()? What is going to change in this case after 
applying
this patch? tclass will be system since in SELINUX_ACCESS_CHECK you now pass
system as path and you will set tclass in else branch to system which is
afaik same as before.

On the side note, you forgot to define SELINUX_SNAPSHOT_ACCESS_CHECK as do {}
while (false) in case if we don't HAVE_SELINUX.

It might be the case that I completely misunderstood what's this about, in such
case ignore this email.

Michal

 
 How does this patch look?
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.15 (GNU/Linux)
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
 
 iEYEARECAAYFAlKKhFgACgkQrlYvE4MpobNd1ACbBrwtl5T/CEhCttI9QZ3IZbes
 k8UAoODr9J6D0CoyZfpdpvILU7QpxOD2
 =0zYK
 -END PGP SIGNATURE-

 From d8e5784f64a68580f136b99cd5e3fd173586312f Mon Sep 17 00:00:00 2001
 From: Dan Walsh dwa...@redhat.com
 Date: Mon, 18 Nov 2013 15:52:37 -0500
 Subject: [PATCH] Fix SELinux check for snapshot creation.
 
 SELinux does not have a path to check for a snapshot servic creation.
 This ends up giving us a bogus check.
 
 On snapshot creation we should check if the remote process type, has the 
 ability to start a service with the type that systemd is running with.
 ---
  src/core/dbus-manager.c   |  2 +-
  src/core/selinux-access.c |  9 +
  src/core/selinux-access.h | 12 
  3 files changed, 18 insertions(+), 5 deletions(-)
 
 diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
 index 747bcfc..a60a568 100644
 --- a/src/core/dbus-manager.c
 +++ b/src/core/dbus-manager.c
 @@ -1112,7 +1112,7 @@ static DBusHandlerResult 
 bus_manager_message_handler(DBusConnection *connection,
  dbus_bool_t cleanup;
  Snapshot *s;
  
 -SELINUX_ACCESS_CHECK(connection, message, start);
 +SELINUX_SNAPSHOT_ACCESS_CHECK(connection, message, start);
  
  if (!dbus_message_get_args(
  message,
 diff --git a/src/core/selinux-access.c b/src/core/selinux-access.c
 index c7e951c..af34b9e 100644
 --- a/src/core/selinux-access.c
 +++ b/src/core/selinux-access.c
 @@ -374,8 +374,9 @@ int selinux_access_check(
  goto finish;
  }
  
 -if (path) {
 -tclass = service;
 +
 +tclass = service;
 +if (path  strneq(path,system, strlen(system))) {
  /* get the file context of the unit file */
  r = getfilecon(path, fcon);
  if (r  0) {
 @@ -384,9 +385,9 @@ int selinux_access_check(
  log_error(Failed to get security context on %s: 
 %m,path);
  goto finish;
  }
 -
  } else {
 -tclass = system;
 +if (path)
 +tclass = system;
  r = getcon(fcon);
  if (r  0) {
  dbus_set_error(error, DBUS_ERROR_ACCESS_DENIED, 
 Failed to get current context.);
 diff --git a/src/core/selinux-access.h b/src/core/selinux-access.h
 index 2d7ac64..53bb9b0 100644
 --- a/src/core/selinux-access.h
 +++ 

Re: [systemd-devel] pam: Don't use loginuid [was: Re: Fix PAM module to not clobber XDG_RUNTIME_DIR with su]

2013-11-18 Thread Colin Walters
Hi,

On Mon, 2013-11-18 at 21:59 +0100, Michael Stapelberg wrote:

 Therefore, I’d like to ask people with a commit bit (Colin?) to please
 have another look and merge the patch unless something is still wrong
 with it :). Thanks!

This is on my radar; the patch wasn't working for me but I haven't had
time to add debug prints and figure out whether it's my
(gnome-continuous) side or something else.  Give me a day or two.

Just to follow up though on the initial objection here:
https://bugzilla.redhat.com/show_bug.cgi?id=753882#c29

What I mainly care about is pkexec:
https://bugzilla.redhat.com/show_bug.cgi?id=753882#c51

And that's what I'm testing - with Martin's patch in the loop I was
still getting XDG_DATA_DIR for uid 1000, I'll try to debug soon.


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


Re: [systemd-devel] [PATCH] use #pragma once instead of foo*foo define guards

2013-11-18 Thread Zbigniew Jędrzejewski-Szmek
On Mon, Nov 18, 2013 at 07:58:43AM -0800, Shawn Landden wrote:
 ---
  src/core/killall.h  | 5 +
  src/core/switch-root.h  | 5 +
  src/core/syscall-list.h | 5 +
  src/core/transaction.h  | 5 +
  src/login/logind-action.h   | 5 +
  src/login/logind-button.h   | 5 +
  src/login/logind-inhibit.h  | 5 +
  src/nss-myhostname/ifconf.h | 9 ++---
  src/shared/audit.h  | 5 +
  src/shared/capability.h | 5 +
  src/shared/cgroup-show.h| 5 +
  src/shared/conf-files.h | 5 +
  src/shared/hwclock.h| 5 +
  src/shared/spawn-polkit-agent.h | 5 +
  14 files changed, 15 insertions(+), 59 deletions(-)
Incredible how they all slipped through the cracks. Applied.

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


Re: [systemd-devel] remove duplicate includes

2013-11-18 Thread Zbigniew Jędrzejewski-Szmek
On Mon, Nov 18, 2013 at 02:48:14PM +0100, Karel Zak wrote:
 A few trivial patches... the duplications found by
 https://raw.github.com/karelzak/util-linux/master/tools/checkincludes.pl
Wow. Applied in one big fell swoop.

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


Re: [systemd-devel] [PATCH 5/7] libsystemd-bus: add sd_bus_get_selinux_ctx() and sd_bus_get_audit_session_data()

2013-11-18 Thread Zbigniew Jędrzejewski-Szmek
On Fri, Nov 15, 2013 at 07:32:21PM +0100, Daniel Mack wrote:
 Implementations for both org.freedesktop.DBus and kdbus are available
 ---
  src/libsystemd-bus/bus-control.c  | 116 
 ++
  src/libsystemd-bus/libsystemd-bus.sym |   2 +
  src/systemd/sd-bus.h  |   2 +
  3 files changed, 120 insertions(+)
 
 diff --git a/src/libsystemd-bus/bus-control.c 
 b/src/libsystemd-bus/bus-control.c
 index 28adebd..55912c8 100644
 --- a/src/libsystemd-bus/bus-control.c
 +++ b/src/libsystemd-bus/bus-control.c
 @@ -434,6 +434,122 @@ _public_ int sd_bus_get_owner_pid(sd_bus *bus, const 
 char *name, pid_t *pid) {
  return 0;
  }
  
 +_public_ int sd_bus_get_selinux_ctx(sd_bus *bus, const char *name, const 
 void **ctx, size_t *sz) {

Shouldn't this be security_context_t **ctx or some other type?
And similar for sd_bus_get_audit_session_data?

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


Re: [systemd-devel] [PATCH 7/7] systemd-stdio-bridge: make it socket-activatable and usable as kdbus bridge

2013-11-18 Thread Zbigniew Jędrzejewski-Szmek
On Fri, Nov 15, 2013 at 07:32:23PM +0100, Daniel Mack wrote:
 Augment systemd-stdio-bridge a bit to make it a 1:1 bridge from legacy
 DBus clients to kdbus. In particular,
 
  * allow setting the bus path of the upstream bus as command line
argument
  * use sd_listen_fds() for systemd's socket activation
  * omit calling sd_bus_negotiate_fds() when upstream bus is kdbus
  * reply to bus send errors with proper dbus error messages
  * treat -ECONNRESET as expected end-of-connection condition
 ---
  src/stdio-bridge/stdio-bridge.c | 116 
 +---
  1 file changed, 98 insertions(+), 18 deletions(-)
 
 diff --git a/src/stdio-bridge/stdio-bridge.c b/src/stdio-bridge/stdio-bridge.c
 index 07218e9..f16a146 100644
 --- a/src/stdio-bridge/stdio-bridge.c
 +++ b/src/stdio-bridge/stdio-bridge.c
 @@ -28,6 +28,7 @@
  #include errno.h
  #include sys/poll.h
  #include stddef.h
 +#include getopt.h
  
  #include log.h
  #include util.h
 @@ -37,25 +38,99 @@
  #include bus-internal.h
  #include bus-message.h
  #include bus-util.h
 +#include build.h
 +
 +const char *arg_bus_path = unix:path=/run/dbus/system_bus_socket;
 +
 +static int help(void) {
 +
 +printf(%s [OPTIONS...]\n\n
 +   Query or change system hostname.\n\n
 + -h --help  Show this help\n
 +--version   Show package version\n
 +--bus-path  Path to the kernel bus (default: 
 %s)\n,
 +   program_invocation_short_name, arg_bus_path);
This will give bogus information if --bus-path xxx --help is used.

 +
 +return 0;
 +}
 +
 +static int parse_argv(int argc, char *argv[]) {
 +
 +enum {
 +ARG_VERSION = 0x100,
 +};
 +
 +static const struct option options[] = {
 +{ help,no_argument,   NULL, 'h' },
 +{ bus-path,required_argument, NULL, 'p' },
 +{ NULL,  0, NULL, 0   }
 +};
 +
 +int c;
 +
 +assert(argc = 0);
 +assert(argv);
 +
 +while ((c = getopt_long(argc, argv, hsup:, options, NULL)) = 0) {
 +
 +switch (c) {
 +
 +case 'h':
 +help();
 +return 0;
 +
 +case ARG_VERSION:
 +puts(PACKAGE_STRING);
 +puts(SYSTEMD_FEATURES);
 +return 0;
 +
 +case '?':
 +return -EINVAL;
 +
 +case 'p':
 +arg_bus_path = optarg;
 +break;
 +
 +default:
 +log_error(Unknown option code %c, c);
 +return -EINVAL;
 +}
 +}
 +
 +return 1;
 +}
  
  int main(int argc, char *argv[]) {
  _cleanup_bus_unref_ sd_bus *a = NULL, *b = NULL;
  sd_id128_t server_id;
  bool is_unix;
 -int r;
 -
 -if (argc  1) {
 -log_error(This program takes no argument.);
 -return EXIT_FAILURE;
 -}
 +int r, in_fd, out_fd;
  
  log_set_target(LOG_TARGET_JOURNAL_OR_KMSG);
  log_parse_environment();
  log_open();
  
 +r = parse_argv(argc, argv);
 +if (r = 0)
 +goto finish;
 +
 +r = sd_listen_fds(0);
 +switch (r) {
 +case 0:
 +in_fd = STDIN_FILENO;
 +out_fd = STDOUT_FILENO;
 +break;
 +case 1:
 +in_fd = SD_LISTEN_FDS_START;
 +out_fd = SD_LISTEN_FDS_START;
 +break;
 +default:
 +goto finish;
 +}
We usually use if() cases for those things. And indeed, a switch
here won't work, because r  1 must be treated as an error condtion
too.

 +
  is_unix =
 -sd_is_socket(STDIN_FILENO, AF_UNIX, 0, 0)  0 
 -sd_is_socket(STDOUT_FILENO, AF_UNIX, 0, 0)  0;
 +sd_is_socket(in_fd, AF_UNIX, 0, 0)  0 
 +sd_is_socket(out_fd, AF_UNIX, 0, 0)  0;
  
  r = sd_bus_new(a);
  if (r  0) {
 @@ -63,16 +138,18 @@ int main(int argc, char *argv[]) {
  goto finish;
  }
  
 -r = sd_bus_set_address(a, unix:path=/run/dbus/system_bus_socket);
 +r = sd_bus_set_address(a, arg_bus_path);
  if (r  0) {
  log_error(Failed to set address to connect to: %s, 
 strerror(-r));
  goto finish;
  }
  
 -r = sd_bus_negotiate_fds(a, is_unix);
 -if (r  0) {
 -log_error(Failed to set FD negotiation: %s, strerror(-r));
 -goto finish;
 +if (!startswith(arg_bus_path, kernel:)) {
 +r = sd_bus_negotiate_fds(a, is_unix);
 +if (r  0) {
 +  

Re: [systemd-devel] Need help with a systemd/mdadm interaction.

2013-11-18 Thread NeilBrown
On Thu, 14 Nov 2013 11:23:30 +0600 Alexander E. Patrakov
patra...@gmail.com wrote:

 NeilBrown пишет:
  On Wed, 13 Nov 2013 22:11:27 +0600 Alexander E. Patrakov
  patra...@gmail.com wrote:
 
  2013/11/13 NeilBrown ne...@suse.de:
  On Tue, 12 Nov 2013 19:01:49 +0400 Andrey Borzenkov arvidj...@gmail.com
  wrote:
 
  Something like
 
  mdadm-last-resort@.timer
 
  [Timer]
  OnCalendar=+5s
 
  mdadm-last-resort@.service
 
  [Service]
  Type=oneshot
  ExecStart=/sbin/mdadm -IRs %n
 
  udev rule
 
  ... SYSTEMD_WANTS=mdadm-last-resort@$ENV{SOMETHING_UNIQUE}.timer
 
  Thanks.  This certainly looks interesting and might be part of a solution.
  However it gets the timeout test backwards.
 
  I don't want to set the timeout when the array starts to appear.  I want 
  to
  set the time out when someone wants to use the array.
  If no-one is waiting for the array device, then there is no point forcing 
  it.
 
  That's why I want to plug into the timeout that systemd already has.
 
  Maybe that requirement isn't really necessary though.  I'll experiment 
  with
  your approach.
  It is useless to even try to plug into the existing systemd timeout,
  for a very simple reason. in the setups where your RAID array is not
  on the top of the storage device hierarchy, systemd does not know that
  it wants your RAID array to appear.
 
  So the statement If no-one is waiting for the array device, then
  there is no point forcing it is false, because there is no way to
  know that no-one is waiting.
 
  useless seems a bit harsh.  not-optimal may be true.
 
  If systemd was waiting for a device, then it is clear that something was
  waiting for something.  In this case it might be justified to activate as
  much as possible in the hope that the important things will get activated.
  This is what mdadm -IRs does.  It activates all arrays that are still
  inactive but have enough devices to become active (though degraded).  It
  isn't selective.
  If they are deep in some hierarchy, then udev will pull it all together and
  the root device will appear.
 
  If systemd is not waiting for a device, then there is no justification for
  prematurely starting degraded arrays.
 
 
  Maybe I could get emergency.service to run mdadm -IRs and if that actually
  started anything, then to somehow restart local-fs.target.  Might that be
  possible?
 
 If this is the way forward, then we, obviously, should think about a 
 general mechanism that is useful not only for mdadm, but also to other 
 layered storage implementations such as dm-raid, or maybe multi-device 
 btrfs, and that is useful if more than one of these technologies are 
 used on top of each other. This by necessity leads to multiple emergency 
 missing-device handlers. And then a question immediately appears, in 
 which order the emergency handlers should be tried, because all that is 
 known at the time of emergency is that some device listed in /etc/fstab 
 is missing. I suspect that the answer is in arbitrary order or even 
 in parallel, but then there is a chance that one run of all of them 
 will not be enough.
 
 This is not a criticism, just something to be fully thought out before 
 starting an implementation.
 

Good points.
However dmraid doesn't have very good support for RAID arrays that actually
have redundancy.  It is fine for RAID0 but only really supports RAID1 in ddf
and Intel's IMSM and mdadm has better support for those.  So dmraid doesn't
really figure much here.

And I suspect that btrfs would end up being a very different situation
because it vertically integrates the filesystem with the RAID layer.


My ideal solution would be for mdadm to assemble a degraded array as soon as
enough devices are available, but mark it soft-read-only.  When all the
expected disks arrive it would switch to read-write.

systemd would see this soft-read-only state and wait a bit longer for it to
become read-write.  If that didn't happen in time, it would force it to be
read-write.

Every stacked device would need to understand this soft-read-only state and
would set itself to soft-read-only if any component was soft-read-only, or
was missing.  It would notice changes in component devices and propagate them
up.

When the top device was forced to read-write, this would propagate all the
way down.

This would avoid the guess work an emergency catch-all ugliness and yield a
fairly clean and predictable result.

If anything tried to write to a soft-read-only device, that would have the
same effect as forcing to read-write.


This way the whole storage stack would be plumbed at the earliest possible
moment, but would not generate any writes.  When systemd discovers the
device, if it notices that it is soft-read-only, it could then wait a
timeout before forcing the device to read-write.  That would propagate down
the stack forcibly activating any degraded arrays.

That would require a fair bit of plumbing that but I think it might be worth
it as it provides a fairly general solution.

Re: [systemd-devel] pam: Don't use loginuid [was: Re: Fix PAM module to not clobber XDG_RUNTIME_DIR with su]

2013-11-18 Thread Martin Pitt
Hello Colin,

Colin Walters [2013-11-18 19:35 -0500]:
 This is on my radar; the patch wasn't working for me but I haven't had
 time to add debug prints and figure out whether it's my
 (gnome-continuous) side or something else.  Give me a day or two.

Did you just try the original patch that I sent to RHBZ? As I found
out with the other Colin, this actually needs two patches. One is
the check runtime dir ownership one which I sent to RHBZ (in
slightly different form), the final one is

  http://lists.freedesktop.org/archives/systemd-devel/2013-November/014392.html

and second, dropping the usage of loginuid, which is

  http://lists.freedesktop.org/archives/systemd-devel/2013-November/014390.html

Colin Guthrie confirmed that this fixed things for him. Can you check
with these two, or confirm that even with these two you still get the
wrong runtime dir in pkexec?

Thanks,

Martin

-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] cgroups: Cache controller masks and optimize queues.

2013-11-18 Thread David Timothy Strauss
I'm pretty confident in the accuracy of the controller mask
aggregation, especially given the new unit test. Here are the main
review questions.

Is it okay to couple realizing the cgroups and applying the attributes
the way the patch does? Before, we were often applying the attributes
for all of a unit's siblings (read: other units in the same slice). I
believe these should never change as long as the controller mask is
the same as what's been realized already. Perhaps the old
implementation was done to avoid re-computation of the target masks
(which is no longer required).

Is it okay to skip realization and attribute setting for
inactive/failed units? If they do start, we will set the attributes at
that time with this patch. If they're not running, giving them CPU and
Block IO weights doesn't seem to have any worthwhile effect. Am I
ignoring something about, say, CPU accounting (which I don't use
myself)?

Also, hat tip to my coworker Kyle Ibrahim for the original idea of not
queuing inactive and failed units.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Patch to remap some hotkeys in Toshiba Satellite U940

2013-11-18 Thread Martin Pitt
Hello Jose,

Jose Ignacio Naranjo [2013-11-18 19:30 +0100]:
 I don't know if this is the right place to send this small patch.

It is.

 It is just just some remapping in hwdb for a few hotkeys. If you need any
 rework in the patch or whatever, please tell me.

Looks good, thank you! Applied with some changelog standardization:
http://cgit.freedesktop.org/systemd/systemd/commit/?id=bc9cdba

 udevadm test-builtin says this:
 
 keyboard: mapping scan code 343 (0x157) to key code 113 (0x71)
 Error calling EVIOCSKEYCODE: Invalid argument
 keyboard: mapping scan code 344 (0x158) to key code 238 (0xee)
 Error calling EVIOCSKEYCODE: Invalid argument

Hm, I don't see these scan codes in the keymaps. Is that from some
local hwdb file of your's?

Thanks!

Martin
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel