Re: [systemd-devel] machined: after CPU offline then online, vcpupin KVM guest failed to start

2016-08-05 Thread Dr. Werner Fink
On Fri, Aug 05, 2016 at 11:07:50AM +0200, Lennart Poettering wrote:
> On Thu, 04.08.16 16:19, Cedric Bosdonnat (cbosdon...@suse.com) wrote:
> 
> > Hi Lennart and Werner,
> > 
> > On Wed, 2016-08-03 at 16:56 +0200, Lennart Poettering wrote:
> > > On Wed, 03.08.16 14:46, Dr. Werner Fink (werner at suse.de) wrote:
> > > > problem with v228 (and I guess this is also later AFAICS from logs of
> > > > current git) that repeating CPU hotplug events (offline/online). The
> > > > root cause is that cpuset.cpus become not restored by machined.
> > > > Please note that libvirt can not do this as it is not allowed to do
> > > > so.
> > > 
> > > This is a limitation of the kernel cpuset interface, and it's one of
> > > the reasons we do not expose cpusets at all in systemd right
> > > now. Thankfully, there's an alternative to cpusets, which is the CPU
> > > affinity controls exposed via CPUAffinity= in systemd, which do much
> > > of the same, but have less borked semantics.
> > > 
> > > We'd like to support cpusets directly in systemd, but we don't do this
> > > as long as the kernel interfaces are as borked as they are. For
> > > example, cpusets are flushed out entirely currently when the system
> > > goes through a suspend/resume cycle.
> > > 
> > > If libvirt has hook-ups with cpuset, then it bypasses systemd for
> > > that.
> > 
> > I guess by CPU affinity you mean sched_setaffinity and friends. If that is
> > the case, then this is constrained by cpuset too as mentioned here:
> > 
> > http://www.mjmwired.net/kernel/Documentation/cpusets.txt#53
> > 
> > As long as the machine.slice cpuset isn't restored after onlining a CPU 
> > again,
> > then libvirt won't be able to set either the affinity or the cpuset if it
> > contains that CPU.
> > 
> > May be the kernel's behaviour is weird and can be discussed, but libvirt 
> > can't
> > do anything on that bug.
> 
> Yeah, to make this clear: I do not blame libvirt for this borkedness
> at all. I blame the kernel.

Hmmm ... IMHO it is useless to pass the buck from kernel to user space
as well do the same from user space back to kernel.  I've an open bug
from a customer and this bug requires a solution.  AFAICS libvirt can
not do this but machined could do.

Werner

-- 
  "Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool." -- Edward Burr


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


[systemd-devel] machined: after CPU offline then online, vcpupin KVM guest failed to start

2016-08-03 Thread Dr. Werner Fink
Hi,

problem with v228 (and I guess this is also later AFAICS from logs of
current git) that repeating CPU hotplug events (offline/online). The
root cause is that cpuset.cpus become not restored by machined.
Please note that libvirt can not do this as it is not allowed to do so.

Steps to reproduce:

  1. Configure vCPU pinning.
# virsh vcpupin guest-os 0 0-3 --config
  2. Boot the guest.
# virsh start guest-os
  3. Shutdown the guest.
# virsh shutdown guest-os
  4. Offline one of host CPUs.
# echo 0 > /sys/devices/system/cpu/cpu3/online
  5. Online the host CPU again.
# echo 1 > /sys/devices/system/cpu/cpu3/online
  6. Boot the guest again.
# virsh start guest-os

Actual result:

  error: Failed to start domain guest-os
  error: Unable to write to 
'/sys/fs/cgroup/cpuset/machine.slice/machine-qemu\x2d2\x2dsles12sp2\x2dbeta3.scope/vcpu0/cpuset.cpus':
 Permission denied

Expected result:

  The KVM guest may boot without errors.

this could be done by hand with

  # echo 0-31 > /sys/fs/cgroup/cpuset/machine.slice/cpuset.cpus

as libvirt can't touch the cpuset in machine.slice scope since
this one is owned by machined.

This problem is also discussed at upstream of libvirt

  https://www.redhat.com/archives/libvir-list/2012-April/msg00777.html

and seems to be a well know problem not only here:

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

from the kernel's side this seems to a behavior by design, from right before
the cpuset_hotplug_workfn():

  /*
   * [...]
   * Non-root cpusets are only affected by offlining.  If any CPUs or memory
   * nodes have been taken down, cpuset_hotplug_update_tasks() is invoked on
   * all descendants.
   * [...]
   */

Werner

PS: Using https://github.com/systemd/systemd/issues/new seems to be very limited
with > *NOTE: Do not submit bug reports about anything but the two most recently
 > released systemd versions upstream!*
-- 
  "Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool." -- Edward Burr


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


Re: [systemd-devel] [PATCH] Big endian and the size of the gcc builtin type bool from stdbool.h

2014-09-18 Thread Dr. Werner Fink
On Thu, Sep 18, 2014 at 12:43:00PM +0200, David Herrmann wrote:
 Hi
 
 On Thu, Sep 18, 2014 at 11:16 AM, Werner Fink wer...@suse.de wrote:
  On s390 the big endianness and cast from pointers of integers to
  the type of bool leads to the funny status messages that e.g.
  all targets are set to AllowIsolate=no even for multi-user.target.
 
  The gcc builtin type bool or _Bool has the size of one byte which
  should be taken into account in sd_bus_message_read_basic() as well
  as in bus_message_append_ap()
 
 We don't support bool in public APIs. sd-bus requires you to use
 int for boolean types. If a caller uses bool, they must be fixed.

Then I'd like to know why the header stdbool.h together with the
therein provided type _Bool aka bool is used overall systemd.  Also
it is systemctl which does use sd_bus_message_read_basic() to parse
the answer received over sd_bus of the status question send over
sd_bus?

  linuxadmin:~ # uname -m
  s390x
  linuxadmin:~ # systemctl show multi-user.target | grep -E '=(yes|no)'
  CanStart=no
  CanStop=no
  CanReload=no
  CanIsolate=no
  StopWhenUnneeded=no
  RefuseManualStart=no
  RefuseManualStop=no
  AllowIsolate=no
  DefaultDependencies=no
  IgnoreOnIsolate=no
  IgnoreOnSnapshot=no
  NeedDaemonReload=no
  ConditionResult=no
  Transient=no

 Thanks
 David

