[systemd-devel] [PATCH] fix spell

2014-12-30 Thread Susant Sahani
---
 man/sd_event_add_child.xml  | 2 +-
 man/sd_event_add_signal.xml | 2 +-
 man/systemctl.xml   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/man/sd_event_add_child.xml b/man/sd_event_add_child.xml
index 9d943f8..7a84fce 100644
--- a/man/sd_event_add_child.xml
+++ b/man/sd_event_add_child.xml
@@ -100,7 +100,7 @@ along with systemd; If not, see 
http://www.gnu.org/licenses/.
 being stopped by a signal), and constantWCONTINUED/constant
 (watch for the child being resumed by a signal). See
 
citerefentryrefentrytitlewaitid/refentrytitlemanvolnum2/manvolnum/citerefentry
-for futher information./para
+for further information./para
 
 paraOnly a single handler may be installed for a specific
 child. The handler is enabled
diff --git a/man/sd_event_add_signal.xml b/man/sd_event_add_signal.xml
index f39751d..0299aa5 100644
--- a/man/sd_event_add_signal.xml
+++ b/man/sd_event_add_signal.xml
@@ -95,7 +95,7 @@ along with systemd; If not, see 
http://www.gnu.org/licenses/.
 structnameconst struct signalfd_siginfo/structname containing
 the information about the received signal. See
 
citerefentryrefentrytitlesignalfd/refentrytitlemanvolnum2/manvolnum/citerefentry
-for futher information./para
+for further information./para
 
 paraOnly a single handler may be installed for a specific
 signal. The signal will be unblocked, and must be
diff --git a/man/systemctl.xml b/man/systemctl.xml
index d1991e0..3ac6f62 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -173,7 +173,7 @@ along with systemd; If not, see 
http://www.gnu.org/licenses/.
   paraNote that any varnameAfter=/varname dependency is
   automatically mirrored to create a
   varnameBefore=/varname dependency. Temporal dependencies
-  may be specified explictly, but are also created implicitly
+  may be specified explicitly, but are also created implicitly
   for units which are varnameWantedBy=/varname targets
   (see
   
citerefentryrefentrytitlesystemd.target/refentrytitlemanvolnum5/manvolnum/citerefentry),
-- 
2.1.0

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


[systemd-devel] Small fixes to accelerometer

2014-12-30 Thread Robert Milasan
As in the subject, check attached patch.

Found 2 problems:

1. -x option not in use, so we should just drop it from the code
2. we support long and short options, but we advertise only long ones.


-- 
Robert Milasan

