Re: [systemd-devel] Minimal systemd configuration

2015-04-05 Thread Alison Chaiken
srdb asks:
 1. Is there any documentation for creating minimal systemd
 configuration? I mean for example - for qemu or embedded systems - with
 only sshd daemon running and console to just log into the system?

Yes, at

http://freedesktop.org/wiki/Software/systemd/MinimalBuilds/

The easiest way to get a minimal build is to clone the source, run
autogen.sh, then read the --disable entries in the configure script
that is created.  To get a minimal build with 219, I ran

./configure --disable-gtk-doc --disable-seccomp --disable-selinux
--disable-apparmor --disable-xz --disable-zlib --disable-pam
--disable-acl --disable-smack --disable-gcrypt --disable-audit
--disable-elfutils --disable-libcryptsetup --disable-qrencode
--disable-microhttpd --disable-gnutls --disable-libcurl
--disable-libidn  --disable-quotacheck --disable-vconsole
--disable-logind --disable-machined --disable-importd
--disable-hostnamed --disable-timedated --disable-localed
--disable-polkit --disable-resolved --disable-networkd --disable-efi
--disable-manpages --disable-hibernate --disable-tests  --disable-nls
--disable-python-devel --disable-utmp --disable-xkbcommon
--disable-ima --disable-binfmt --disable-tmpfiles --disable-sysusers
--disable-firstboot --disable-randomseed

You may need different options in your setup.   Edit the configuration
script or use a command-line option to set the installation directory
to your NFS path.   If, for some reason, you don't want systemd-219,
you can checkout an earlier tagged release from git.

 3. Is it possible to reconfigure systemd to run some script at the end
 of initialisation?

Yes, you can add a new service by creating a new unit file in
multi-user.target (more or less old runlevel 3) or graphical.target
(more or less old runlevel 5).   Find a unit file that does something
similar to what you want and use it is a template.

Good luck,
Alison

-- 
Alison Chaiken   ali...@she-devel.com
650-279-5600
http://{she-devel.com,exerciseforthereader.org}
One consumes a great deal of silence in the course of becoming
educated. -- Matthew B. Crawford
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Minimal systemd configuration

2015-04-05 Thread Andrei Borzenkov
В Sun, 5 Apr 2015 16:04:19 -0700
Alison Chaiken ali...@she-devel.com пишет:

 
  3. Is it possible to reconfigure systemd to run some script at the end
  of initialisation?
 
 Yes, you can add a new service by creating a new unit file in
 multi-user.target (more or less old runlevel 3) or graphical.target
 (more or less old runlevel 5).

You probably misunderstood the question. It is near to impossible to do
anything before any other service or after all services. You can of
course add new service, but you have no way to make it run at the end
of initialization.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Questions about timedatectl and NTP

2015-04-05 Thread Jakub Klinkovský
As per systemd 216 NEWS [1], alternative NTP implementations should add
Conflicts=systemd-timesyncd.service to be recognized by systemd, which
ntpd.service on Arch Linux does. But still, active ntpd.service does not seem
to be recognized by timedatectl:

$ timedatectl
...
 NTP enabled: no
NTP synchronized: yes
...

If I'm reading the code [2] correctly, the 'timedatectl set-ntp' command only
handles systemd-timesyncd.service and does not take into account any other NTP
implementations. This is in contrast with timedatectl(1) [3] which explicitly
shows an example where timedatectl starts chronyd.service.

Also, I think that since systemd 216 the NTP enabled field in timedatectl's
output should read timesyncd enabled to avoid confusion. Many people still
have trouble understanding that NTP != ntpd and timedatectl currently adds
another term to the inequality.

Finally, I think there is a bug in how the Conflicts= specification is supposed
to work. Suppose that systemd-timesyncd.service is inactive and some other
service, specifying Conflicts=systemd-timesyncd.service is active -- let's call
it ntpd.service as mentioned above. Now, when the user runs
'timedatectl set-ntp true' the systemd-timesyncd.service is first enabled and
then started. Due to the Conflicts= declaration, ntpd.service is stopped, but
remains enabled. Later on, when the user reboots, ntpd.service will be started
instead of systemd-timesyncd.service -- this is the behaviour described in
systemd.unit(5) [4].

[1] 
http://cgit.freedesktop.org/systemd/systemd/tree/NEWS?id=06b643e7f5a3b79005dd57497897ab7255fe3659#n5
 
[2] 
http://cgit.freedesktop.org/systemd/systemd/tree/src/timedate/timedated.c#n254
[3] http://www.freedesktop.org/software/systemd/man/timedatectl.html#Examples
[4] http://www.freedesktop.org/software/systemd/man/systemd.unit.html#Conflicts=


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


Re: [systemd-devel] [systemd-commits] 2 commits - src/libsystemd

2015-04-05 Thread Tom Gundersen
On Sun, Apr 5, 2015 at 11:50 AM, Lennart Poettering
lenn...@poettering.net wrote:
 On Fri, 03.04.15 13:23, Tom Gundersen (tome...@kemper.freedesktop.org) wrote:


 -tags = strdupa(value);
 +FOREACH_WORD_SEPARATOR(word, l, value, :, state) {
 +char *tag;

 -while ((next = strchr(tags, ':'))) {
 -next[0] = '\0';
 +tag = strndupa(word, l);


 Repeat after me: I shall not use alloca() within loops. I shall not
 use alloca() within loops. I shall not use alloca() within loops.

 This cannot work.

Fixed. Thanks!

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


Re: [systemd-devel] [systemd-commits] 2 commits - src/libsystemd

2015-04-05 Thread Lennart Poettering
On Fri, 03.04.15 13:23, Tom Gundersen (tome...@kemper.freedesktop.org) wrote:

  
 -tags = strdupa(value);
 +FOREACH_WORD_SEPARATOR(word, l, value, :, state) {
 +char *tag;
  
 -while ((next = strchr(tags, ':'))) {
 -next[0] = '\0';
 +tag = strndupa(word, l);
  

Repeat after me: I shall not use alloca() within loops. I shall not
use alloca() within loops. I shall not use alloca() within loops.

This cannot work.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Minimal systemd configuration

2015-04-05 Thread sdrb

Hello,

I've got a few very basic questions regarding configuration of systemd.

I'm trying to setup some minimal configuration for qemu running linux.

The qemu runs linux kernel which mounts nfs-root as root directory.
I've made minimal nfs-root and now I'd like to start the system with 
systemd in it.
I copied all the files from /usr/lib/systemd and /etc/systemd from my 
linux to nfs-root but when linux runs systemd - I got a lot of error 
messages like [FAILED] Failed to start xxx service.


My questions are:

1. Is there any documentation for creating minimal systemd 
configuration? I mean for example - for qemu or embedded systems - with 
only sshd daemon running and console to just log into the system?


2. Does the systemd require external applications like mount, login or 
other to work properly?


3. Is it possible to reconfigure systemd to run some script at the end 
of initialisation?



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


[systemd-devel] [PATCH] bootchart: fix check for no fd

2015-04-05 Thread Shawn Landden
found with coverty report
---
 src/bootchart/store.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bootchart/store.c b/src/bootchart/store.c
index f19427e..f159cba 100644
--- a/src/bootchart/store.c
+++ b/src/bootchart/store.c
@@ -476,7 +476,7 @@ catch_rename:
 
 /* re-fetch name */
 /* get name, start time */
-if (!ps-sched) {
+if (ps-sched  0) {
 sprintf(filename, %d/sched, pid);
 ps-sched = openat(procfd, filename, 
O_RDONLY|O_CLOEXEC);
 if (ps-sched  0)
-- 
2.2.1.209.g41e5f3a

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


Re: [systemd-devel] [PATCH] bootchart: fix check for no fd

2015-04-05 Thread Daniel Mack
On 04/05/2015 07:03 PM, Shawn Landden wrote:
 found with coverty report

Applied, thanks!

 ---
  src/bootchart/store.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/bootchart/store.c b/src/bootchart/store.c
 index f19427e..f159cba 100644
 --- a/src/bootchart/store.c
 +++ b/src/bootchart/store.c
 @@ -476,7 +476,7 @@ catch_rename:
  
  /* re-fetch name */
  /* get name, start time */
 -if (!ps-sched) {
 +if (ps-sched  0) {
  sprintf(filename, %d/sched, pid);
  ps-sched = openat(procfd, filename, 
 O_RDONLY|O_CLOEXEC);
  if (ps-sched  0)
 

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