Werner

  ---
   src/libsystemd/sd-bus/bus-message.c |   19 +++
   1 files changed, 15 insertions(+), 4 deletions(-)
 
  diff --git src/libsystemd/sd-bus/bus-message.c 
  src/libsystemd/sd-bus/bus-message.c
  index bfb14fc..b70d814 100644
  --- src/libsystemd/sd-bus/bus-message.c
  +++ src/libsystemd/sd-bus/bus-message.c
  @@ -2263,14 +2263,25 @@ int bus_message_append_ap(
   r = sd_bus_message_append_basic(m, *t, x);
   break;
   }
  +case SD_BUS_TYPE_BOOLEAN: {
  +if (sizeof(bool) == sizeof(uint32_t)) {
  +uint32_t x;
 
  -case SD_BUS_TYPE_BOOLEAN:
  +x = va_arg(ap, uint32_t);
  +r = sd_bus_message_append_basic(m, *t, x);
  +} else {
  +uint8_t x;
  +
  +x = (uint8_t) va_arg(ap, int);
  +r = sd_bus_message_append_basic(m, *t, x);
  +}
  +break;
  +}
   case SD_BUS_TYPE_INT32:
   case SD_BUS_TYPE_UINT32:
   case SD_BUS_TYPE_UNIX_FD: {
   uint32_t x;
 
  -/* We assume a boolean is the same as int32_t */
   assert_cc(sizeof(int32_t) == sizeof(int));
 
   x = va_arg(ap, uint32_t);
  @@ -3233,7 +3244,7 @@ _public_ int sd_bus_message_read_basic(sd_bus_message 
  *m, char type, void *p) {
 
   case SD_BUS_TYPE_BOOLEAN:
   if (p)
  -*(int*) p = !!*(uint8_t*) q;
  +*(bool*) p = !!*(uint8_t*) q;
   break;
 
   case SD_BUS_TYPE_INT16:
  @@ -3343,7 +3354,7 @@ _public_ int sd_bus_message_read_basic(sd_bus_message 
  *m, char type, void *p) {
 
   case SD_BUS_TYPE_BOOLEAN:
   if (p)
  -*(int*) p = !!*(uint32_t*) q;
  +*(bool*) p = !!*(uint32_t*) q;
   break;
 
   case SD_BUS_TYPE_INT16:
  --
  1.7.7
-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr


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


Re: [systemd-devel] [PATCH] Big endian and the size of the gcc builtin type bool from stdbool.h

2014-09-18 Thread Dr. Werner Fink
On Thu, Sep 18, 2014 at 01:20:47PM +0200, David Herrmann wrote:
 Hi
 
 On Thu, Sep 18, 2014 at 12:57 PM, Dr. Werner Fink wer...@suse.de wrote:
  On Thu, Sep 18, 2014 at 12:43:00PM +0200, David Herrmann wrote:
  Hi
 
  On Thu, Sep 18, 2014 at 11:16 AM, Werner Fink wer...@suse.de wrote:
   On s390 the big endianness and cast from pointers of integers to
   the type of bool leads to the funny status messages that e.g.
   all targets are set to AllowIsolate=no even for multi-user.target.
  
   The gcc builtin type bool or _Bool has the size of one byte which
   should be taken into account in sd_bus_message_read_basic() as well
   as in bus_message_append_ap()
 
  We don't support bool in public APIs. sd-bus requires you to use
  int for boolean types. If a caller uses bool, they must be fixed.
 
  Then I'd like to know why the header stdbool.h together with the
  therein provided type _Bool aka bool is used overall systemd. Also
 
 We use stdbool internally quite a lot. Especially bit-fields are
 really nice if implemented as bool. We just don't use bool in public
 APIs. We also avoid it in combination with va_arg() and with pointers,
 as in both cases the behavior is non-obvious and often done wrong.

Hmmm ... I'm familiar with big endian (IMHO the natural byte order:)

  it is systemctl which does use sd_bus_message_read_basic() to parse
  the answer received over sd_bus of the status question send over
  sd_bus?
 
 All uses of sd-bus with bool are bugs and need to be fixed. See the
 history of bus-message.c:
 
 commit 9bcbce4201afada1c0ad8ada0cbfbbf58a52a6a7
 Author: Kay Sievers k...@vrfy.org
 Date:   Tue Oct 22 03:27:38 2013 +0200
 
 bus: avoid 'bool' storage when retrieving 'b' from the message
 
 commit 102d8f8169427cb68cdebf5ee0f0e07788e9c2b2
 Author: Kay Sievers k...@vrfy.org
 Date:   Thu Nov 7 02:03:10 2013 +0100
 
 consistently use int when retrieving bool from bus messages

The only problem which remains: on s390 the sd_bus_message_read_basic()
does it internal wrong (IMHO).  If a bool is internal used and send
over the dbus then the internal of sd_bus_message_read_basic()
or at least bus_print_property() should be able to handle this.

Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr


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


Re: [systemd-devel] [PATCH] Big endian and the size of the gcc builtin type bool from stdbool.h

2014-09-18 Thread Dr. Werner Fink
On Thu, Sep 18, 2014 at 01:29:26PM +0200, David Herrmann wrote:
 Hi
 
 On Thu, Sep 18, 2014 at 12:57 PM, Dr. Werner Fink wer...@suse.de wrote:
linuxadmin:~ # uname -m
s390x
linuxadmin:~ # systemctl show multi-user.target | grep -E '=(yes|no)'
CanStart=no
CanStop=no
CanReload=no
CanIsolate=no
StopWhenUnneeded=no
RefuseManualStart=no
RefuseManualStop=no
AllowIsolate=no
DefaultDependencies=no
IgnoreOnIsolate=no
IgnoreOnSnapshot=no
NeedDaemonReload=no
ConditionResult=no
Transient=no
 
 I have a fix for bus_print_property() which is used by systemctl
 show. It used bool instead of int. I will push it in a moment.

OK you're faster, thanks a lot :)

Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr


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


Re: [systemd-devel] [PATCH 06/11] There is no ANSI support on common 3215 consoles

2014-08-01 Thread Dr. Werner Fink
On Fri, Jun 20, 2014 at 07:03:47PM +0200, Lennart Poettering wrote:
 
 Also, we are not going to add code for any specific weird terminal
 settings. We will do three levels: TERM=linux for the full Linux
 console, TERM=vt102 otherwise, and TERM=dumb for the crap that can't do
 TERM=vt102. But we are not going to hardcode support for any other
 hardware into this. This is 2014. If IBM still can't build ANSI support in
 their terminals, then that's the own fault, and they will not get any
 support beyond TERM=dumb and no color. We will not work-around IBM's
 choices in systemd's source tree.
 
 Sorry.

Maybe I'm wrong but this looks like you have no idea how S390x works.
The terminal emulation is done by the linux kernel which uses the
capabilities of the two block oriented terminal interfaces of the
firmware of a s390 (https://en.wikipedia.org/wiki/IBM_3270). One of
the block oriented terminals are able to do coloring (3270) and the
other (3215) is not.  Writing Escape Sequences (including carriage return)
will cause very strange effects with the later block oriented terminal
(3215) and this is the default interface if you to not use

   conmode=3270

to switch to 3270 mode.  With 3270 the kernel then maps Escape Sequences
with the help of linux/drivers/s390/char/tty3270.c onto the real firmware
interface for the chosen block oriented terminal.

I do not think that IBM will ``fix'' their s390 firmware due systemd.
Beside this, what happens if the main system console is a printer
and not a virtual device.  Or what does happen if it is a serial
console which can not handle Escape Sequences or can not handle all
Escape Sequences or use other Escape Sequences as a common VT102?

Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr


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


Re: [systemd-devel] [PATCH 10/11] Avoid doubling the efforts for /var/log/journal

2014-06-18 Thread Dr. Werner Fink
On Mon, Jun 16, 2014 at 11:10:15AM -0400, Cristian Rodríguez wrote:
 El 13/06/14 10:41, Werner Fink escribió:
  That is: set NOATIME, NOCOW, and NOCOMP for the journal directory
  
  ---
   src/journal/journald-server.c |   29 +++--
   1 file changed, 27 insertions(+), 2 deletions(-)
  
  diff --git src/journal/journald-server.c src/journal/journald-server.c
  index eda5dcf..37d6dc3 100644
  --- src/journal/journald-server.c
  +++ src/journal/journald-server.c
  @@ -21,6 +21,7 @@
   
   #include sys/signalfd.h
   #include sys/ioctl.h
  +#include linux/fs.h
   #include linux/sockios.h
   #include sys/statvfs.h
   #include sys/mman.h
  @@ -920,7 +921,7 @@ finish:
   
   
   static int system_journal_open(Server *s) {
  -int r;
  +int r, fd;
 
 _cleanup_close_ ...
 
  +/*
  + * On journaling and/or compressing file systems avoid 
  doubling the
  + * efforts for the system, that is set NOCOW and NOCOMP 
  inode flags.
  + * Check for every single flag as otherwise some of the 
  file systems
  + * may return EOPNOTSUPP on one unkown flag (like BtrFS 
  does).
  + */
  +if ((fd = open(fn, O_DIRECTORY)) = 0) {
 
 O_CLOEXEC...
 
  +long flags;
  +if (ioctl(fd, FS_IOC_GETFLAGS, flags) == 0) {
  +int old = flags;
  +if (!(flagsFS_NOATIME_FL)  ioctl(fd, 
  FS_IOC_SETFLAGS, flags|FS_NOATIME_FL) == 0)
  +flags |= FS_NOATIME_FL;
  +if (!(flagsFS_NOCOW_FL)  ioctl(fd, 
  FS_IOC_SETFLAGS, flags|FS_NOCOW_FL) == 0)
  +flags |= FS_NOCOW_FL;
  +if (!(flagsFS_NOCOMP_FL)  s-compress) {
  +flags = ~FS_COMPR_FL;
  +flags |= FS_NOCOMP_FL;
  +}
  +if (old != flags)
  +ioctl(fd, FS_IOC_SETFLAGS, flags);
  +}
  +close(fd);
  +}
 
 I agree that this should be done, however I remain unconvinced this is
 the right place to do it..

IMHO this is the correct place as it helps to speed up systemd-journal
on BtrFS.  This was the reason for this patch and is tested even if the
patch does not use _cleanup_close_ and O_CLOEXEC ;)


Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr


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


Re: [systemd-devel] [PATCH 01/11] Ensure that systemd-sysctl.service is applied after modules are loaded

2014-06-18 Thread Dr. Werner Fink
On Mon, Jun 16, 2014 at 06:02:37PM +0200, Tom Gundersen wrote:
 On Mon, Jun 16, 2014 at 5:19 PM, Frederic Crozat fcro...@suse.com wrote:
 
  See https://bugzilla.novell.com/show_bug.cgi?id=725412
 
 Hm, that really does not look convincing. There is a fundamental
 problem here (as Ludwig Nessel points out in the linked discussion:
 sysctl is broken by design unfortunately.), and the discussion nor
 the patch do not get to the bottom of that.
 
 Moreover, (essentially) this patch was already posted and rejected
 last year. Lennart then wrote:
 
 Well, most modules are loaded asynchronously from udev, so I fear this
 won't do much...
 
 /etc/sysctl.d/ is really only for sysctl settings that exist all the
 time, and -- as a special exception -- for network-device related
 settings, which we set via a udev rule.
 
 If people want to apply sysctls based on specific modules that are
 loaded, or based on specific hw that shows up (i.e. hw that isn't a
 network device) the only sane way is probably via a udev rule...

The only problem with udev rules is that many system administrators
do not know enough how to write and how to place such rules.  What
about simple dependencies for such sysctl settings for specific modules.
Maybe by using a special name spavce below sysctl.d directories or a
special comment within the configure files below modules-load.d
directories.  Or similar like the unit configuration of services.

Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr


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


Re: [systemd-devel] [PATCH 07/11] Support init=/bin/bash on the kernel command line

2014-06-16 Thread Dr. Werner Fink
On Fri, Jun 13, 2014 at 05:49:24PM +0200, Tom Gundersen wrote:
 On Fri, Jun 13, 2014 at 4:41 PM, Werner Fink wer...@suse.de wrote:
  From: Ruediger Oertel r...@suse.de
 
  Process 1 (aka init) needs to be started with an empty signal mask.
  That includes the process 1 that's started after the initrd is finished.
  When the initrd is using systemd (as it does with dracut based initrds)
  then it is systemd that calls the real init.  Normally this is systemd
  again, except when the user uses for instance init=/bin/bash on the
  kernel command line.
 
 Why is this necessary for /bin/bash, but not for /lib/systemd/systemd?
 Please include the explanation in the commit message.

I do not understand your question.  AFAIK the signal mask is set by
systemd accordingly to man:systemd.service(5) ... the only problem
with this schem is that /bin/bash nor any other shell does reset
its signal mask.  I guess that systemd will support the init=/bin/bash
on the kernel command line.  IMHO this requires a clean signal mask.

Werner


  ---
   src/core/main.c |9 +
   1 file changed, 9 insertions(+)
 
  diff --git src/core/main.c src/core/main.c
  index d5d1ee2..c082354 100644
  --- src/core/main.c
  +++ src/core/main.c
  @@ -1831,6 +1831,7 @@ finish:
   if (reexecute) {
   const char **args;
   unsigned i, args_size;
  +sigset_t ss, o_ss;
 
   /* Close and disarm the watchdog, so that the new
* instance can reinitialize it, but doesn't get
  @@ -1914,6 +1915,11 @@ finish:
   args[i++] = NULL;
   assert(i = args_size);
 
  +/* reenable any blocked signals, especially important
  + * if we switch from initial ramdisk to init=... */
  +sigemptyset(ss);
  +sigprocmask(SIG_SETMASK,ss,o_ss);
  +
   if (switch_root_init) {
   args[0] = switch_root_init;
   execv(args[0], (char* const*) args);
  @@ -1932,6 +1938,9 @@ finish:
   log_error(Failed to execute /bin/sh, giving up: 
  %m);
   } else
   log_warning(Failed to execute /sbin/init, giving 
  up: %m);
  +
  +/* back to saved state if reexec failed */
  +sigprocmask(SIG_SETMASK,o_ss,NULL);
   }
 
   if (arg_serialization) {
  --
  1.7.9.2

Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr


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


Re: [systemd-devel] [PATCH 01/11] Ensure that systemd-sysctl.service is applied after modules are loaded

2014-06-16 Thread Dr. Werner Fink
On Fri, Jun 13, 2014 at 05:51:34PM +0200, Tom Gundersen wrote:
 On Fri, Jun 13, 2014 at 4:41 PM, Werner Fink wer...@suse.de wrote:
  From: Frederic Crozat fcro...@suse.com
 
 Hm, this would not help at all for modules loaded on-demand (which are
 most of them). What is the problem being solved here?

Indeed this does not help for the loaded on-demand modules as this requires
an other approach.  Nevertheless for the modules loaded by the service
systemd-modules-load.service it helps to load the the kernel parameters
afterwards as with many modules there will be *new* entiers below /proc/sys/

  ---
   units/systemd-sysctl.service.in |2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
 
  diff --git units/systemd-sysctl.service.in units/systemd-sysctl.service.in
  index 5baf22c..c4bc0da 100644
  --- units/systemd-sysctl.service.in
  +++ units/systemd-sysctl.service.in
  @@ -10,7 +10,7 @@ Description=Apply Kernel Variables
   Documentation=man:systemd-sysctl.service(8) man:sysctl.d(5)
   DefaultDependencies=no
   Conflicts=shutdown.target
  -After=systemd-readahead-collect.service systemd-readahead-replay.service
  +After=systemd-readahead-collect.service systemd-readahead-replay.service 
  systemd-modules-load.service
   Before=sysinit.target shutdown.target
   ConditionPathIsReadWrite=/proc/sys/
   ConditionDirectoryNotEmpty=|/lib/sysctl.d
  --
  1.7.9.2

Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr


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


Re: [systemd-devel] [PATCH 11/11] Make redirections work with the bash command completions

2014-06-16 Thread Dr. Werner Fink
:COMP_CWORD}; then
  +return 0
  +fi
  +
   for ((i=0; i  COMP_CWORD; i++)); do
   if __contains_word ${COMP_WORDS[i]} ${verbs[@]} 
! __contains_word ${COMP_WORDS[i-1]} ${OPTS[ARG]}; then
  @@ -94,4 +98,4 @@ _udevadm() {
   return 0
   }
   
  -complete -F _udevadm udevadm
  +complete -o default -o bashdefault -F _udevadm udevadm
  -- 
  1.7.9.2
  
  ___
  systemd-devel mailing list
  systemd-devel@lists.freedesktop.org
  http://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- 
 Dr. Werner Fink -- Software Engineer Consultant
 SuSE LINUX Products GmbH,  Maxfeldstrasse 5,  Nuernberg,  Germany
 GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer,  HRB 21284 (AG Nuernberg)
 phone: +49-911-740-53-0,  fax: +49-911-3206727,  www.opensuse.org
--
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr


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


Re: [systemd-devel] [PATCH 07/11] Support init=/bin/bash on the kernel command line

2014-06-16 Thread Dr. Werner Fink
On Mon, Jun 16, 2014 at 02:51:47PM +0200, David Herrmann wrote:
 Hi
 
 
 The question was, why is this fix related to init=/bin/bash? What does
 bash do different than systemd that it requires this fix? That
 information should be placed in the commit-message.
 
 The fix itself looks good and if you called it restore signal-mask
 before executing init= it'd be fine. However, calling it support
 init=/bin/bash implies that this is only needed for init=/bin/bash.
 This, however, is just a side-effect of this fix, because systemd
 simply doesn't care for the initial sigmask.
 
 I'll fix up the commit-msg and apply it. No need to resend.

Thanks a lot
Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr


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


Re: [systemd-devel] [PATCH] s390/getty-generator: initialize essential system terminals/consoles

2014-02-05 Thread Dr. Werner Fink
On Wed, Feb 05, 2014 at 12:19:21PM +0100, Hendrik Brueckner wrote:
  
  is not listed at least with 208.  Nevertheless the nodes are there
 
 The 3270 devices should be tagged for systemd in the 99-systemd.rules file.

Thanks, just done a few minutes before and it works if I do a symlink
serial-getty@3270-tty1.service below /etc/systemd/system/getty.target.wants to
/usr/lib/systemd/system/serial-getty@.service.  Also Hannes and I have send
a patch to linux-kernel[1] to enable user space aka systemd to handle
3270 devices.

Werner


[1] http://lkml.indiana.edu/hypermail/linux/kernel/1402.0/02319.html
-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr


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


Re: [systemd-devel] [PATCH] s390/getty-generator: initialize essential system terminals/consoles

2014-02-04 Thread Dr. Werner Fink
On Tue, Feb 04, 2014 at 02:25:06PM +0100, Lennart Poettering wrote:
 On Mon, 03.02.14 14:44, Hannes Reinecke (h...@suse.de) wrote:
 
  
  Which raises the question: what exactly should be 'active' contain?
  The console name (which doesn't have any equivalent in sysfs), or
  the tty name (which has)?
 
 Userspace expects that /sys/class/tty/console/active refers to a valid
 tty name, and that /sys/class/tty/tty0/active refers to a valid VT tty
 name.

Even if the identifier string of tty3270.c becomes 3270/tty it seems
that something goes wrong as in show_cons_active() of drivers/tty/tty_io.c
the name_base of the struct tty_driver is not honored.

Also on s390 the device for 3270/tty its self is not plugged:

  systemctl list-units | grep virtual-tty | sed 's/^/  /'
  sys-devices-virtual-tty-hvc0.device   loaded active plugged   
/sys/devices/virtual/tty/hvc0
  sys-devices-virtual-tty-hvc1.device   loaded active plugged   
/sys/devices/virtual/tty/hvc1
  sys-devices-virtual-tty-hvc2.device   loaded active plugged   
/sys/devices/virtual/tty/hvc2
  sys-devices-virtual-tty-hvc3.device   loaded active plugged   
/sys/devices/virtual/tty/hvc3
  sys-devices-virtual-tty-hvc4.device   loaded active plugged   
/sys/devices/virtual/tty/hvc4
  sys-devices-virtual-tty-hvc5.device   loaded active plugged   
/sys/devices/virtual/tty/hvc5
  sys-devices-virtual-tty-hvc6.device   loaded active plugged   
/sys/devices/virtual/tty/hvc6
  sys-devices-virtual-tty-hvc7.device   loaded active plugged   
/sys/devices/virtual/tty/hvc7
  sys-devices-virtual-tty-ttysclp0.device   loaded active plugged   
/sys/devices/virtual/tty/ttysclp0

as the existing directory

  /sys/devices/virtual/tty/3270!tty1

is not listed at least with 208.  Nevertheless the nodes are there

  ll /dev/3270/tty1 
  crw--w 1 root tty 227, 1 Feb  4 15:51 /dev/3270/tty1

but a `dev-3270-tty1.device' seems not to be usable.

Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr


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


Re: [systemd-devel] [PATCH] s390/getty-generator: initialize essential system terminals/consoles

2014-02-03 Thread Dr. Werner Fink
On Mon, Feb 03, 2014 at 03:07:04PM +0100, Hendrik Brueckner wrote:
 On Mon, Feb 03, 2014 at 02:44:43PM +0100, Hannes Reinecke wrote:
 
  But that's not a requirement anywhere in the console code.
  Quite the contrary; tty drivers have the 'first_minor' entry
  to explicit request an offset other than '0'.
  
  (And the console driver has an explict '-device' callback
  which allows the tty driver to return the correct index.
  Not that it's used here; would've been too easy).
  
  So how to fix this?
  Update the driver to adhere to the (broken) current behaviour?
  Or modify 'active' to return the corrent tty name?
 
 That's probably a good option but might break existing applications that rely
 on what is in active.  Alternatively add a new sysfs attribute to display
 console's associated terminal devices.
 
 ... or don't look at the console at all and start getty's on those terminal
 devices that are available.

Just to say it: there already is a /proc/consoles which does show
the active devices of the system console.   As the name of the console
driver ans the index is not unique also the major and minor of the
active decvices are shown.


  Or add a workaround to systemd?

The /proc/consoles is not a sysfs attribute.

Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr


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


Re: [systemd-devel] [PATCH] Avoid a busy systemd-journald in LXC environments

2013-12-19 Thread Dr. Werner Fink
On Wed, Dec 18, 2013 at 07:30:57PM +0100, Lennart Poettering wrote:
 On Wed, 18.12.13 15:30, Dr. Werner Fink (wer...@suse.de) wrote:
 
   Anyway, I suggested in my original reply that I'd be happy to merge a
   patch that downgrades the warning message to debug on ENOENT. I have now
   made such a change in git, and also added another change that closes
   /dev/kmsg if we cannot make use of it anyway.
  
  See the attched patch.
 
 Hmm? Not following. I said I already made the change I proposed
 originally. Your patch seems to do the same thing again? 

Sorry for that. Also the `goto fail' is (IMHO) the better way to do this.

Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr


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


Re: [systemd-devel] [PATCH] Avoid a busy systemd-journald in LXC environments

2013-12-18 Thread Dr. Werner Fink
On Tue, Dec 17, 2013 at 08:06:39PM +0100, Lennart Poettering wrote:
 
 But why? LXC should either provide a working /dev/kmsg or none at
 all. Providing something that doesn't work where we then have to check
 with a lot of code if they are playing games with us or not is not an
 option really, sorry.

In the meanwhile the default LXC setup has been changed by the LXC
people.  Nevertheless I'm fairly certain the I'll see an other report
about this difficulty especially  from experienced adminstrators using
their own LXC setup.

 Anyway, I suggested in my original reply that I'd be happy to merge a
 patch that downgrades the warning message to debug on ENOENT. I have now
 made such a change in git, and also added another change that closes
 /dev/kmsg if we cannot make use of it anyway.

See the attched patch.

 
 (Also, log_warning() and friends save/restore errno internally. And
 instead of repeating destruction paths in all if branches is something
 we don't do. Use goto to some unified destruction path at the end of
 the call. And running non-trivial functions from if checks is also not
 that a good idea).

Maybe an other interface in libudev for checking common devices would
help a lot.

 Anyway, with the code now in git, is there still something left to do to
 make journald work nicely with a properly set up LXC for you?

Currently I've reports with journaling/compressing file systems in the case
systemd-journald is flushing its journal to /var/log/journal/id/system.journal
which causes high system load if the journal is listed with journalctl.

Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr
From 83a217228a96fe4ff05ec3972838acfd261575a7 Mon Sep 17 00:00:00 2001
From: Werner Fink wer...@suse.de
Date: Wed, 18 Dec 2013 15:03:55 +0100
Subject: [PATCH] Do not warn on not existing /dev/kmsg as in LXC
 environments. If the resulting file descriptor can not be
 polled simply close it.

---
 src/journal/journald-kmsg.c |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git src/journal/journald-kmsg.c src/journal/journald-kmsg.c
index bc42548..4d1f48f 100644
--- src/journal/journald-kmsg.c
+++ src/journal/journald-kmsg.c
@@ -398,13 +398,18 @@ int server_open_dev_kmsg(Server *s) {
 
 s-dev_kmsg_fd = open(/dev/kmsg, O_RDWR|O_CLOEXEC|O_NONBLOCK|O_NOCTTY);
 if (s-dev_kmsg_fd  0) {
-log_warning(Failed to open /dev/kmsg, ignoring: %m);
+/* Do not warn as it may not exists in e.g. LXC environments */
+log_full(errno == ENOENT ? LOG_DEBUG : LOG_WARNING,
+ Failed to open /dev/kmsg, ignoring: %m);
 return 0;
 }
 
 r = sd_event_add_io(s-event, s-dev_kmsg_fd, EPOLLIN, dispatch_dev_kmsg, s, s-dev_kmsg_event_source);
 if (r  0) {
 
+close_nointr_nofail(s-dev_kmsg_fd);
+s-dev_kmsg_fd = -1;
+
 /* This will fail with EPERM on older kernels where
  * /dev/kmsg is not readable. */
 if (r == -EPERM)
-- 
1.7.9.2



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


Re: [systemd-devel] [PATCH] Avoid a busy systemd-journald in LXC environments

2013-12-17 Thread Dr. Werner Fink
On Tue, Dec 10, 2013 at 09:53:22PM +0100, Lennart Poettering wrote:

Sorry for the late answer but I had been away sick last week ...

 On Mon, 02.12.13 16:27, Werner Fink (wer...@suse.de) wrote:
 
  that is the systemd-journald may ignore /dec/kmsg which are not a valid
  device but a lint to /dev/null as done in LinuX Containers (LXC).  This
  change adds straight forward a check for /dev/kmsg.
  
  Signed-off-by: Werner Fink wer...@suse.de
 
 We don't use S-o-b in systemd...

OK

[...]

  +
  +if (fstat(s-dev_kmsg_fd, st)  0) {
  +log_error(Failed to stat /dev/kmsg fd, ignoring: %m);
  +close_nointr_nofail(s-dev_kmsg_fd);
  +s-dev_kmsg_fd = -1;
  +return 0;
  +}
  +
  +if (!S_ISCHR(st.st_mode) || major(st.st_rdev) != 1 || 
  minor(st.st_rdev) != 11) {
  +int old_errno = errno;
  +errno = ENODEV;
  +log_warning(Irregular device /dev/kmsg, ignoring: %m);
  +errno = old_errno;
  +close_nointr_nofail(s-dev_kmsg_fd);
  +s-dev_kmsg_fd = -1;
 
 I am really not convinced by this. LXC should either not set up
 /dev/kmsg, or should do it in a way that doesn't create problems with
 what userspace expects. I am pretty sure the onus here is on LXC to
 provide something that is compatible or nothing at all...
 
 Also, we do not hardcode major/minor pairs. Ever.

Would be something like

+if (fstat(s-dev_kmsg_fd, st)  0) {
+log_error(Failed to stat /dev/kmsg fd, ignoring: %m);
+close_nointr_nofail(s-dev_kmsg_fd);
+s-dev_kmsg_fd = -1;
+return 0;
+}
+
+if (!S_ISCHR(st.st_mode) || !(ud = 
udev_device_new_from_devnum(s-udev, 'c', st.st_rdev))) {
+int old_errno = errno;
+errno = ENODEV;
+log_warning(Irregular device /dev/kmsg, ignoring: %m);
+errno = old_errno;
+close_nointr_nofail(s-dev_kmsg_fd);
+s-dev_kmsg_fd = -1;
+return 0;
+}
+
+if (strcmp(/dev/kmsg, udev_device_get_devnode(ud)) != 0) {
+int old_errno = errno;
+errno = EPFNOSUPPORT;
+log_warning(Irregular device /dev/kmsg, ignoring: %m);
+errno = old_errno;
+close_nointr_nofail(s-dev_kmsg_fd);
+s-dev_kmsg_fd = -1;
+return 0;
+}
+
+udev_device_unref(ud);

OK for you? I've that tested yet but before doing this I'd like to know if this
would be accepted.


Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr


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


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

2013-11-26 Thread Dr. Werner Fink
On Tue, Nov 26, 2013 at 10:41:36AM +, Colin Guthrie wrote:
 'Twas brillig, and Martin Pitt at 26/11/13 06:19 did gyre and gimble:
  Hey Lennart,
  
  Lennart Poettering [2013-11-26  5:12 +0100]:
  I implemented this now, using a different approach than Martin's
  original patch (i.e. I don't think it is a good idea to involve stat()
  here, instead let's just let logind pass all information to
  pam_systemd).
  
  Thanks!
 
 Indeed, thanks for this!
 
 If anyone backports this fix to v208 (i.e. pre sd-bus) please share it
 here. I'll likely do it just to have the upstream-blessed fix, but
 doubt I'll get around it it until later in the week.

I've backported it.  But during tests I've found that it does not help
if the environment variable XDG_RUNTIME_DIR already exists before doing
su.  It will not unset but exported.

Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-11-26 Thread Dr. Werner Fink
On Tue, Nov 26, 2013 at 02:39:49PM +, Colin Guthrie wrote:
 'Twas brillig, and Dr. Werner Fink at 26/11/13 14:21 did gyre and gimble:
  On Tue, Nov 26, 2013 at 10:41:36AM +, Colin Guthrie wrote:
  'Twas brillig, and Martin Pitt at 26/11/13 06:19 did gyre and gimble:
  Hey Lennart,
 
  Lennart Poettering [2013-11-26  5:12 +0100]:
  I implemented this now, using a different approach than Martin's
  original patch (i.e. I don't think it is a good idea to involve stat()
  here, instead let's just let logind pass all information to
  pam_systemd).
 
  Thanks!
 
  Indeed, thanks for this!
 
  If anyone backports this fix to v208 (i.e. pre sd-bus) please share it
  here. I'll likely do it just to have the upstream-blessed fix, but
  doubt I'll get around it it until later in the week.
  
  I've backported it.
 
 Can you link to it or attach it please?

Yep ...

  But during tests I've found that it does not help
  if the environment variable XDG_RUNTIME_DIR already exists before doing
  su.  It will not unset but exported.
 
 That's expected.
 
 su does not do any env cleaning, su - does, sudo does, pkexec does.

I'm aware ;) neverthelesss ...

 
 su's behaviour is to always not touch stuff and thus this is known and
 expected and has always been a problem.
 
 Longer term we need to solve this more holistically (hence why I've
 tried to get information about how things should be done in the future
 to start helping lay the ground work for thise bits), but this is still
 the best fix we have just now.
 
 For the specific case of su'ing to root, (which is the most common and
 potentially problematic one), I will probably use Colin W's most recent
 patch to have a static root runtime dir and for logind to set it. This
 should fix XDG_RUNTIME_DIR when su'ing to root. I'm not so worried about
 su'ing to other users (the damage that can be done is much more
 limited), but longer term we do need to address that nicely too IMO
 (which will likely need changes in su itself and a number of other places)

... I've a bug report here which indeed shows exactly the ``other'' problem.
If you do not like the enhancement in my backport you may replace

+} else {
+(void) unsetenv(XDG_RUNTIME_DIR);
+r = pam_putenv(handle, XDG_RUNTIME_DIR);
+if (r != PAM_SUCCESS  r != PAM_BAD_ITEM) {
+ pam_syslog(handle, LOG_ERR, Failed to unset runtime 
dir.);
+}

with `}'  ... otherwise both the pam_putenv() and unsetenv() are required
to make sure that XDG_RUNTIME_DIR is removed.

Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr
Based on upstream baae0358f349870544884e405e82e4be7d8add9f
| From: Lennart Poettering lenn...@poettering.net
| Date: Tue, 26 Nov 2013 04:05:00 +
| Subject: pam_systemd: do not set XDG_RUNTIME_DIR if the session's original user is not the same as the newly logged in one
| It's better not to set any XDG_RUNTIME_DIR at all rather than one of a
| different user. So let's do this.
--- systemd-208/src/login/logind-dbus.c
+++ systemd-208/src/login/logind-dbus.c	2013-11-26 13:37:05.730735774 +
@@ -523,6 +523,7 @@ static int bus_manager_create_session(Ma
 DBUS_TYPE_OBJECT_PATH, path,
 DBUS_TYPE_STRING, session-user-runtime_path,
 DBUS_TYPE_UNIX_FD, fifo_fd,
+DBUS_TYPE_UINT32, session-user-uid,
 DBUS_TYPE_STRING, cseat,
 DBUS_TYPE_UINT32, vtnr,
 DBUS_TYPE_BOOLEAN, exists,
--- systemd-208/src/login/logind-session-dbus.c
+++ systemd-208/src/login/logind-session-dbus.c	2013-11-26 13:36:07.478236401 +
@@ -755,6 +755,7 @@ int session_send_create_reply(Session *s
 DBUS_TYPE_OBJECT_PATH, path,
 DBUS_TYPE_STRING, s-user-runtime_path,
 DBUS_TYPE_UNIX_FD, fifo_fd,
+DBUS_TYPE_UINT32, s-user-uid,
 DBUS_TYPE_STRING, cseat,
 DBUS_TYPE_UINT32, vtnr,
 DBUS_TYPE_BOOLEAN, exists,
--- systemd-208/src/login/pam-module.c
+++ systemd-208/src/login/pam-module.c	2013-11-26 14:32:20.194235777 +
@@ -93,24 +93,18 @@ static int get_user_data(
 assert(ret_username);
 assert(ret_pw);
 
-r = audit_loginuid_from_pid(0, uid);
-if (r = 0)
-pw = pam_modutil_getpwuid(handle, uid);
-else {
-r = pam_get_user(handle, username, NULL);
-if (r != PAM_SUCCESS) {
-pam_syslog(handle, LOG_ERR, Failed to get user name.);
-return r

Re: [systemd-devel] systemd, getty and udev

2011-03-21 Thread Dr. Werner Fink
On Mon, Mar 21, 2011 at 02:58:22PM +0100, Jan Engelhardt wrote:
 On Monday 2011-03-21 12:26, Michael Olbrich wrote:
 
 Hi,
 
 I've been playing with systemd. So far I have been unable to get a login
 prompt. The problem is this:
 
 [...]
 systemd[1]: Job dev-ttyAMA0.device/start timed out.
 systemd[1]: Job dev-ttyAMA0.device/start finished, result=timeout
 systemd[1]: Job serial-getty@ttyAMA0.service/start finished, 
 result=dependency
 [...]
 
 This is reminiscient of 
 https://bugzilla.novell.com/show_bug.cgi?id=679165
 
 The default systemd files only start getties on a handful of ttys. Since 
 it seems impossible to distinguish between display ttys and e.g. modem 
 ttys, one can't just simply start gettys on all tty*, thus necessiting 
 manual addition for further ttys in the udev rules.

It is possible to distinguish between virtual displays and
e.g. modem ttys.  Just have a look at the attachment.
Here I've ported the most features of the mingetty (1.0.8s)
of openSUSE to the agetty of util-linux (2.19) simply to
test it out.

Now with the ioctl TIOCMGET on a modem/serial line the status
bits of a modem can be determined.  The ioctl TIOCMGET will
fail with EINVAL on virtual displays.


 Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr
--- agetty.c
+++ agetty.c	2011-03-18 15:05:19.767926623 +
@@ -18,6 +18,7 @@
 #include stdlib.h
 #include string.h
 #include termios.h
+#include sys/ioctl.h
 #include signal.h
 #include errno.h
 #include sys/types.h
@@ -31,6 +32,11 @@
 #include sys/file.h
 #include sys/socket.h
 #include netdb.h
+#include sys/kd.h
+#include grp.h
+#include locale.h
+#include iconv.h
+#include wctype.h
 
 #include strutils.h
 #include nls.h
@@ -40,6 +46,16 @@
 #ifdef __linux__
 #include sys/param.h
 #define USE_SYSLOG
+#ifndef IUTF8
+#  error IUTF8 input flag not defined
+#endif
+#endif
+
+#ifndef DEFAULT_VCTERM
+#define DEFAULT_VCTERM	linux
+#endif
+#ifndef DEFAULT_STERM
+#define DEFAULT_STERM	vt100
 #endif
 
  /* If USE_SYSLOG is undefined all diagnostics go directly to /dev/console. */
@@ -75,6 +91,7 @@
 #endif
 
 #define LOGIN  login: 		/* login prompt */
+#define ARRAY_SIZE_MAX	16
 
 /* Some shorthands for control characters. */
 
@@ -116,13 +133,20 @@
 struct options {
 int flags;			/* toggle switches, see below */
 int timeout;			/* time-out period */
+char   *autolog;			/* login the user automatically */
+char   *chdir;			/* Chdir before the login */
+char   *chroot;			/* Chroot before the login */
 char   *login;			/* login program */
+char   *logopt;			/* options for login program */
 char   *tty;			/* name of tty */
+char   *vcline;			/* line of virtual console  */
+char   *term;			/* terminal type  */
 char   *initstring;			/* modem init string */
 char   *issue;			/* alternative issue file */
+int delay;			/* Sleep seconds before prompt */
+int nice;			/* Run login with this priority */
 int numspeed;			/* number of baud rates to try */
 int speeds[MAX_SPEED];		/* baud rates to be tried */
-int eightbits;			/* assume 8bit-clean tty */
 };
 
 #define	F_PARSE		(10)		/* process modem status messages */
@@ -136,6 +160,16 @@ struct options {
 #define F_LCUC		(18)		/* Support for *LCUC stty modes */
 #define F_KEEPSPEED	(19)		/* Follow baud rate from kernel */
 #define F_KEEPCFLAGS	(110)		/* Reuse c_cflags setup from kernel */
+#define F_NOHANGUP	(111)		/* No not call vhangup(2) */
+#define F_VCONSOLE	(112)		/* This is a virtual console */
+#define F_UTF8		(113)		/* We can do UTF8 */
+#define F_LOGINPAUSE	(114)		/* Wait for any key before dropping login prompt */
+#define F_NOCLEAR	(115)		/* Do not clear the screen before prompting */
+#define F_NONL		(116)		/* No newline before issue */
+#define F_NORESET	(117)		/* No reset on virtual consoles */
+#define F_NOHOSTNAME	(118)		/* Do not show the hostname */
+#define F_LONGHNAME	(119)		/* Show Full qualified hostname */
+#define F_EIGHTBITS	(120)		/* Assume 8bit-clean tty */
 
 /* Storage for things detected while the login name was read. */
 
@@ -159,7 +193,7 @@ struct chardata init_chardata = {
 
 struct Speedtab {
 longspeed;
-int code;
+speed_t  code;
 };
 
 static struct Speedtab speedtab[] = {
@@ -202,28 +236,35 @@ static struct Speedtab speedtab[] = {
 
 #define P_(s) s
 int main P_((int argc, char **argv));
-void parse_args P_((int argc, char **argv, struct options *op));
-void parse_speeds P_((struct options *op, char *arg));
-void update_utmp P_((char *line));
-void open_tty P_((char *tty, struct termios *tp, int local));
-void termio_init P_((struct termios *tp, struct options *op));
-void auto_baud P_((struct termios *tp));
-void do_prompt P_((struct options *op, struct termios *tp));
-void next_speed P_((struct termios *tp, struct options *op));
-char *get_logname P_((struct options *op, struct chardata *cp, struct 

Re: [systemd-devel] /usr on separate file system

2011-03-07 Thread Dr. Werner Fink
On Sat, Feb 26, 2011 at 05:09:03PM +0100, Lennart Poettering wrote:
 On Fri, 25.02.11 13:35, Adam Spragg (a...@spra.gg) wrote:
 
  
  On Friday 25 Feb 2011 13:00:51 Andrey Borzenkov wrote:
   Commit
   http://cgit.freedesktop.org/systemd/commit/?id=80758717a6359cbe6048f43a17c
   2b53a3ca8c2fa declared separate /usr unsupported. What is really the 
   reason
   for it?
  
  This does seem odd. Might I also point out...
  
  From http://www.pathname.com/fhs/pub/fhs-2.3.html#THEROOTFILESYSTEM
  
  To boot a system, enough must be present on the root partition to mount 
  other 
  filesystems. This includes utilities, configuration, boot loader 
  information, 
  and other essential start-up data. /usr, /opt, and /var are designed such 
  that 
  they may be located on other partitions or filesystems.
 
 Well, turns out no distro really follows the spec here, do they?

Hmmm ... AFAIK we do.  If things do not work, then it has to be fixed
as we have users/customers around definitely use this feature.

 I think this is mostly wishful thinking by some folks who wrote the FHS,
 and does not describe what really is.

As FHS specs are part of the LSB, all Enterprise prooducts should
follow the FHS.

 Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] /usr on separate file system

2011-03-07 Thread Dr. Werner Fink
On Mon, Mar 07, 2011 at 04:18:16PM +0100, Kay Sievers wrote:
 On Mon, Mar 7, 2011 at 16:04, Dr. Werner Fink wer...@suse.de wrote:
 
  Hmmm ... AFAIK we do.  If things do not work, then it has to be fixed
  as we have users/customers around definitely use this feature.
 
 I doubt anybody will be able to fix all the issues. These customers
 need to copy /usr to the rootfs if they want a supported system
 running systemd.

Those customers have payed for support including this feature
and some of them exactly for this feature.  I'm not going to
ignore this hard requirement for snugness.  If it is not possible
for systemd to fulfille the LSB spec systemd is not ready for
Enterprise products.

It has to be possible to fulfill FHS not only in theory but
in practice.  That is that if an network interface has to up
for the NFS share /usr then systemd should support this.

  I think this is mostly wishful thinking by some folks who wrote the FHS,
  and does not describe what really is.
 
  As FHS specs are part of the LSB, all Enterprise prooducts should
  follow the FHS.
 
 LSB documents practice and can not dictate anything. Most distros do
 not care much what's written there.

As already told, this is wrong.

 We are about to change some of the practice now, and I guess LSB needs
 to be updated. :)

You may try it.  Now let us see what happens.

   Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] /usr on separate file system

2011-03-07 Thread Dr. Werner Fink
On Mon, Mar 07, 2011 at 04:50:16PM +0100, Kay Sievers wrote:
 On Mon, Mar 7, 2011 at 16:44, Dr. Werner Fink wer...@suse.de wrote:
 
  Those customers have payed for support including this feature
  and some of them exactly for this feature.  I'm not going to
  ignore this hard requirement for snugness.  If it is not possible
  for systemd to fulfille the LSB spec systemd is not ready for
  Enterprise products.
 
  It has to be possible to fulfill FHS not only in theory but
  in practice.  That is that if an network interface has to up
  for the NFS share /usr then systemd should support this.
 
 The 1000ths time: it has nothing to do with systemd, and it fails
 today already in many setups, also with sysv.

As I'm the maintainer of sysvinit here, I'd like to know which
setup fails.

   I think this is mostly wishful thinking by some folks who wrote the FHS,
   and does not describe what really is.
  
   As FHS specs are part of the LSB, all Enterprise prooducts should
   follow the FHS.
 
  LSB documents practice and can not dictate anything. Most distros do
  not care much what's written there.
 
  As already told, this is wrong.
 
 LSB means nothing for many distros, and you can tell it wrong, but it
 will not change anything.

Hmmm ... AFAIK RedHat has not left the Linux Foundation, does this
mean that RedHat will ignore the results of the LSB working group?

  We are about to change some of the practice now, and I guess LSB needs
  to be updated. :)
 
  You may try it.  Now let us see what happens.
 
 What will happen is that /usr will be on the rootfs. :)

All joking apart, I'd like to see some generic support within
systemd for partitions as specified in FHS ;)


   Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Missing shared library for functions of sd-daemon.c

2010-11-26 Thread Dr. Werner Fink
Hi,

just what the subject says, I'm missing a shared library which
shares the functions of sd-daemon.c. Then the developers here
around could remove the several copies of sd-daemon.c and
sd-daemon.h.

Is there a plan to create such a library and install the header
sd-daemon.h to ${prefix}/include?  Also I've not found the
manual page(s) mentioned in sd-daemon.h.  Only the main page
sd-daemon(7) is found.

   Werner

-- 
  Having a smoking section in a restaurant is like having
  a peeing section in a swimming pool. -- Edward Burr
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel