Re: [systemd-devel] [PATCH] nspawn: spawn shell under specified --user

2011-06-27 Thread Michal Vyskocil
On Sun, Jun 26, 2011 at 09:59:14PM +0200, Zbigniew Jędrzejewski-Szmek wrote:
> On 06/24/2011 02:39 PM, Michal Vyskocil wrote:
> > +int isdigits(const char* str) {
> > +size_t i;
> > +
> > +if (!str)
> > +return 0;
> > +
> > +for (i = 0; i != strlen(str); i++) {
> > +if (!isdigit(str[i]))
> > +return 0;
> > +}
> Quadratic behaviour? What aboout
>   while(*str)
> if(!isdigit(*str++))
> return 0;

Good point - as obvious I made the mistake in the aux function of my
code :-/

Anyway I'm still interested if Lennart would like add a new option to
his Gnome3-like container :)

Regards
Michal Vyskocil


pgppLTFjuM7pz.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-analyze plot

2011-06-27 Thread Christian.Muck
Hi David,

you could set the log level of systemd to debug. 
To do this edit /etc/system/system.conf and change
LogLevel=debug
LogTarget=syslog-or-kmsg
Do a restart and have a look to the generated output with dmesg.

Before -.mount is reported it seems to me that systemd does some basic 
preparation
for starting, e.g. prepare logging, set hostname, looking for unit files etc.


Mit freundlichen Grüßen/With kind regards

BMW Group
Christian Muck
80788 München
Tel: +49-89-382-34465
mailto: christian.m...@bmw.de
Url:  http://www.bmwgroup.com/

Bayerische Motoren Werke Aktiengesellschaft
Vorstand: Norbert Reithofer, Vorsitzender,
Frank-Peter Arndt, Herbert Diess, Klaus Draeger, 
Friedrich Eichiner, Harald Krüger, Ian Robertson
Vorsitzender des Aufsichtsrats: Joachim Milberg
Sitz und Registergericht: München HRB 42243

> On Wed, Jun 22, 2011 at 5:40 AM,
>  wrote:
> > On Wed, Jun 22, 2011 at 5:25 AM,
> >  wrote:
> > > Hi All,
> > >
> > >
> > >
> > >
> > > I am currently in the process of analyzing and optimizing a systemd 
> > > startup
> > > in an Embedded project and wondered if someone could tell me what is being
> > > performed in the time between 0 and 1 that I see in my plot.svg files
> > > produced using systemd-analyze plot.
> >
> > which plot.svg?
> 
> I did not attach an svg file (I have now) as it was a general question
> with regards to what happens in the .svg plots before the -.mount is
> reported.
> 
> > Auke
> 
> 
> Thanks
> 
> Dave
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Error: inappropriate ioctl stty standard input

2011-06-27 Thread Lennart Poettering
On Sat, 25.06.11 21:57, Stef Bon (stef...@gmail.com) wrote:

> Hi,
> 
> I've been able to make my shiny new LFS system boot using systemd, but
> still with errors. When the tty's are activated,
> Iget the message:
> 
>  stty: standard input: Inappropriate ioctl for device

This usually indicates that your standard input in this shell is not
actually a tty, but some other kind of fd. By doing "readlink
/proc/self/fd/0" you might be able to find out what your stdin is
connected to.

Lennart

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


Re: [systemd-devel] Problem with netwrok broadband modem

2011-06-27 Thread Lennart Poettering
On Fri, 24.06.11 15:59, Christian Gagneraud (ch...@techworks.ie) wrote:

> Hi,
> 
> I'm trying to use a USB broadband modem with ofono and connman, when
> i plug the modem, i get an error from systemd "Failed to load device
> unit: Invalid argument" (full log below).

Hmm, this smells like a bug in systemd.

Do you have any service file for this device installed?

> Is it looking for a dev-tty@.device file?

Yes, but usually this should just fail with ENOENT and be ignored. For
some reason this generates EINVAL for you however.

> As i'm having trouble to get ofono working, I wonder if the problem
> doesn't come from here instead, or even perhaps it's due to the
> manufaturer and serial number of the USB device being garbage...

That could actually be. Of course we should fix systemd to handle this. 

I wonder how I could easily reproduce this issue here, without that hw.

My first guess is that i's actually the length of the name, and not the
contents of it that triggers the EINVAL.

Lennart

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


Re: [systemd-devel] [PATCH] nspawn: spawn shell under specified --user

2011-06-27 Thread Lennart Poettering
On Fri, 24.06.11 14:39, Michal Vyskocil (mvysko...@suse.cz) wrote:

> Add -u/--user option, which changes the effective and real user and
> group id to the new value. The user must exists in the chroot, otherwise
> it will fail. Both username and user id are accepted.

Sounds sensible, though I do wonder about the ultimate usefulness of
this given that this requires user settings configured on the host
systems in a way that makes sense in the container too. (i.e. the $HOME
and UID/GID of the user must be in sync in host and in container). Or am
I missing something?

> +static struct passwd *getpwun(const char* user) {
> +
> +struct passwd *pw;
> +
> +pw = getpwnam(user);
> +
> +if (!pw && isdigits(user)) {
> +pw = getpwuid((uid_t)atoi(user));
> +}
> +
> +if (! (pw && pw->pw_name && pw->pw_name[0] && pw->pw_dir && 
> pw->pw_dir[0]
> + && pw->pw_passwd)) {
> +log_error("user name or id %s does not exist: %m", user);
> +return NULL;
> +}

Please work the other way here. Use "safe_atou()" first on the
username, and if that works it's a numeric uid. If it doesn't try
getpwnam(). Code that already does this you find in get_user_creds() in
execute.c.

> +mkdir_p(pw->pw_dir, 0755);
> +if (chown(pw->pw_dir, pw->pw_uid, pw->pw_gid) < 0) {
> +log_error("chown(%s) failed: %m", 
> pw->pw_dir);
> +goto child_fail;
> +}

Please use safe_mkdir() here.

Lennart

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


Re: [systemd-devel] PATCH: add support for --root for systemctl enable/disable/is-enabled

2011-06-27 Thread Lennart Poettering
On Fri, 24.06.11 15:02, Frederic Crozat (fcro...@suse.com) wrote:

> Add --root= for enable/disable/is-enabled systemctl commands. To
> be used for easily enable / disable systemd services for a chroot,
> without running systemctl inside chroot.

Thanks!

Applied.

Lennart

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


Re: [systemd-devel] RFC: creating a set of systemd RPM macros across distributions ?

2011-06-27 Thread Lennart Poettering
On Fri, 24.06.11 15:08, Frederic Crozat (fcro...@suse.com) wrote:

Heya,

Sounds good! A few comments:
 
> %service_add()
> if [ "$1" -eq 1 ] ; then 
> # Initial installation 
> /bin/systemctl daemon-reload >/dev/null 2>&1 || :
> fi
> 
> %service_add_enabled()
> if [ "$1" -eq 1 ] ; then 
> # Initial installation
> /bin/systemctl enable %{1}.service >/dev/null 2>&1 || :
> fi

I'd strongly advise against this. Units might install more than one
service, and other units instead of services (example: sshd might just
enable a socket by default, but not a service). Hence we should not
appaned .service but leave it to the package to specifiy the full name
and we also need to make sure packagers can specify multiple unit files
at once.

> %service_del_preun()
> if [ "$1" -eq 0 ] ; then
> # Package removal, not upgrade
> /bin/systemctl --no-reload disable %{1}.service > /dev/null 2>&1 || :
> /bin/systemctl stop %{1}.service > /dev/null 2>&1 || :
> fi
> 
> %service_del_postun() 
> /bin/systemctl daemon-reload >/dev/null 2>&1 || :
> if [ "$1" -ge 1 ] ; then
> # Package upgrade, not uninstall
> /bin/systemctl try-restart %{1}.service >/dev/null 2>&1 || :
> fi

Same applies to the other macros, too.

Otherwise looks pretty good.

Bill, what's your take on this? For some reason we solve very little
with macros like this on Fedora. Not sure why. Should I push for
including macros like this in rpm, or in the systemd packages?

Lennart

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


Re: [systemd-devel] [PATCH] Use /etc/rc.d/rc.local as the path to rc.local in Fedora.

2011-06-27 Thread Lennart Poettering
On Tue, 21.06.11 15:35, Bill Nottingham (nott...@redhat.com) wrote:

> /etc/rc.local is a symlink.

Applied.

Hmm, should we drop the x bit on this script by default, as discussed on IRC?

Lennart

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


Re: [systemd-devel] systemd and swap

2011-06-27 Thread Lennart Poettering
On Thu, 23.06.11 14:02, Michael Olbrich (m.olbr...@pengutronix.de) wrote:

> Hi,

heya,

> I'm getting "Failed to fully start up daemon: No such file or directory"
> when systemd starts.
> It took some time to track it down. Basically swap_enumerate() fails
> because /proc/swaps does not exist.
> Imho this is a valid use-case: This is an embedded system and swap makes no
> sense. I'm not sure how to fix this, but I think swap should just be
> disabled in some way.

Yes, absolutely. We should be able to deal with swap-less systems. The
patch to fix this is probably very easy (just look for ENOENT when we
open /proc/swaps and consider it not an error, plus some checking for
m->proc_swaps here and there). I have now added this to the TODO
list. However, since I do not run kernels like this here I won't be able
to test this and hence am unlikely to fix this anytime soon. However,
I'd be happy to merge a patch if you (or somebody else) supply one.

Lennart

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


Re: [systemd-devel] [PATCH] swap: ignore missing /proc/swaps

2011-06-27 Thread Lennart Poettering
On Fri, 24.06.11 13:43, Michael Olbrich (m.olbr...@pengutronix.de) wrote:

Uh oh, I hadn't seen this patch when I replied to your earlier mail. Sorry.

> Otherwise systemd reports "Failed to fully start up daemon: No such file or
> directory" when swap is disabled in the kernel.

Thanks. Applied.

Lennart

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


Re: [systemd-devel] RFC: creating a set of systemd RPM macros across distributions ?

2011-06-27 Thread Frederic Crozat
Le lundi 27 juin 2011 à 14:24 +0200, Lennart Poettering a écrit :
> On Fri, 24.06.11 15:08, Frederic Crozat (fcro...@suse.com) wrote:
> 
> Heya,
> 
> Sounds good! A few comments:
>  
> > %service_add()
> > if [ "$1" -eq 1 ] ; then 
> > # Initial installation 
> > /bin/systemctl daemon-reload >/dev/null 2>&1 || :
> > fi
> > 
> > %service_add_enabled()
> > if [ "$1" -eq 1 ] ; then 
> > # Initial installation
> > /bin/systemctl enable %{1}.service >/dev/null 2>&1 || :
> > fi
> 
> I'd strongly advise against this. Units might install more than one
> service, and other units instead of services (example: sshd might just
> enable a socket by default, but not a service). Hence we should not
> appaned .service but leave it to the package to specifiy the full name
> and we also need to make sure packagers can specify multiple unit files
> at once.

This question was also spotted on opensuse-packaging and we thought it
should be discussed here :)

So, usage would become :

%post 
%service_add ssh.socket

%post
%service_add_enabled foobar.service 

?

> Bill, what's your take on this? For some reason we solve very little
> with macros like this on Fedora. Not sure why. Should I push for
> including macros like this in rpm, or in the systemd packages?

If we could get some skeleton directly in "upstream" rpm, that would be
awesome ;)

-- 
Frederic Crozat 
SUSE

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


Re: [systemd-devel] BUG: systemd tmpfiles-clean.service trips over afuse stuff in /tmp

2011-06-27 Thread Lennart Poettering
On Thu, 23.06.11 23:05, Kok, Auke-jan H (auke-jan.h@intel.com) wrote:

> Trivial: afuse makes a booboo when encoutering afuse helper stuff in
> /tmp, which is made by my sshfs mounts:
> 
> Jun 23 23:00:24 localhost systemd-tmpfiles[32497]:
> stat(/tmp/afuse-CBUznW/server) failed: Permission denied
> Jun 23 23:00:24 localhost systemd[1]: systemd-tmpfiles-clean.service:
> main process exited, code=exited, status=1
> Jun 23 23:00:24 localhost systemd[1]: Unit
> systemd-tmpfiles-clean.service entered failed state.
> 
> This should probably skip over this file, or ignore it altogether. I'm
> not sure why the failure exit status is needed - it seems to cleanup
> files properly anyway, as I don't see anything over 10d in the tree.

So, we actually skip over files we fail to access, and continue with the
next one, but we do return this as exit code in the end.

I am tempted to say that this behaviour makes a lot of sense, but I can
also understand if you'd prefer it not to return an error exit code.

To understand this better, what is afuse, and why does it return EPERM
for us even though we are root?

Lennart

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


Re: [systemd-devel] RFC: creating a set of systemd RPM macros across distributions ?

2011-06-27 Thread Lennart Poettering
On Mon, 27.06.11 14:34, Frederic Crozat (fcro...@suse.com) wrote:

> > > %service_add_enabled()
> > > if [ "$1" -eq 1 ] ; then 
> > > # Initial installation
> > > /bin/systemctl enable %{1}.service >/dev/null 2>&1 || :
> > > fi
> > 
> > I'd strongly advise against this. Units might install more than one
> > service, and other units instead of services (example: sshd might just
> > enable a socket by default, but not a service). Hence we should not
> > appaned .service but leave it to the package to specifiy the full name
> > and we also need to make sure packagers can specify multiple unit files
> > at once.
> 
> This question was also spotted on opensuse-packaging and we thought it
> should be discussed here :)
> 
> So, usage would become :
> 
> %post 
> %service_add ssh.socket
> 
> %post
> %service_add_enabled foobar.service 
> 
> ?

Well, and maybe even this:

%service_add waldi.socket wuffwuff.service piepapo.service

i.e. allow multiple unit names to be specified at once.

Lennart

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


Re: [systemd-devel] RFC: creating a set of systemd RPM macros across distributions ?

2011-06-27 Thread Frederic Crozat
Le lundi 27 juin 2011 à 14:38 +0200, Lennart Poettering a écrit :
> On Mon, 27.06.11 14:34, Frederic Crozat (fcro...@suse.com) wrote:
> 
> > > > %service_add_enabled()
> > > > if [ "$1" -eq 1 ] ; then 
> > > > # Initial installation
> > > > /bin/systemctl enable %{1}.service >/dev/null 2>&1 || :
> > > > fi
> > > 
> > > I'd strongly advise against this. Units might install more than one
> > > service, and other units instead of services (example: sshd might just
> > > enable a socket by default, but not a service). Hence we should not
> > > appaned .service but leave it to the package to specifiy the full name
> > > and we also need to make sure packagers can specify multiple unit files
> > > at once.
> > 
> > This question was also spotted on opensuse-packaging and we thought it
> > should be discussed here :)
> > 
> > So, usage would become :
> > 
> > %post 
> > %service_add ssh.socket
> > 
> > %post
> > %service_add_enabled foobar.service 
> > 
> > ?
> 
> Well, and maybe even this:
> 
> %service_add waldi.socket wuffwuff.service piepapo.service
> 
> i.e. allow multiple unit names to be specified at once.

It shouldn't be a problem, I just need to refresh my rpm macro
kung-fu ;)

-- 
Frederic Crozat 
SUSE

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


[systemd-devel] encrypted /var with systemd - impossible?

2011-06-27 Thread yoshi watanabe
Hi list (again) ;)

In short : my setup is as follows - i have my / on ssd, so i decided
to move /var over to regular hdd. which is entirely encrypted (lvm
inside luks, /var is one of lvm volumes).

This works just fine on various distributions i tried
(gentoo,arch,exherbo,probably opensuse as well), usually with dracut
as initrd system and their default init systems.

when using systemd, regardless of underlying distribution, system does
not boot correctly. it usually locks up somewhere during boot, waiting
for something.

i tried it with clean default fedora 15 install (just set up /var as
encrypted lvm partition), i also tried it with exherbo and with
gentoo. they all either get stuck, or boot up into half-working
environment.

i suppose that kind of setup appears to be totally
systemd-incompatible. or is it a bug?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] nspawn: spawn shell under specified --user

2011-06-27 Thread Michal Vyskocil
On Mon, Jun 27, 2011 at 02:01:27PM +0200, Lennart Poettering wrote:
> On Fri, 24.06.11 14:39, Michal Vyskocil (mvysko...@suse.cz) wrote:
> 
> > Add -u/--user option, which changes the effective and real user and
> > group id to the new value. The user must exists in the chroot, otherwise
> > it will fail. Both username and user id are accepted.
> 
> Sounds sensible, though I do wonder about the ultimate usefulness of
> this given that this requires user settings configured on the host
> systems in a way that makes sense in the container too. (i.e. the $HOME
> and UID/GID of the user must be in sync in host and in container). Or am
> I missing something?

Yes, that's the requirements - user must exists in chroot. But I don't
see any need why the uid/gid must be the same. All things are done after
chroot("."), so in the context of container.

The original idea behind was user systemd-nspawn instead of chroot for
local builds of our packages on systemd running with systemd. So instead
of chroot su -c $BUILD_COMMAND - $BUILD_USER simply call systemd-nspawn
-u $BUILD_USER $BUILD_COMMAND. I assume something similar have mock
(chroot + special user used for build) used by Fedora, so it might
benefit from that change as well.

I don't know it there's an another usecase, because even if it runs with
different user, it still have a lot of powerfull capabilities.

> 
> > +static struct passwd *getpwun(const char* user) {
> > +
> > +struct passwd *pw;
> > +
> > +pw = getpwnam(user);
> > +
> > +if (!pw && isdigits(user)) {
> > +pw = getpwuid((uid_t)atoi(user));
> > +}
> > +
> > +if (! (pw && pw->pw_name && pw->pw_name[0] && pw->pw_dir && 
> > pw->pw_dir[0]
> > + && pw->pw_passwd)) {
> > +log_error("user name or id %s does not exist: %m", user);
> > +return NULL;
> > +}
> 
> Please work the other way here. Use "safe_atou()" first on the
> username, and if that works it's a numeric uid. If it doesn't try
> getpwnam(). Code that already does this you find in get_user_creds() in
> execute.c.

Reading your code the get_user_creds seems to be a perfect for the 
user-switching in
nspawn as well. What about move it to another location like src/util.c
and use it from both execute.c and nspawn.c?

> 
> > +mkdir_p(pw->pw_dir, 0755);
> > +if (chown(pw->pw_dir, pw->pw_uid, pw->pw_gid) < 0) 
> > {
> > +log_error("chown(%s) failed: %m", 
> > pw->pw_dir);
> > +goto child_fail;
> > +}
> 
> Please use safe_mkdir() here.
Will do

Thanks for the review.

Michal Vyskocil


pgpQaxzfxCk8z.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-analyze plot

2011-06-27 Thread Lennart Poettering
On Wed, 22.06.11 14:25, david.ya...@continental-corporation.com 
(david.ya...@continental-corporation.com) wrote:

> I am currently in the process of analyzing and optimizing a systemd 
> startup in an Embedded project and wondered if someone could tell me what 
> is being performed in the time between 0 and 1 that I see in my plot.svg 
> files produced using systemd-analyze plot.
> 
> Additionally, assuming that this is systemd overhead (dependency 
> creation/module loading) does anyone know of ways to reduce this overhead. 
> I know it is only 1 second but we are always fighting for every 100ms for 
> safety critical applications needed in the early startup phase :-)

This appears to be Fedora, right? So my guess is that this is simply the
initrd. Can you paste the output of "systemctl time" please? that should
tell us how quick the initrd was. (usually it's not the initrd's fault,
really, it's just that the DRI kmods are slow to load, due to monitor
probing and plymouth currently requires to wait for that, although it
really shouldn't).

Ultimately there's a lot we could optimize for systemd here too. For
example, currently when parsing unit files systemd will lookup every
switch linearly in a big table, with strcmps()s. That could relatively
easily be optimized for O(1) with gprof (happy to take such a
patch). But given that this takes 700ms for you (which is extremely
slow, given that we can nowadays boot a full userspace in less than 1s),
I doubt this is the burning issue here.

Lennart

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


Re: [systemd-devel] encrypted /var with systemd - impossible?

2011-06-27 Thread Lennart Poettering
On Mon, 27.06.11 14:49, yoshi watanabe (yoshi...@gmail.com) wrote:

> Hi list (again) ;)
> 
> In short : my setup is as follows - i have my / on ssd, so i decided
> to move /var over to regular hdd. which is entirely encrypted (lvm
> inside luks, /var is one of lvm volumes).
> 
> This works just fine on various distributions i tried
> (gentoo,arch,exherbo,probably opensuse as well), usually with dracut
> as initrd system and their default init systems.
> 
> when using systemd, regardless of underlying distribution, system does
> not boot correctly. it usually locks up somewhere during boot, waiting
> for something.
> 
> i tried it with clean default fedora 15 install (just set up /var as
> encrypted lvm partition), i also tried it with exherbo and with
> gentoo. they all either get stuck, or boot up into half-working
> environment.
> 
> i suppose that kind of setup appears to be totally
> systemd-incompatible. or is it a bug?

This is a bug.

Please boot with "systemd.log_level=debug systemd.log_target=kmsg" and
disable all graphical boot splashes. Then boot, wait until it locks up,
wait a bit more, then post the last generated output from screen.

Lennart

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


Re: [systemd-devel] [PATCH] configure: Add --enable-plymouth option

2011-06-27 Thread Lennart Poettering
On Thu, 23.06.11 17:49, Henry Gebhardt (hsggebha...@googlemail.com) wrote:

> As in the bug[1] it would be nice to configure plymouth support
> independently of the distro. This patch adds a "--enable-plymouth" and
> "--disable-plymouth" option to the configure script to overwrite the
> distro specific default.
> 
> [1] https://bugs.freedesktop.org/show_bug.cgi?id=38460

Hmm, this doesn't apply to git. Could you please rebase? Will merge it
then.

Thanks,

Lennart

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


Re: [systemd-devel] [PATCH] nspawn: spawn shell under specified --user

2011-06-27 Thread Lennart Poettering
On Mon, 27.06.11 14:50, Michal Vyskocil (mvysko...@suse.cz) wrote:

> On Mon, Jun 27, 2011 at 02:01:27PM +0200, Lennart Poettering wrote:
> > On Fri, 24.06.11 14:39, Michal Vyskocil (mvysko...@suse.cz) wrote:
> > 
> > > Add -u/--user option, which changes the effective and real user and
> > > group id to the new value. The user must exists in the chroot, otherwise
> > > it will fail. Both username and user id are accepted.
> > 
> > Sounds sensible, though I do wonder about the ultimate usefulness of
> > this given that this requires user settings configured on the host
> > systems in a way that makes sense in the container too. (i.e. the $HOME
> > and UID/GID of the user must be in sync in host and in container). Or am
> > I missing something?
> 
> Yes, that's the requirements - user must exists in chroot. But I don't
> see any need why the uid/gid must be the same. All things are done after
> chroot("."), so in the context of container.

Hmm, I wonder if this might turn out to be a problem, since the NSS
modules form the container might not be compatible with the host glibc
which we are using.

Hmm, given the rigorous compat logic glibc includes this might be safe,
so let's merge it. If it breaks, then we can still revisit the issue.

> > Please work the other way here. Use "safe_atou()" first on the
> > username, and if that works it's a numeric uid. If it doesn't try
> > getpwnam(). Code that already does this you find in get_user_creds() in
> > execute.c.
> 
> Reading your code the get_user_creds seems to be a perfect for the 
> user-switching in
> nspawn as well. What about move it to another location like src/util.c
> and use it from both execute.c and nspawn.c?

Yupp, go ahead!

Thanks,

Lennart

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


Re: [systemd-devel] systemd and LSB Required/Should-Stop

2011-06-27 Thread Lennart Poettering
On Fri, 24.06.11 14:04, Ville Skyttä (ville.sky...@iki.fi) wrote:

> Hello,
> 
> Am I right that systemd does currently have no support for the LSB
> Required-Stop and Should-Stop keywords?  If yes, are there plans to
> support them in the future?

That is true, we do not support this right now. In systemd the shutdown
order is always the inverse startup order of two services. I am not
entirely opposed to make this more flexible but so far I have not heard
of a good usecase where the flexibility to detach the shutdown oder from
the startup order was necessary. 

> The use case I have is in Fedora's vdr package:
> http://pkgs.fedoraproject.org/gitweb/?p=vdr.git .  The init script's
> stop action uses rtcwake to set the next wakeup time for the box, and
> even though the implementation is hairier than I'd like, it has worked
> well for me before Fedora 15.  But with Fedora 15 and systemd it often
> fails to do its job when shutting down the system (works fine if I just
> stop vdr with the machine running), which causes my PVR box not to wake
> up when it should and consequently missed timed recordings which is very
> annoying.
> 
> The way the init script's stop action handles setting the wakeup time is
> that it looks up the time to set from the /var/run/vdr/next-timer file
> which may or may not be present; if it's not, it grabs the time using
> SVDRP (a simple TCP based protocol) from localhost, and finally if it
> gets the time from one of these sources, writes it to the RTC with
> rtcwake.

Is there any good reason why this isn't stored in the RTC right-away,
when needed? It sounds unnecessarily complex and fragile to delay this
until shutdown.

Also, much simpler and nicer would be to use CLOCK_REALTIME_ALARM which
allows multiple clients to trigger a wakeup from suspend.

> I've done some debugging and when rtcwake fails, it fails because
> /dev/rtc0 is being handled by /sbin/hwclock (hwclock-save.service).  So
> my first thought was to add "hwclock-save" to the init script's
> Should-Stop LSB keyword but that didn't help, so I grepped systemd's
> sources for Should-Stop and found nothing.

We have now removed this unit file in git. However can you elaborate why
exactly these two service conflict when run at the same time? do you
have any error messages?

> I have some thoughts about "fixing" vdr to implement the wakeup time
> stuff better than it does now sometime in the future, but for now
> there's nothing.  Ideas for hacks/workarounds for the init script (see
> above for the gitweb link) I could use to make sure that /var/run and
> localhost networking are available at the time vdr gets stopped at
> shutdown, and that nothing's reserving /dev/rtc0 at that time (so I
> suppose $local_fs, $network, and $time/hwclock-save haven't been
> "stopped" yet)?  Note that I'm stuck with the sysv vdr init script until
> Fedora 16 (can't convert the package to native systemd before that).

If a service A and a service B are ordered against each other
(regardless in which way) then systemd will ensure that when one is
started and the other is stopped, the stopping is done first and the
starting second. That means you can just add any kind of ordering dep
between the two, and things should work.

Lennart

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


[systemd-devel] [PATCH] man/daemon: Use pkg-config as default for --with-systemdsystemunitdir

2011-06-27 Thread Dave Reisner
Behavior is such that:

* if --with-systemdsystemunitdir is specified without arguments, it
  tries to autodetect it using pkg-config
* if --without-systemdsystemunitdir is specified, it does nothing
* if --with-systemdsystemunitdir is specified with an argument, it
  uses that directory

Suggested-by: Balazs Scheidler 
---
This is basically a convenience for development builds of daemons outside the
realm of a package manager where systemd is installed. We're already calling
pkg-config in the help string, but the default value is never assigned. As an
example, if you configure udev with no argument to --with-ssud, it's defined as
"yes" and no units are ever installed.

 man/daemon.xml |   11 +--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/man/daemon.xml b/man/daemon.xml
index d5a8491..6c34200 100644
--- a/man/daemon.xml
+++ b/man/daemon.xml
@@ -785,8 +785,15 @@
 AC_ARG_WITH([systemdsystemunitdir],
 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for 
systemd service files]),
 [], [with_systemdsystemunitdir=$($PKG_CONFIG 
--variable=systemdsystemunitdir systemd)])
-if test "x$with_systemdsystemunitdir" != xno; then
-AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+if test "x$with_systemdsystemunitdir" = "xyes"; then
+systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir 
systemd);
+if test "$systemdsystemunitdir" = ""; then
+AC_MSG_ERROR([Error autodetecting systemdsystemunitdir, 
systemd pkg-config file not found?])
+fi
+elif test "$systemdsystemunitdir" = "no"; then
+systemdsystemunitdir=""
+else
+systemdsystemunitdir="$with_systemdsystemunitdir"
 fi
 AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a 
"x$with_systemdsystemunitdir" != xno ])
 
-- 
1.7.5.4

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


Re: [systemd-devel] Problem with netwrok broadband modem

2011-06-27 Thread Christian Gagneraud

On 27/06/11 12:54, Lennart Poettering wrote:

On Fri, 24.06.11 15:59, Christian Gagneraud (ch...@techworks.ie) wrote:


Hi,

I'm trying to use a USB broadband modem with ofono and connman, when
i plug the modem, i get an error from systemd "Failed to load device
unit: Invalid argument" (full log below).


Hmm, this smells like a bug in systemd.

Do you have any service file for this device installed?


Is it looking for a dev-tty@.device file?


Yes, but usually this should just fail with ENOENT and be ignored. For
some reason this generates EINVAL for you however.


As i'm having trouble to get ofono working, I wonder if the problem
doesn't come from here instead, or even perhaps it's due to the
manufaturer and serial number of the USB device being garbage...


That could actually be. Of course we should fix systemd to handle this.

I wonder how I could easily reproduce this issue here, without that hw.

My first guess is that i's actually the length of the name, and not the
contents of it that triggers the EINVAL.



Could you point me to the right source file and/or functions where I 
could add some debug statement to see if these garbage in the name cause 
troubles.


Actually I don't have a tty@.device file, and I couldn't find any in the 
systemd source archive, neither by googling the web.
My feeling is that I don't need it (I've just read the systemd.device 
man page! ;)) as ofono is started as a service, and it picks up the 
modem as soon as it gets plugged, (via udev rules)
Ofono install a udev 97-ofono.rules)that setup lot of ofono related ENV 
for all supported pluggable modems.
I have as well 60-persistent-serial.rules (shipped with udev), but I 
didn't see any stuff related to systemd (it's just dealing with symlinks).


Note: I finally manage to get ofono (kind of) working. It's not very 
stable but it's a good starting point. So it doesn't seem to be a fatal 
error for me in that case.


So, to summarize:
a - There might be a bug in systemd due to the garbage date in the model 
and manufacturer name. I can try to pin point where does that come from 
with a bit of your help.
b - If the bug above is corrected, systemd would ignore the missing 
tty@.device unit.
c - I could actually use this tty@.device to start ofonod instead of 
starting it at boot time, given the fact that ofonod is useless if 
there's no modem plugged into my board.


Chris




Lennart



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


Re: [systemd-devel] [PATCH] man/daemon: Use pkg-config as default for --with-systemdsystemunitdir

2011-06-27 Thread Lucas De Marchi
On Mon, Jun 27, 2011 at 10:28 AM, Dave Reisner  wrote:
> Behavior is such that:
>
> * if --with-systemdsystemunitdir is specified without arguments, it
>  tries to autodetect it using pkg-config
> * if --without-systemdsystemunitdir is specified, it does nothing
> * if --with-systemdsystemunitdir is specified with an argument, it
>  uses that directory

Why do you need this? Currently if you want to disable systemd you
should pass "--with-systemdsystemunitdir=" which will do exactly the
opposite of what you are proposing. If you do not give a
"--with-systemsystemunitdir" option, it will autodetect with
pkg-config.


Am I missing something? I don't see a reason to change this behavior
and lots of packages already use this. E.g., packages may use
"--with-systemdsystemunitdir=" in 'make distcheck' rule in order to
not break dist.


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


Re: [systemd-devel] [PATCH] Use /etc/rc.d/rc.local as the path to rc.local in Fedora.

2011-06-27 Thread Bill Nottingham
Lennart Poettering (lenn...@poettering.net) said: 
> On Tue, 21.06.11 15:35, Bill Nottingham (nott...@redhat.com) wrote:
> 
> > /etc/rc.local is a symlink.
> 
> Applied.
> 
> Hmm, should we drop the x bit on this script by default, as discussed on IRC?

I'd like to find a better solution than that ... perhaps just %ghosting it.

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


Re: [systemd-devel] encrypted /var with systemd - impossible?

2011-06-27 Thread yoshi watanabe
my guess is that systemd populates /var before mounting it, and then
mounts it over and some files are possibly lost. or maybe because the
/var is empty before mount and that causes problems.

i'll run a debug boot in a minute and post results.

2011/6/27 Lennart Poettering :
> On Mon, 27.06.11 14:49, yoshi watanabe (yoshi...@gmail.com) wrote:
>
>> Hi list (again) ;)
>>
>> In short : my setup is as follows - i have my / on ssd, so i decided
>> to move /var over to regular hdd. which is entirely encrypted (lvm
>> inside luks, /var is one of lvm volumes).
>>
>> This works just fine on various distributions i tried
>> (gentoo,arch,exherbo,probably opensuse as well), usually with dracut
>> as initrd system and their default init systems.
>>
>> when using systemd, regardless of underlying distribution, system does
>> not boot correctly. it usually locks up somewhere during boot, waiting
>> for something.
>>
>> i tried it with clean default fedora 15 install (just set up /var as
>> encrypted lvm partition), i also tried it with exherbo and with
>> gentoo. they all either get stuck, or boot up into half-working
>> environment.
>>
>> i suppose that kind of setup appears to be totally
>> systemd-incompatible. or is it a bug?
>
> This is a bug.
>
> Please boot with "systemd.log_level=debug systemd.log_target=kmsg" and
> disable all graphical boot splashes. Then boot, wait until it locks up,
> wait a bit more, then post the last generated output from screen.
>
> Lennart
>
> --
> Lennart Poettering - Red Hat, Inc.
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Can't enable or start a new service

2011-06-27 Thread Sérgio Basto
On Tue, 2011-06-21 at 18:37 +0200, Lennart Poettering wrote: 
> On Tue, 21.06.11 17:24, Sérgio Basto (ser...@serjux.com) wrote:
> 
> > 
> > On Tue, 2011-06-21 at 12:35 +0200, Lennart Poettering wrote:
> > > These units are *not* installed locally,
> > but I want install it , how I do know what should install ? 
> 
> But why would you want that?

why I want install services that depend on others service ? , to put
computer work correctly . 

> (If you really do, you can always do something like "yum install
> /usr/lib/systemd/system/foobar.service" and yum will do the right thing,
> but again, that's really unnecessary.)

/lib/systemd/system/hal.service, doesn't exist in fedora repos 


-- 
Sérgio M. B.

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


Re: [systemd-devel] [PATCH] nspawn: spawn shell under specified --user

2011-06-27 Thread Ludwig Nussel
Lennart Poettering wrote:
> On Mon, 27.06.11 14:50, Michal Vyskocil (mvysko...@suse.cz) wrote:
> 
> > On Mon, Jun 27, 2011 at 02:01:27PM +0200, Lennart Poettering wrote:
> > > On Fri, 24.06.11 14:39, Michal Vyskocil (mvysko...@suse.cz) wrote:
> > > 
> > > > Add -u/--user option, which changes the effective and real user and
> > > > group id to the new value. The user must exists in the chroot, otherwise
> > > > it will fail. Both username and user id are accepted.
> > > 
> > > Sounds sensible, though I do wonder about the ultimate usefulness of
> > > this given that this requires user settings configured on the host
> > > systems in a way that makes sense in the container too. (i.e. the $HOME
> > > and UID/GID of the user must be in sync in host and in container). Or am
> > > I missing something?
> > 
> > Yes, that's the requirements - user must exists in chroot. But I don't
> > see any need why the uid/gid must be the same. All things are done after
> > chroot("."), so in the context of container.

Not necessarily. If there's a connection to nscd open you will keep
talking to the host.
http://lists.rpm.org/pipermail/rpm-maint/2011-May/003010.html

> Hmm, I wonder if this might turn out to be a problem, since the NSS
> modules form the container might not be compatible with the host glibc
> which we are using.
> 
> Hmm, given the rigorous compat logic glibc includes this might be safe,
> so let's merge it. If it breaks, then we can still revisit the issue.

It did indeed break at least once in the past. glibc 2.2/2.3 or
something like that.

Also keep in mind that you are loading shared libs from the chroot
into the process which is still running as root. So name based user
switching is not a security feature.

cu
Ludwig

-- 
 (o_   Ludwig Nussel
 //\
 V_/_  http://www.suse.de/
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 
16746 (AG Nürnberg) 
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] RFC: creating a set of systemd RPM macros across distributions ?

2011-06-27 Thread Ludwig Nussel
Frederic Crozat wrote:
> [...]
> %service_add_enabled()
> if [ "$1" -eq 1 ] ; then 
> # Initial installation
> /bin/systemctl enable %{1}.service >/dev/null 2>&1 || :
> fi

Does this have an advantage over installing the symlink at build
time already and including the symlink in %files instead?

cu
Ludwig

-- 
 (o_   Ludwig Nussel
 //\
 V_/_  http://www.suse.de/
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 
16746 (AG Nürnberg) 
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] BUG: systemd tmpfiles-clean.service trips over afuse stuff in /tmp

2011-06-27 Thread Kok, Auke-jan H
On Mon, Jun 27, 2011 at 5:35 AM, Lennart Poettering
 wrote:
> On Thu, 23.06.11 23:05, Kok, Auke-jan H (auke-jan.h@intel.com) wrote:
>
>> Trivial: afuse makes a booboo when encoutering afuse helper stuff in
>> /tmp, which is made by my sshfs mounts:
>>
>> Jun 23 23:00:24 localhost systemd-tmpfiles[32497]:
>> stat(/tmp/afuse-CBUznW/server) failed: Permission denied
>> Jun 23 23:00:24 localhost systemd[1]: systemd-tmpfiles-clean.service:
>> main process exited, code=exited, status=1
>> Jun 23 23:00:24 localhost systemd[1]: Unit
>> systemd-tmpfiles-clean.service entered failed state.
>>
>> This should probably skip over this file, or ignore it altogether. I'm
>> not sure why the failure exit status is needed - it seems to cleanup
>> files properly anyway, as I don't see anything over 10d in the tree.
>
> So, we actually skip over files we fail to access, and continue with the
> next one, but we do return this as exit code in the end.
>
> I am tempted to say that this behaviour makes a lot of sense, but I can
> also understand if you'd prefer it not to return an error exit code.
>
> To understand this better, what is afuse, and why does it return EPERM
> for us even though we are root?

afuse is a userspace helper for the fuse filesystem. In my case, I use
it to automount  sshfs

afuse sets up a temp mount point for each automounted fs in /tmp, and
since this is done using credentials, I guess that root is not
permitted to inspect them:

root@desktop /tmp/afuse-CAUhnW # ls -la
ls: cannot access server: Permission denied
total 0
drwx-- 1 sofar sofar   10 Jun 25 16:20 .
drwxrwxrwt 1 root  root  7888 Jun 27 08:30 ..
d? ? ? ??? server

root@hannah /tmp/afuse-CAUhnW # stat server
stat: cannot stat `server': Permission denied

In general, I'm not sure what to do with this case. The error had me
wondering if tmpfile.d did complete, which wasn't entirely clear from
the error message in the service. On top of that, I'd say that it was
successful in the first place, it just encountered something strange
on the way. Worth a syslog message for sure, but I'm not entirely sure
this should result in the service being marked as 'failed', which
"reads" a lot differently.

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


Re: [systemd-devel] Can't enable or start a new service

2011-06-27 Thread Lennart Poettering
On Mon, 27.06.11 16:19, Sérgio Basto (ser...@serjux.com) wrote:

heya,

> On Tue, 2011-06-21 at 18:37 +0200, Lennart Poettering wrote: 
> > On Tue, 21.06.11 17:24, Sérgio Basto (ser...@serjux.com) wrote:
> > 
> > > 
> > > On Tue, 2011-06-21 at 12:35 +0200, Lennart Poettering wrote:
> > > > These units are *not* installed locally,
> > > but I want install it , how I do know what should install ? 
> > 
> > But why would you want that?
> 
> why I want install services that depend on others service ? , to put
> computer work correctly . 

Again, this has nothing to do with whether your machine works
correctly. This is used primarily to order services in a very weak way:
if both services exist order them against each other, if not, then
don't.

So really, there is nothing to fix. To make that clear we hide the
services unless you pass --all. Let me emphasize this: This is no
breakage here, and there is nothing to fix.

> > (If you really do, you can always do something like "yum install
> > /usr/lib/systemd/system/foobar.service" and yum will do the right thing,
> > but again, that's really unnecessary.)
> 
> /lib/systemd/system/hal.service, doesn't exist in fedora repos 

Some LSB init script properly misspelled "hald" as "hal".

Lennart

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


Re: [systemd-devel] [PATCH] nspawn: spawn shell under specified --user

2011-06-27 Thread Lennart Poettering
On Mon, 27.06.11 17:32, Ludwig Nussel (ludwig.nus...@suse.de) wrote:

> 
> Lennart Poettering wrote:
> > On Mon, 27.06.11 14:50, Michal Vyskocil (mvysko...@suse.cz) wrote:
> > 
> > > On Mon, Jun 27, 2011 at 02:01:27PM +0200, Lennart Poettering wrote:
> > > > On Fri, 24.06.11 14:39, Michal Vyskocil (mvysko...@suse.cz) wrote:
> > > > 
> > > > > Add -u/--user option, which changes the effective and real user and
> > > > > group id to the new value. The user must exists in the chroot, 
> > > > > otherwise
> > > > > it will fail. Both username and user id are accepted.
> > > > 
> > > > Sounds sensible, though I do wonder about the ultimate usefulness of
> > > > this given that this requires user settings configured on the host
> > > > systems in a way that makes sense in the container too. (i.e. the $HOME
> > > > and UID/GID of the user must be in sync in host and in container). Or am
> > > > I missing something?
> > > 
> > > Yes, that's the requirements - user must exists in chroot. But I don't
> > > see any need why the uid/gid must be the same. All things are done after
> > > chroot("."), so in the context of container.
> 
> Not necessarily. If there's a connection to nscd open you will keep
> talking to the host.
> http://lists.rpm.org/pipermail/rpm-maint/2011-May/003010.html

Well, but we do not really do any other NSS call, and since NSS is
initialized lazily we should be safe.

> Also keep in mind that you are loading shared libs from the chroot
> into the process which is still running as root. So name based user
> switching is not a security feature.

Well, the man page already clarifies that nspawn is in no way secure. So
I am not too concerned about this. 

Michal's patch adds an optional argument --user. It might be worth
explaining in the man page that by using this you are running into
certain risks.

Lennart

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


Re: [systemd-devel] RFC: creating a set of systemd RPM macros across distributions ?

2011-06-27 Thread Lennart Poettering
On Mon, 27.06.11 17:37, Ludwig Nussel (ludwig.nus...@suse.de) wrote:

> Frederic Crozat wrote:
> > [...]
> > %service_add_enabled()
> > if [ "$1" -eq 1 ] ; then 
> > # Initial installation
> > /bin/systemctl enable %{1}.service >/dev/null 2>&1 || :
> > fi
> 
> Does this have an advantage over installing the symlink at build
> time already and including the symlink in %files instead?

It doesnt right now. But it might eventually: it might be useful to send
out notification events via the bus when a new service is enabled, to
allow live views in UIs.

Lennart

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


Re: [systemd-devel] encrypted /var with systemd - impossible?

2011-06-27 Thread Lennart Poettering
On Mon, 27.06.11 17:04, yoshi watanabe (yoshi...@gmail.com) wrote:

> 
> my guess is that systemd populates /var before mounting it, and then
> mounts it over and some files are possibly lost. or maybe because the
> /var is empty before mount and that causes problems.

systemd is very careful in not using data from /usr or /var before it is
mounted. (After all we introduced /run just to be able to deal with this
kind of problems properly).

So, I doubt that systemd is really doing something wrong here, more
likely some other code involved in early boot is responsible. For
example, the device mapper libs might be trying to access /var/lock or
so. But that's just a guess.

Lennart

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


[systemd-devel] [PATCH] configure: Add --enable-plymouth option

2011-06-27 Thread Henry Gebhardt
As in the bug[1] it would be nice to configure plymouth support
independently of the distro. This patch adds a "--enable-plymouth" and
"--disable-plymouth" option to the configure script to overwrite the
distro specific default.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=38460
---
 configure.ac |   19 +--
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0dd185b..58296b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -349,19 +349,20 @@ SYSTEM_SYSVINIT_PATH=/etc/init.d
 SYSTEM_SYSVRCND_PATH=/etc/rc.d
 
 M4_DISTRO_FLAG=
+have_plymouth=no
 
 case $with_distro in
 fedora)
 SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
 AC_DEFINE(TARGET_FEDORA, [], [Target is Fedora/RHEL])
 M4_DISTRO_FLAG=-DTARGET_FEDORA=1
-   have_plymouth=true
+have_plymouth=yes
 ;;
 suse)
 SYSTEM_SYSVRCND_PATH=/etc/init.d
 AC_DEFINE(TARGET_SUSE, [], [Target is openSUSE/SLE])
 M4_DISTRO_FLAG=-DTARGET_SUSE=1
-   have_plymouth=true
+have_plymouth=yes
 ;;
 debian)
 SYSTEM_SYSVRCND_PATH=/etc
@@ -394,19 +395,19 @@ case $with_distro in
 SYSTEM_SYSVINIT_PATH=/etc/rc.d
 AC_DEFINE(TARGET_FRUGALWARE, [], [Target is Frugalware])
 M4_DISTRO_FLAG=-DTARGET_FRUGALWARE=1
-have_plymouth=true
+have_plymouth=yes
 ;;
 altlinux)
 SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
 AC_DEFINE(TARGET_ALTLINUX, [], [Target is ALTLinux])
 M4_DISTRO_FLAG=-DTARGET_ALTLINUX=1
-   have_plymouth=true
+have_plymouth=yes
 ;;
 mandriva)
 SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
 AC_DEFINE(TARGET_MANDRIVA, [], [Target is Mandriva])
 M4_DISTRO_FLAG=-DTARGET_MANDRIVA=1
-   have_plymouth=true
+have_plymouth=yes
 ;;
 meego)
 SYSTEM_SYSVINIT_PATH=
@@ -457,6 +458,11 @@ AC_ARG_WITH([tty-gid],
 [AC_DEFINE_UNQUOTED(TTY_GID, [$withval], [GID of the 'tty' group])],
 [])
 
+AC_ARG_ENABLE(plymouth, AS_HELP_STRING([--enable-plymouth], [enable plymouth 
support]))
+if test -n "$enable_plymouth"; then
+have_plymouth="$enable_plymouth"
+fi
+
 AM_CONDITIONAL(TARGET_FEDORA, test x"$with_distro" = xfedora)
 AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
 AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
@@ -471,7 +477,7 @@ AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = 
xmandriva)
 AM_CONDITIONAL(TARGET_MEEGO, test x"$with_distro" = xmeego)
 AM_CONDITIONAL(TARGET_ANGSTROM, test x"$with_distro" = xangstrom)
 
-AM_CONDITIONAL(HAVE_PLYMOUTH, test -n "$have_plymouth")
+AM_CONDITIONAL(HAVE_PLYMOUTH, test "$have_plymouth" = "yes")
 AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
 
 AC_ARG_WITH([dbuspolicydir],
@@ -535,6 +541,7 @@ echo "
 SELinux: ${have_selinux}
 ACL: ${have_acl}
 binfmt:  ${have_binfmt}
+plymouth:${have_plymouth}
 prefix:  ${prefix}
 root dir:${with_rootdir}
 udev rules dir:  ${with_udevrulesdir}
-- 
1.7.5.3

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