L3 Support Engineer
SUSE Linux (http://www.suse.com)
email: rmila...@suse.com
GPG fingerprint: B6FE F4A8 0FA3 3040 3402  6FE7 2F64 167C 1909 6D1A
From 7aaa2c1b6b6a6d0ef391610e932d6eff010dea41 Mon Sep 17 00:00:00 2001
From: Robert Milasan rmila...@suse.com
Date: Tue, 30 Dec 2014 09:20:42 +0100
Subject: [PATCH] accelerometer: drop unused -x option, display short options
 too.

---
 src/udev/accelerometer/accelerometer.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/udev/accelerometer/accelerometer.c b/src/udev/accelerometer/accelerometer.c
index dd4b7dc..9c13d97 100644
--- a/src/udev/accelerometer/accelerometer.c
+++ b/src/udev/accelerometer/accelerometer.c
@@ -198,8 +198,8 @@ static void test_orientation(struct udev *udev,
 static void help(void)
 {
 printf(Usage: accelerometer [options] device path\n
- --debug debug to stderr\n
- --help  print this help text\n\n);
+ -d,--debug debug to stderr\n
+ -h,--help  print this help text\n\n);
 }
 
 int main (int argc, char** argv)
@@ -229,7 +229,7 @@ int main (int argc, char** argv)
 while (1) {
 int option;
 
-option = getopt_long(argc, argv, dxh, options, NULL);
+option = getopt_long(argc, argv, dh, options, NULL);
 if (option == -1)
 break;
 
-- 
1.8.4.5

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


Re: [systemd-devel] [RFC] bus: add sd_bus_emit_object_{added, removed}()

2014-12-30 Thread David Herrmann
Hi

On Tue, Feb 18, 2014 at 12:02 AM, David Herrmann dh.herrm...@gmail.com wrote:
 The ObjectManager dbus interface provides an InterfacesAdded signal to
 notify others about new interfaces that are added to an object. The same
 signal is also used to advertise new objects (by adding the first
 interface to a given object path) and delete them.

 However, our internal helpers sd_bus_emit_interfaces_{added,removed}()
 cannot properly deal with built-in interfaces like DBus.Properties as
 there's no vtable for it. Therefore, to avoid callers to track these
 internal interfaces, we provide two separate helpers which explicitly add
 these interfaces to the signal.

 sd_bus_emit_object_added() traverses the list of all vtables and fallback
 vtables (making sure a fallback never overwrites a real vtable!) and also
 adds built-in interfaces.

 sd_bus_emit_object_removed(): WIP
 ---
 Hi

 This is untested and I just wanted to get some feedback whether that's the way
 to go. Given the previous discussion we decided on two new entry-points to add
 and remove objects. For convenience, I now tried to omit any char 
 **interfaces
 argument to object_added() and just try to figure them out on my own.

 However, on object_removed() I cannot do that as node_vtable_get_userdata() is
 very likely to return 0 for all these objects. So there is no way to figure
 out which interfaces actually existed on that thing. We would require users to
 call it *before* destroying/unlinking the actual object. I don't know whether
 that's ok to assume?

 If not, we can just add a char **interfaces argument, but then it would 
 differ
 from object_added().. Not sure what sounds better..

 Cheers
 David

  src/libsystemd/sd-bus/bus-objects.c | 210 
 
  src/systemd/sd-bus.h|   2 +
  2 files changed, 212 insertions(+)

After almost 1 year of niche existence I finally went ahead and
re-implemented this. Review is welcome!

Pushed.

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


Re: [systemd-devel] [PATCH 1/2] typofixes - https://github.com/vlajos/misspell_fixer

2014-12-30 Thread Veres Lajos
Hi,

I reviewed it one time, but it seems I wasn't enough accurate...
Should I change the patch and resend it?

Best regards,
Lajos

On Mon, 29 Dec 2014, J Callahan wrote:

 On 29/12/2014 4:46 am, Veres Lajos vla...@gmail.com wrote:
  -  inhibitors during their runtime. A simple way to achiveve
  +  inhibitors during their runtime. A simple way to archive

 This doesn't look right, did you just use a spell checker?


-- 
Lajos Veres
vla...@gmail.com
0792 7460 778
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] simple service shell script filling journal

2014-12-30 Thread Larry Harmon
I have not looked into module options or temp files – I haven’t learned these 
yet.

My bash script does write to the /sys/class/… trigger to set or clear an LED.
I don’t understand how system-tmpfile helps with a periodic operation.  But I 
will look into it.

Thanks

Larry Harmon

Larry Harmon | Sr. Embedded Engineer

Turning Technologies | 255 West Federal Street | Youngstown, OH 44503
Direct: 330-531-7664 | Main: 330-746-3015 | Toll Free: 866-746-3015 | SKYPE 
larry.harmon54
lhar...@turningtechnologies.commailto:lhar...@turningtechnologies.com | 
www.TurningTechnologies.comhttp://www.turningtechnologies.com/

 [cid:image001.png@01CE9E4C.2D88DB90]

Stay Connected - @TurningTech https://twitter.com/turningtech · 
Facebookhttp://www.facebook.com/#!/pages/Turning-Technologies/104796086230111?ref=ts

This e-mail message, including any attached files, is for the sole use of the 
intended recipient(s) and may contain confidential and/or privileged 
information. Any unauthorized review, use, disclosure or distribution is 
prohibited. If you are not the intended recipient or you wish to discontinue 
receiving any future e-mails from the vendor featured in this message, please 
send an e-mail requestmailto:i...@turningtechnologies.com?subject=unsubscribe.

From: systemd-devel [mailto:systemd-devel-boun...@lists.freedesktop.org] On 
Behalf Of Jóhann B. Guðmundsson
Sent: Monday, December 29, 2014 6:46 PM
To: systemd-devel@lists.freedesktop.org
Subject: Re: [systemd-devel] simple service shell script filling journal


On 12/29/2014 08:16 PM, Larry Harmon wrote:
I am using a simple shell script, started by system, to set LEDs on a Marvell 
Armada 370 plug.
The script uses a while loop with a sleep 30 line

Hmm somehow using a script ( and a type service unit ) to accomplish this does 
not sound right to me and I'm pretty sure greg k-h has the correct way of 
achieving this but did you try fiddling with module options

/etc/modprobe.d/module.conf

options foo bar

Or find the trigger

cat /sys/class/leds/foo-led/trigger

Create an tmpfile

/etc/tmpfiles.d/foo-led.conf

w /sys/class/leds/foo-led/trigger - - - - the trigger to be used

systemd-tmpfiles --create foo-led.conf

And try that instead of writing a script to accomplish this?

( This might be a bug in the kernel/driver if this is not working correctly or 
if you cant tweak it it with something like the above )

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


Re: [systemd-devel] [PATCH] fix spell

2014-12-30 Thread Paul Menzel
Dear Susant,


Am Dienstag, den 30.12.2014, 13:35 +0530 schrieb Susant Sahani:

thank you for the patch.

Could you please fix the summary line? For example use

man: Fix three typos

or

man: Fix spelling

as that also shows that the manual pages are touched.

`git commit --amend` let’s you update the commit message.

 ---
  man/sd_event_add_child.xml  | 2 +-
  man/sd_event_add_signal.xml | 2 +-
  man/systemctl.xml   | 2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)

[…]


Thanks,

Paul


signature.asc
Description: This is a digitally signed message part
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] systemd: Program terminated with signal SIGFPE, Arithmetic exception.

2014-12-30 Thread Paul Menzel
Dear systemd folks,


using Debian Sid/unstable with systemd 215-8, I still have problems that
there are time-outs between systemd and D-Bus, even with the current
D-Bus 1.8.12 [1]. Experiencing this again, where
`systemd-logind.service` was not started, I was able to log in on tty1
but in the end I was unable to run any `sudo systemctl` commands as they
timed out. I also was unable to reboot or halt the system.

Somewhere in that situation systemd also crashed with an arithmetic
exception; logged as `Caught FPE` in `/var/log/syslog`.

I created ticket #87349 in the Freedesktop.org Bugzilla bug tracker [2].
The backtrace is pasted in the original upstream bug report and in this
message at the end.


Thanks,

Paul


[1] https://bugs.freedesktop.org/show_bug.cgi?id=87424
Time-out problems during boot with systemd
[2] https://bugs.freedesktop.org/show_bug.cgi?id=87349

-- Package-specific info:

-- System Information:
Debian Release: 8.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 3.16.0-4-686-pae (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)

Versions of packages systemd depends on:
ii  acl 2.2.52-2
ii  adduser 3.113+nmu3
ii  initscripts 2.88dsf-58
ii  libacl1 2.2.52-2
ii  libaudit1   1:2.4-1+b1
ii  libblkid1   2.25.2-4
ii  libc6   2.19-13
ii  libcap2 1:2.24-6
ii  libcap2-bin 1:2.24-6
ii  libcryptsetup4  2:1.6.6-4
ii  libgcrypt20 1.6.2-4+b1
ii  libkmod218-3
ii  liblzma55.1.1alpha+20120614-2+b3
ii  libpam0g1.1.8-3.1
ii  libselinux1 2.3-2
ii  libsystemd0 215-8
ii  mount   2.25.2-4
ii  sysv-rc 2.88dsf-58
ii  udev215-8
ii  util-linux  2.25.2-4

Versions of packages systemd recommends:
ii  dbus1.8.12-3
ii  libpam-systemd  215-8

Versions of packages systemd suggests:
pn  systemd-ui  none

-- no debconf information

-- Backtrace
Thread 1 (Thread 0xb73417c0 (LWP 3020)):
#0  0xb7650d3c in __kernel_vsyscall ()
No symbol table info available.
#1  0xb7603bb6 in raise (sig=8) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
resultvar = optimized out
resultvar = optimized out
pid = optimized out
#2  0xb7686e6b in crash.lto_priv.235 (sig=8) at ../src/core/main.c:158
rl = {rlim_cur = 18446744073709551615, rlim_max = 18446744073709551615}
sa = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, 
sa_mask = {__val = {0 repeats 32 times}}, sa_flags = 0, 
  sa_restorer = 0x0}
pid = optimized out
__func__ = crash
__PRETTY_FUNCTION__ = crash
#3  signal handler called
No symbol table info available.
#4  0xb772fcdf in manager_print_jobs_in_progress (m=0xb79c6bd0) at 
../src/core/manager.c:170
job_of_n = 0x0
j = optimized out
counter = 0
cylon = 
|\000\000\000\060ᶷ\000\000\000\000\001\000\000\000\002\000\000\000\003\000\000\000\004\000\000\000\001\000\000
time = 
\002\000\000\000\003\000\000\000\005\000\000\000\001\000\000\000\002\000\000\000\003\000\000\000\004\000\000\000\005\000\000\000\000M\362\261\v\000\000\000\210P\245\267\071Hk\267h:{\267\005\000\000\000\v\000\000\000\210P\245\267
limit = no limit, '\000' repeats 55 times
x = optimized out
i = 0x0
cylon_pos = optimized out
#5  manager_dispatch_jobs_in_progress (source=0xb7b64fe8, usec=432972905, 
userdata=0xb79c6bd0) at ../src/core/manager.c:1846
m = 0xb79c6bd0
r = optimized out
next = optimized out
__PRETTY_FUNCTION__ = manager_dispatch_jobs_in_progress
#6  0xb76a157d in source_dispatch (s=0xb7b64fe8) at 
../src/libsystemd/sd-event/sd-event.c:2024
r = optimized out
__PRETTY_FUNCTION__ = source_dispatch
__func__ = source_dispatch
#7  0xb76a6b94 in sd_event_run (e=optimized out, timeout=optimized out) at 
../src/libsystemd/sd-event/sd-event.c:2314
ev_queue = optimized out
ev_queue_max = optimized out
p = optimized out
r = optimized out
i = optimized out
m = 1
timedout = false
__PRETTY_FUNCTION__ = sd_event_run
#8  0xb7731f13 in manager_loop (m=0xb79c6bd0) at ../src/core/manager.c:1912
wait_usec = 18446744073709551615
rl = {interval = 100, begin = 432639580, burst = 5, num = 26074}
__PRETTY_FUNCTION__ = manager_loop
__func__ = manager_loop
#9  0xb7685062 in main (argc=1, argv=0xbfe55314) at ../src/core/main.c:1743
m = optimized out
---Type return to continue, or q return to quit---
r = optimized out
retval = 1
before_startup = optimized out
after_startup = optimized out
timespan =  
!4\267@\373d\267\234u_\267\070tE\267\364^_\267\001\000\000\000\000\000\000\000 
\364e\267\210Q\345\277\000\060g\267dO\345\277 \372d\267 

Re: [systemd-devel] Small fixes to accelerometer

2014-12-30 Thread Paul Menzel
Dear Robert,


thank you for your patch. You should tag patches with [PATCH] in the
subject. Your MUA (mail client) Claws Mail can probably even import the
mbox file `git format-patch -1` creates, which you attached.


Am Dienstag, den 30.12.2014, 09:23 +0100 schrieb Robert Milasan:
 From 7aaa2c1b6b6a6d0ef391610e932d6eff010dea41 Mon Sep 17 00:00:00 2001
 From: Robert Milasan rmila...@suse.com
 Date: Tue, 30 Dec 2014 09:20:42 +0100
 Subject: [PATCH] accelerometer: drop unused -x option, display short options
  too.

As you can see from the line break in the summary, it is too long, which
in this case stems from the fact, that you have one commit for two
issues. It’s good measure to send one patch for one problem.

Could you please submit two patches instead? `git add -p` helps here.
Please ask if you need help splitting the commit up.

 ---
  src/udev/accelerometer/accelerometer.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/src/udev/accelerometer/accelerometer.c 
 b/src/udev/accelerometer/accelerometer.c
 index dd4b7dc..9c13d97 100644
 --- a/src/udev/accelerometer/accelerometer.c
 +++ b/src/udev/accelerometer/accelerometer.c
 @@ -198,8 +198,8 @@ static void test_orientation(struct udev *udev,
  static void help(void)
  {
  printf(Usage: accelerometer [options] device path\n
 - --debug debug to stderr\n
 - --help  print this help text\n\n);
 + -d,--debug debug to stderr\n
 + -h,--help  print this help text\n\n);

Should there be a space after the `,`? Do the descriptions still align
well.

  }
  
  int main (int argc, char** argv)
 @@ -229,7 +229,7 @@ int main (int argc, char** argv)
  while (1) {
  int option;
  
 -option = getopt_long(argc, argv, dxh, options, NULL);
 +option = getopt_long(argc, argv, dh, options, NULL);

Good find!

  if (option == -1)
  break;


Thanks,

Paul


signature.asc
Description: This is a digitally signed message part
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] Fix install location of systemd.pc

2014-12-30 Thread Zbigniew Jędrzejewski-Szmek
On Mon, Dec 29, 2014 at 03:01:12PM +, Simon Peeters wrote:
 2014-12-29 13:02 GMT+00:00 Martin Pitt martin.p...@ubuntu.com:
  Mike Gilbert [2014-12-28 12:41 -0500]:
  From Lennart's commit message, it seems like this was done intentionally.
 
  The addition of libdir was certainly intentional, that's why I didn't
  propose to just remove libdir. But it looks like this was just missing
  to adjust the install location accordingly?
 
 just my 2c:
 
 well, the addition of libdir was to be able to find the libdir for the
 primary arch (however you might define that), moving the pc file
 with this info to $libdir/pkgconfig makes that argument moot since you
 need to know libdir in order to know libdir.
 
 So if I can follow lennart correctly there are 2 possible ways:
 - have libdir in the pc file in /usr/share and make it to denote the
 primary arch (which is the current situation)
 - not have libdir in the pc file at all and still have the pc file in
 /usr/share (since libdir does not make sense if the file is in
 $libdir/pkgconfig, and it is the only reason why it might not belong
 in /usr/share)
 
 I have no preference between the 2, but moving the pc file to
 $libdir/pkgconfig just does not make sense.

What is $libdir in the .pc file used for? If we can answer that, it'll
be clearer whether status quo is correct.

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


Re: [systemd-devel] [systemd-commits] 8 commits - src/core src/libsystemd src/test

2014-12-30 Thread Zbigniew Jędrzejewski-Szmek
 commit e95e909d820429ba34fa6f6f1b0109ac22743b47
 Author: Tom Gundersen t...@jklm.no
 Date:   Sun Dec 28 13:38:23 2014 +0100
 
 core: loopback - simplify check_loopback()
 
 We no longer configure the addresses on the loopback interface, but 
 simply bring it up
 and let the kernel do the rest. Also change the check to only check if 
 the interface
 is up, rather than checking for the IPv4 loopback address.
 
 diff --git a/src/core/loopback-setup.c b/src/core/loopback-setup.c
 index ab6335c..0d7d00c 100644
 --- a/src/core/loopback-setup.c
 +++ b/src/core/loopback-setup.c
 @@ -56,30 +56,24 @@ static int start_loopback(sd_rtnl *rtnl) {
  return 0;
  }
  
 -static int check_loopback(void) {
 +static bool check_loopback(sd_rtnl *rtnl) {
This does not look right. First of all, check is misleading, because a return
value of false means that the check passed. Second, negative values are 
implicitly
converted to bool.

 +_cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL, *reply = 
 NULL;
 +unsigned flags;
  int r;
 -_cleanup_close_ int fd = -1;
 -union {
 -struct sockaddr sa;
 -struct sockaddr_in in;
 -} sa = {
 -.in.sin_family = AF_INET,
 -.in.sin_addr.s_addr = htonl(INADDR_LOOPBACK),
 -};
 -
 -/* If we failed to set up the loop back device, check whether
 - * it might already be set up */
 -
 -fd = socket(AF_INET, SOCK_DGRAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0);
 -if (fd  0)
 -return -errno;
 -
 -if (bind(fd, sa.sa, sizeof(sa.in)) = 0)
 -r = 1;
 -else
 -r = errno == EADDRNOTAVAIL ? 0 : -errno;
 -
 -return r;
 +
 +r = sd_rtnl_message_new_link(rtnl, req, RTM_GETLINK, 
 LOOPBACK_IFINDEX);
 +if (r  0)
 +return r;
 +
 +r = sd_rtnl_call(rtnl, req, 0, reply);
 +if (r  0)
 +return r;
 +
 +r = sd_rtnl_message_link_get_flags(reply, flags);
 +if (r  0)
 +return r;
 +
 +return flags  IFF_UP;
  }
  
  int loopback_setup(void) {
 @@ -92,7 +86,7 @@ int loopback_setup(void) {
  
  r = start_loopback(rtnl);
  if (r == -EPERM) {
 -if (check_loopback()  0)
 +if (!check_loopback(rtnl))
  return log_warning_errno(EPERM, Failed to configure 
 loopback device: %m);
  } else if (r  0)
  return log_warning_errno(r, Failed to configure loopback 
 device: %m);

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


Re: [systemd-devel] [systemd-commits] 8 commits - src/core src/libsystemd src/test

2014-12-30 Thread David Herrmann
Hi

On Tue, Dec 30, 2014 at 5:17 PM, Zbigniew Jędrzejewski-Szmek
zbys...@in.waw.pl wrote:
 commit e95e909d820429ba34fa6f6f1b0109ac22743b47
 Author: Tom Gundersen t...@jklm.no
 Date:   Sun Dec 28 13:38:23 2014 +0100

 core: loopback - simplify check_loopback()

 We no longer configure the addresses on the loopback interface, but 
 simply bring it up
 and let the kernel do the rest. Also change the check to only check if 
 the interface
 is up, rather than checking for the IPv4 loopback address.

 diff --git a/src/core/loopback-setup.c b/src/core/loopback-setup.c
 index ab6335c..0d7d00c 100644
 --- a/src/core/loopback-setup.c
 +++ b/src/core/loopback-setup.c
 @@ -56,30 +56,24 @@ static int start_loopback(sd_rtnl *rtnl) {
  return 0;
  }

 -static int check_loopback(void) {
 +static bool check_loopback(sd_rtnl *rtnl) {
 This does not look right. First of all, check is misleading, because a 
 return
 value of false means that the check passed. Second, negative values are 
 implicitly
 converted to bool.

This is already fixed in:
http://cgit.freedesktop.org/systemd/systemd/commit/?id=2f0af4e120385e6078c96189f4a4d0cce0e12a3a

Thanks
David

 +_cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL, *reply = 
 NULL;
 +unsigned flags;
  int r;
 -_cleanup_close_ int fd = -1;
 -union {
 -struct sockaddr sa;
 -struct sockaddr_in in;
 -} sa = {
 -.in.sin_family = AF_INET,
 -.in.sin_addr.s_addr = htonl(INADDR_LOOPBACK),
 -};
 -
 -/* If we failed to set up the loop back device, check whether
 - * it might already be set up */
 -
 -fd = socket(AF_INET, SOCK_DGRAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0);
 -if (fd  0)
 -return -errno;
 -
 -if (bind(fd, sa.sa, sizeof(sa.in)) = 0)
 -r = 1;
 -else
 -r = errno == EADDRNOTAVAIL ? 0 : -errno;
 -
 -return r;
 +
 +r = sd_rtnl_message_new_link(rtnl, req, RTM_GETLINK, 
 LOOPBACK_IFINDEX);
 +if (r  0)
 +return r;
 +
 +r = sd_rtnl_call(rtnl, req, 0, reply);
 +if (r  0)
 +return r;
 +
 +r = sd_rtnl_message_link_get_flags(reply, flags);
 +if (r  0)
 +return r;
 +
 +return flags  IFF_UP;
  }

  int loopback_setup(void) {
 @@ -92,7 +86,7 @@ int loopback_setup(void) {

  r = start_loopback(rtnl);
  if (r == -EPERM) {
 -if (check_loopback()  0)
 +if (!check_loopback(rtnl))
  return log_warning_errno(EPERM, Failed to 
 configure loopback device: %m);
  } else if (r  0)
  return log_warning_errno(r, Failed to configure loopback 
 device: %m);

 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] [PATCH] man: Fix spelling

2014-12-30 Thread Susant Sahani
---
 man/sd_event_add_child.xml  | 2 +-
 man/sd_event_add_signal.xml | 2 +-
 man/systemctl.xml   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/man/sd_event_add_child.xml b/man/sd_event_add_child.xml
index 9d943f8..7a84fce 100644
--- a/man/sd_event_add_child.xml
+++ b/man/sd_event_add_child.xml
@@ -100,7 +100,7 @@ along with systemd; If not, see 
http://www.gnu.org/licenses/.
 being stopped by a signal), and constantWCONTINUED/constant
 (watch for the child being resumed by a signal). See
 
citerefentryrefentrytitlewaitid/refentrytitlemanvolnum2/manvolnum/citerefentry
-for futher information./para
+for further information./para
 
 paraOnly a single handler may be installed for a specific
 child. The handler is enabled
diff --git a/man/sd_event_add_signal.xml b/man/sd_event_add_signal.xml
index f39751d..0299aa5 100644
--- a/man/sd_event_add_signal.xml
+++ b/man/sd_event_add_signal.xml
@@ -95,7 +95,7 @@ along with systemd; If not, see 
http://www.gnu.org/licenses/.
 structnameconst struct signalfd_siginfo/structname containing
 the information about the received signal. See
 
citerefentryrefentrytitlesignalfd/refentrytitlemanvolnum2/manvolnum/citerefentry
-for futher information./para
+for further information./para
 
 paraOnly a single handler may be installed for a specific
 signal. The signal will be unblocked, and must be
diff --git a/man/systemctl.xml b/man/systemctl.xml
index d1991e0..3ac6f62 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -173,7 +173,7 @@ along with systemd; If not, see 
http://www.gnu.org/licenses/.
   paraNote that any varnameAfter=/varname dependency is
   automatically mirrored to create a
   varnameBefore=/varname dependency. Temporal dependencies
-  may be specified explictly, but are also created implicitly
+  may be specified explicitly, but are also created implicitly
   for units which are varnameWantedBy=/varname targets
   (see
   
citerefentryrefentrytitlesystemd.target/refentrytitlemanvolnum5/manvolnum/citerefentry),
-- 
2.1.0

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


Re: [systemd-devel] [PATCH] fix spell

2014-12-30 Thread Susant Sahani
On Tue, 30 Dec 2014 21:12:51 +0530, Paul Menzel  
paulepan...@users.sourceforge.net wrote:



 man: Fix spelling


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


[systemd-devel] [PATCH 1/2] accelerometer: drop unused -x option

2014-12-30 Thread Robert Milasan
---
 src/udev/accelerometer/accelerometer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/udev/accelerometer/accelerometer.c
b/src/udev/accelerometer/accelerometer.c index dd4b7dc..23d6f78 100644
--- a/src/udev/accelerometer/accelerometer.c
+++ b/src/udev/accelerometer/accelerometer.c
@@ -229,7 +229,7 @@ int main (int argc, char** argv)
 while (1) {
 int option;
 
-option = getopt_long(argc, argv, dxh, options, NULL);
+option = getopt_long(argc, argv, dh, options, NULL);
 if (option == -1)
 break;
 
-- 
1.8.4.5
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 2/2] accelerometer: display short options too

2014-12-30 Thread Robert Milasan
---
 src/udev/accelerometer/accelerometer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/udev/accelerometer/accelerometer.c
b/src/udev/accelerometer/accelerometer.c index 23d6f78..9c13d97 100644
--- a/src/udev/accelerometer/accelerometer.c
+++ b/src/udev/accelerometer/accelerometer.c
@@ -198,8 +198,8 @@ static void test_orientation(struct udev *udev,
 static void help(void)
 {
 printf(Usage: accelerometer [options] device path\n
- --debug debug to stderr\n
- --help  print this help text\n\n);
+ -d,--debug debug to stderr\n
+ -h,--help  print this help text\n\n);
 }
 
 int main (int argc, char** argv)
-- 
1.8.4.5
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] Propagate reload from RELOADING=1 notifications

2014-12-30 Thread Jouke Witteveen
---

This fixes #87251

 src/core/manager.c | 42 ++
 src/core/manager.h |  1 +
 src/core/service.c |  7 +++
 3 files changed, 50 insertions(+)

diff --git a/src/core/manager.c b/src/core/manager.c
index 9705e64..11cca17 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1226,6 +1226,48 @@ int manager_add_job_by_name(Manager *m, JobType type, 
const char *name, JobMode
 return manager_add_job(m, type, unit, mode, override, e, _ret);
 }
 
+int manager_propagate_reload(Manager *m, Unit *unit, JobMode mode, bool 
override, sd_bus_error *e) {
+int r;
+Transaction *tr;
+Iterator i;
+Unit *dep;
+
+
+assert(m);
+assert(unit);
+assert(mode  _JOB_MODE_MAX);
+
+tr = transaction_new(mode == JOB_REPLACE_IRREVERSIBLY);
+if (!tr)
+return -ENOMEM;
+
+SET_FOREACH(dep, unit-dependencies[UNIT_PROPAGATES_RELOAD_TO], i) {
+r = transaction_add_job_and_dependencies(tr, JOB_RELOAD, dep, 
NULL, false, override, false, false, mode == JOB_IGNORE_DEPENDENCIES, e);
+if (r  0) {
+log_unit_warning(dep-id,
+ Cannot add dependency reload job for 
unit %s, ignoring: %s,
+ dep-id, bus_error_message(e, r));
+
+if (e)
+sd_bus_error_free(e);
+
+goto tr_abort;
+}
+}
+
+r = transaction_activate(tr, m, mode, e);
+if (r  0)
+goto tr_abort;
+
+transaction_free(tr);
+return 0;
+
+tr_abort:
+transaction_abort(tr);
+transaction_free(tr);
+return r;
+}
+
 Job *manager_get_job(Manager *m, uint32_t id) {
 assert(m);
 
diff --git a/src/core/manager.h b/src/core/manager.h
index ab75f90..bc11f87 100644
--- a/src/core/manager.h
+++ b/src/core/manager.h
@@ -316,6 +316,7 @@ int manager_load_unit_from_dbus_path(Manager *m, const char 
*s, sd_bus_error *e,
 
 int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, bool 
force, sd_bus_error *e, Job **_ret);
 int manager_add_job_by_name(Manager *m, JobType type, const char *name, 
JobMode mode, bool force, sd_bus_error *e, Job **_ret);
+int manager_propagate_reload(Manager *m, Unit *unit, JobMode mode, bool force, 
sd_bus_error *e);
 
 void manager_dump_units(Manager *s, FILE *f, const char *prefix);
 void manager_dump_jobs(Manager *s, FILE *f, const char *prefix);
diff --git a/src/core/service.c b/src/core/service.c
index bfbe959..71c7bf6 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -1496,11 +1496,18 @@ fail:
 }
 
 static void service_enter_reload_by_notify(Service *s) {
+_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
+int r;
+
 assert(s);
 
 if (s-timeout_start_usec  0)
 service_arm_timer(s, s-timeout_start_usec);
 
+r = manager_propagate_reload(UNIT(s)-manager, UNIT(s), JOB_REPLACE, 
false, error);
+if(r  0)
+log_unit_warning(UNIT(s)-id, %s failed to schedule 
propagation of reload: %s, UNIT(s)-id, bus_error_message(error, -r));
+
 service_set_state(s, SERVICE_RELOAD);
 }
 
-- 
2.2.1

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


Re: [systemd-devel] [PATCH 2/2] accelerometer: display short options too

2014-12-30 Thread Paul Menzel
Am Dienstag, den 30.12.2014, 18:58 +0100 schrieb Robert Milasan:
 ---
  src/udev/accelerometer/accelerometer.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

Awesome! Thank you for splitting these up and submitting a v2!

 diff --git a/src/udev/accelerometer/accelerometer.c
 b/src/udev/accelerometer/accelerometer.c index 23d6f78..9c13d97 100644
 --- a/src/udev/accelerometer/accelerometer.c
 +++ b/src/udev/accelerometer/accelerometer.c
 @@ -198,8 +198,8 @@ static void test_orientation(struct udev *udev,
  static void help(void)
  {
  printf(Usage: accelerometer [options] device path\n
 - --debug debug to stderr\n
 - --help  print this help text\n\n);
 + -d,--debug debug to stderr\n
 + -h,--help  print this help text\n\n);

1. I still wonder if the description is aligned after this patch is
applied.
2. A space after the comma, `-d, --debug` would be helpful in my
opinion.

  }
  
  int main (int argc, char** argv)


Thanks,

Paul


signature.asc
Description: This is a digitally signed message part
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] man: Fix spelling

2014-12-30 Thread Martin Pitt
Hey Susant,

Applied, 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 1/2] accelerometer: drop unused -x option

2014-12-30 Thread Martin Pitt
Hey Robert,

applied, 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 2/2] accelerometer: display short options too

2014-12-30 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Dec 30, 2014 at 08:29:27PM +0100, Paul Menzel wrote:
 Am Dienstag, den 30.12.2014, 18:58 +0100 schrieb Robert Milasan:
  ---
   src/udev/accelerometer/accelerometer.c | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)
 
 Awesome! Thank you for splitting these up and submitting a v2!
 
  diff --git a/src/udev/accelerometer/accelerometer.c
  b/src/udev/accelerometer/accelerometer.c index 23d6f78..9c13d97 100644
  --- a/src/udev/accelerometer/accelerometer.c
  +++ b/src/udev/accelerometer/accelerometer.c
  @@ -198,8 +198,8 @@ static void test_orientation(struct udev *udev,
   static void help(void)
   {
   printf(Usage: accelerometer [options] device path\n
  - --debug debug to stderr\n
  - --help  print this help text\n\n);
  + -d,--debug debug to stderr\n
  + -h,--help  print this help text\n\n);
 
 1. I still wonder if the description is aligned after this patch is
 applied.
 2. A space after the comma, `-d, --debug` would be helpful in my
 opinion.

It's good enough. Other code in src/udev uses this style. If they
are changed to be more like the rest of systemd, it can all be done
in one fell swoop.

Applied.

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


Re: [systemd-devel] [PATCH 1/2] typofixes - https://github.com/vlajos/misspell_fixer

2014-12-30 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Dec 30, 2014 at 11:50:06AM +, Veres Lajos wrote:
 Hi,
 
 I reviewed it one time, but it seems I wasn't enough accurate...
 Should I change the patch and resend it?
 
 Best regards,
 Lajos
 
 On Mon, 29 Dec 2014, J Callahan wrote:
 
  On 29/12/2014 4:46 am, Veres Lajos vla...@gmail.com wrote:
   -  inhibitors during their runtime. A simple way to achiveve
   +  inhibitors during their runtime. A simple way to archive
 
  This doesn't look right, did you just use a spell checker?

This one was fixed in 2/2. I squashed them together. There was also
another invalid change which I fixed up. It is good to go over those
patches with git show --color-words ;)

Both applied.

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


[systemd-devel] idle daemon sleep

2014-12-30 Thread Garegin Asatryan
In Windows 8 and later the group policy service (and maybe other services
as well, I couldn't find any info on that) can go to sleep to save power.
Do you think a similar feature could be implemented for systemd?

Source: http://technet.microsoft.com/en-us/library/dn265973.aspx#BKMK_Perf


The Group Policy Client service will sleep when the Group Policy service is
idle for more than 10 minutes.

*What value does this change add?*

Group Policy processes approximately every 90 minutes, by default. Setting
the Group Policy Client service to sleep in between processing helps create
better performance for client computers.

*What works differently?*

Group Policy background refresh starts as a scheduled task, not as a
service that continuously checks to determine when it is time to run the
background refresh. The scheduled task model requires less overhead
processing, which creates better performance for client computers.


Garegin
aka the sysadmin who can't code for squat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] idle daemon sleep

2014-12-30 Thread Mantas Mikulėnas
On Wed, Dec 31, 2014 at 7:42 AM, Garegin Asatryan garegi...@gmail.com wrote:
 In Windows 8 and later the group policy service (and maybe other services as 
 well, I couldn't find any info on that) can go to sleep to save power. Do you 
 think a similar feature could be implemented for systemd?
 [...]
 Group Policy background refresh starts as a scheduled task, not as a service 
 that continuously checks to determine when it is time to run the background 
 refresh. The scheduled task model requires less overhead processing, which 
 creates better performance for client computers.

I'm not sure what implementation exactly you have in mind?

As far as I know, it has never done any continuous checking in the
first place – systemd *is* asleep most of the time, waiting on
external events to arrive via epoll. (It even had fixes added to the
kernel just so that it wouldn't need to manually re-check mtab c.).

Even for .timer units, systemd simply sleeps until it's actually time
for the next event – like cron, or Task Scheduler for that matter.
There shouldn't be any is it time yet?.

~

However, one place of improvement that comes to mind is the 'watchdog'
feature that systemd uses to ensure its services aren't stuck, by
having them check in with pid1 every now and then (that is, every 1/2
of the configured timeout). Similarly, pid1 itself can use the
hardware watchdog, although this is off by default.

That is, most of systemd's own services have WatchdogSec=1min which
causes all of them to wake up every 30 seconds. So one way to save
power would be to grep /lib/systemd/system for WatchdogSec= and
increase the interval configured. I think you could raise this to
10min or so, depending on the service.

Oddly, I see user/enlightenment.service having WatchdogSec=10, which
is just nuts. O_o

-- 
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] idle daemon sleep

2014-12-30 Thread Alexandre Detiste
Le mercredi 31 décembre 2014, 08:23:51 Mantas Mikulėnas a écrit :
 Even for .timer units, systemd simply sleeps until it's actually time
 for the next event – like cron, or Task Scheduler for that matter.
 There shouldn't be any is it time yet?.

In fact, many people complain that cron does wakes up their laptop every minute;
and that increase battery consumption, while systemd timers doesn't suffer from 
this.

http://unixhelp.ed.ac.uk/CGI/man-cgi?crond
[ Additionally,  cron  checks each minute to see if its spool directory's
[ modtime (or the modtime on /etc/crontab) has changed

http://content.hccfl.edu/pollock/unix/crontab.htm
[ Each minute the cron daemon wakes up and compares the crontab file entries 
against the current time.
[ If the five fields match the current minute then the command is executed.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] man: Fix spelling

2014-12-30 Thread Susant Sahani
On Wed, 31 Dec 2014 02:35:00 +0530, Martin Pitt martin.p...@ubuntu.com  
wrote:



Hey Susant,

Hi Martin,


Applied, thanks!


Thanks !


Martin



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


Re: [systemd-devel] idle daemon sleep

2014-12-30 Thread Mantas Mikulėnas
On Wed, Dec 31, 2014 at 8:37 AM, Alexandre Detiste
alexandre.deti...@gmail.com wrote:
 Le mercredi 31 décembre 2014, 08:23:51 Mantas Mikulėnas a écrit :
 Even for .timer units, systemd simply sleeps until it's actually time
 for the next event – like cron, or Task Scheduler for that matter.
 There shouldn't be any is it time yet?.

 In fact, many people complain that cron does wakes up their laptop every 
 minute;
 and that increase battery consumption, while systemd timers doesn't suffer 
 from this.

 http://unixhelp.ed.ac.uk/CGI/man-cgi?crond
 [ Additionally,  cron  checks each minute to see if its spool directory's
 [ modtime (or the modtime on /etc/crontab) has changed

 http://content.hccfl.edu/pollock/unix/crontab.htm
 [ Each minute the cron daemon wakes up and compares the crontab file entries 
 against the current time.
 [ If the five fields match the current minute then the command is executed.

The original cron stopped doing this *in 1977* – at least according to
the history article [1], it learned to sleep exactly right until the
next event and re-read the crontab only every *30 minutes*.

But I took a look at vixie-cron on Debian 6, and yes, it wakes up to
stat() all crontabs to check for updates. Which makes the fancy event
list algorithm moot :( Meanwhile, Arch's default 'cronie' is more
modern and uses inotify.

[1]: https://en.wikipedia.org/wiki/Cron#History

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